Portability. Precompiled binaries can be distributed without dependencies.
Extensibility. Custom travis-<foo> subcommands are usable if in PATH.
Current design:
Each commands/*.go file registers a command
Commands can have subcommands
You can register global and (sub)command specific flags which than will be parsed and passed automatically
A help for all (sub)commands with the registered flags is created automatically
Each (sub)command gets a TravisCommandConfig
This Travis HTTP client fetches the API manifest once and performs subsequent actions by expanding the URI templates found within.
Calls to unregistered commands are dispatched to travis-<foo> executables in PATH. The following environment is provided: TRAVIS_REPO, TRAVIS_TOKEN and TRAVIS_ENDPOINT. If the --debug flag is provided TRAVIS_DEBUG will also be set.
The custom travis-<foo> scripts can be implemented in any scripting language and may consume the travis api command to dispatch manual API requests.
Compatibility with travis.rb:
General
Commands and Flags are the same unless noted below
The output is close to the original
The same configuration file is used and the stored tokens and endpoint configuration are taken into account
A configuration written by go-travis is not in all cases compatible with the old client
Differences in usage compared to travis.rb:
Flags like -r are available for all commands (see list below)
The raw command works different
The -i, --[no-]interactive flag has been replaced by the --no-color flag
--adapter is no longer available
For enable, history, login, repos, show, status and whatsup are still some flags missing
travis.rb functionality (checked means it has been implemented in go-travis):
travis branches displays the most recent build for each branch
travis cache lists or deletes repository caches Needs v3 Endpoint
travis cancel cancels a job or build
travis cron(not yet merged into the old client)
travis crons(not yet merged into the old client)
travis disable disables a project
travis enable enables a project
travis encrypt encrypts values for the .travis.yml
travis endpoint displays or changes the API endpoint
travis env show or modify build environment variables
travis help helps you out when in dire need of information
travis history displays a projects build history
travis init generates a .travis.yml and enables the project
travis lint display warnings for a .travis.yml
travis login authenticates against the API and stores the token
travis logout deletes the stored API token
travis logs streams test logs
travis open opens a build or job in the browser
travis pubkey prints out a repository's public key Needs v3 Endpoint
travis raw makes an (authenticated) API call and prints out the result
travis report generates a report useful for filing issues
travis repos lists repositories the user has certain permissions on