A command line tool for DigitalOcean services
Bryan Liles d01ae60521 Merge pull request #17 from digitalocean/asb/readme-update 2 years ago
cmd renaming imports 2 years ago
commands fix up imports 2 years ago
do fix up imports 2 years ago
docs generate links for section indexes 2 years ago
install add copyright headers 2 years ago
pkg fixing packages 2 years ago
pluginhost add copyright headers 2 years ago
scripts Updating release scripts for doctl 2 years ago
testdata allow reading userdata from file, for inconvenient values 3 years ago
vendor know if there is a higher released version 2 years ago
.gitignore cleaning shop 2 years ago
.travis.yml cleaning shop 2 years ago
CONTRIBUTING.md add copyright headers 2 years ago
LICENSE.txt cleaning shop 2 years ago
README.md Add basic usage examples and link to tutorial. 2 years ago
args.go add copyright headers 2 years ago
command.go add copyright headers 2 years ago
commmand_test.go add copyright headers 2 years ago
config_file.go add copyright headers 2 years ago
config_file_test.go add copyright headers 2 years ago
doit.go fix up imports 2 years ago
doit_test.go add copyright headers 2 years ago
errors.go add copyright headers 2 years ago
errors_test.go add copyright headers 2 years ago
recorder.go add copyright headers 2 years ago
sammy.txt create an installer for doit 2 years ago
util.go fix up imports 2 years ago
util_test.go add copyright headers 2 years ago

README.md

doctl

Travis Build Status

doctl is a command line interface for the DigitalOcean API.

Usage:
  doctl [command]

Available Commands:
  account     account commands
  auth        auth commands
  compute     compute commands
  version     show the current version

Flags:
  -t, --access-token string   DigitalOcean API V2 Access Token
  -h, --help                  help for doctl
  -o, --output string         output formt [text|json] (default "text")
  -v, --verbose               verbose output

Use "doctl [command] --help" for more information about a command.

Initialization

To automatically retrieve your access token from DigitalOcean, run doctl auth login. This process will authenticate you with DigitalOcean and retrieve an access token. If your shell does not have access to a web browser (because of a remote Linux shell with no DISPLAY environment variable or you’ve specified the CLIAUTH=1 flag), doctl will give you a link for offline authentication.

Configuration

By default, doctl will load a configuration file from $HOME/.doctlcfg if found.

Configuration OPTIONS

  • access-token - The DigitalOcean access token. You can generate a token in the Apps & API section of the DigitalOcean control panel or use doctl auth login.
  • output - Type of output to display results in. Choices are json or text. If not supplied, doctl will default to text.

Example:

{
  access-token: MY_TOKEN
  output: text
}

Examples

doctl is able to interact will all of your DigitalOcean resources. Below are a few common usage examples. To learn more about the features available, see the full tutorial on the DigitalOcean community site.

  • List all Droplets on your account:

    doctl compute droplet list

  • Create a Droplet:

    doctl compute droplet create <name> --region <region-slug> --image <image-slug> --size <size-slug>

  • Assign a Floating IP to a Droplet:

    doctl compute floating-ip-action assign <ip-addr> <droplet-id>

  • Create a new A record for an existing domain:

    doctl compute domain records create --record-type A --record-name www --record-data <ip-addr> <domain-name>

doctl also simplifies actions without an API endpoint. For instance, it allows you to SSH to your Droplet by name:

doctl compute ssh <droplet-name>

By default, it assumes you are using the root user. If you want to SSH as a specific user, you can do that as well:

doctl compute ssh <user>@<droplet-name>

Building and dependencies

doctl’s dependencies are managed by gvt. To add dependencies, use gvt fetch.

Releasing

To build doctl for all it’s platforms, run script/build.sh <version>. To upload doctl to Github, run script/release.sh <version>. A valid GITHUB_TOKEN environment variable with access to the bryanl/doctl repository is required.