treasure-data / td

CUI Interface
https://toolbelt.treasuredata.com
49 stars 26 forks source link

= Treasure Data command line tool {Build Status}[https://circleci.com/gh/treasure-data/td.svg?style=svg] {appveyor}[https://ci.appveyor.com/project/treasure-data/td/branch/master] {Coverage Status}[https://coveralls.io/github/treasure-data/td?branch=master]

This CUI utility wraps the {Ruby Client Library td-client-ruby}[https://github.com/treasure-data/td-client-ruby] to interact with the REST API in managing databases and jobs on the Treasure Data Cloud.

For more info about Treasure Data, see https://www.treasuredata.com/.

For full documentation see https://docs.treasuredata.com/.

= Getting Started

Install td command as a gem.

> gem install td

See help message for details.

> td

You need to authorize the account, before executing any other commands.

> td account

= Sample Workflow

> td account -f                       # authorize an account
user: k@treasure-data.com
password: **********
> td database:create mydb             # create a database
> td table:create mydb www_access     # create a table

= Packaging

== Mac OS X

Disable RVM or rbenv and use ruby.pkg's ruby (/usr/local/td/ruby/bin/ruby). And then run following commands:

$ /usr/local/td/ruby/bin/gem install bundler rubyzip
$ /usr/local/td/ruby/bin/bundle install
$ /usr/local/td/ruby/bin/rake pkg:build

It uses https://github.com/treasure-data/ruby-osx-packager

== Windows

Install following binary packages:

Then run following commands on MinGW Shell:

$ mingw-get install msys-vim
$ mingw-get install msys-wget
$ gem install bundler rubyzip
$ bundle install  # don't use "--path" option
$ rake exe:build  # don't use "bundle exec"

== Bulk Import

Some of the +td+ commands prefixed with +td+ +import+ leverages the {Java Bulk Import CLI td-import-java}[https://github.com/treasure-data/td-import-java] to process and Bulk load data in the Treasure Data Cloud.

The Bulk Import CLI is downloaded automatically at the first call to any of the command that require it; the use will need internet connectivity in order to fetch the Bulk Import CLI JAR file from the {Central Maven repository}[https://repo1.maven.org/maven2/com/treasuredata/td-import/] and take advantage of these advanced features. If you need to setup a proxy, please consult this {documentation}[https://docs.treasuredata.com/display/public/INT/Legacy+Bulk+Import+Tips+and+Tricks#LegacyBulkImportTipsandTricks-UsingaProxyServer] page.

The log levels and properties of the Bulk Import CLI can be configured in a +logging.properties+ file. A default configuration is provided in a file within the gem or Toolbelt folder root, in the +java/+ folder. If you wish to customize it, please make a copy of this file and store it in the:

~/.td/java             folder on Mac OSX or Linux
%USERPROFILE%\.td\java folder on Windows

== Testing Hooks

The CLI implements several hooks to enable/disable/trigger special behaviors. These hooks are expressed as environment variables and can therefore be provided in several ways:

=== How to Use

These are the available hooks:

= Copyright

Copyright:: Copyright (c) 2015 Treasure Data Inc. License:: Apache License, Version 2.0