{"id":18330007,"url":"https://github.com/88plug/doctl","last_synced_at":"2025-04-09T17:39:13.521Z","repository":{"id":109352599,"uuid":"146182520","full_name":"88plug/doctl","owner":"88plug","description":"Dockerfile for running doctl command line interface for the DigitalOcean API.","archived":false,"fork":false,"pushed_at":"2018-08-26T13:45:14.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-15T10:31:43.358Z","etag":null,"topics":["commandline","digital","digitalocean","docker","dockerfile","doctl","ocean"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/88plug/doctl/","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/88plug.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-08-26T13:22:52.000Z","updated_at":"2018-08-26T13:45:15.000Z","dependencies_parsed_at":"2023-05-17T14:15:52.247Z","dependency_job_id":null,"html_url":"https://github.com/88plug/doctl","commit_stats":{"total_commits":3,"total_committers":1,"mean_commits":3.0,"dds":0.0,"last_synced_commit":"be7a66cad63c65e4e7397294fa445f96622f47cf"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/88plug%2Fdoctl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/88plug%2Fdoctl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/88plug%2Fdoctl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/88plug%2Fdoctl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/88plug","download_url":"https://codeload.github.com/88plug/doctl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248078759,"owners_count":21044171,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["commandline","digital","digitalocean","docker","dockerfile","doctl","ocean"],"created_at":"2024-11-05T19:19:33.888Z","updated_at":"2025-04-09T17:39:13.494Z","avatar_url":"https://github.com/88plug.png","language":"Dockerfile","readme":"# 88plug doctl command line interface for the DigitalOcean API.\nDockerfile for running doctl command line interface for the DigitalOcean API.\n\n# Easy Way\ndocker run -t -e DIGITALOCEAN_ACCESS_TOKEN=\"your_DO_token\" 88plug/doctl compute droplet list\n\n# doctl [![Build Status](https://travis-ci.org/digitalocean/doctl.svg?branch=master)](https://travis-ci.org/digitalocean/doctl) [![GoDoc](https://godoc.org/github.com/digitalocean/doctl?status.svg)](https://godoc.org/github.com/digitalocean/doctl) [![Go Report Card](https://goreportcard.com/badge/github.com/digitalocean/doctl)](https://goreportcard.com/report/github.com/digitalocean/doctl)\n\n```\ndoctl is a command line interface for the DigitalOcean API.\n\nUsage:\n  doctl [command]\n\nAvailable Commands:\n  account     account commands\n  auth        auth commands\n  completion  completion commands\n  compute     compute commands\n  version     show the current version\n\nFlags:\n  -t, --access-token string   API V2 Access Token\n  -u, --api-url string        Override default API V2 endpoint\n  -c, --config string         config file (default is $HOME/.config/doctl/config.yaml)\n      --context string        authentication context name\n  -h, --help                  help for doctl\n  -o, --output string         output format [text|json] (default \"text\")\n      --trace                 trace api access\n  -v, --verbose               verbose output\n\nUse \"doctl [command] --help\" for more information about a command.\n```\n\n## Installing `doctl`\n\nThere are four ways to install `doctl`: using a package manager, downloading a GitHub release, building a development version from source, or building it with [Docker](https://www.digitalocean.com/community/tutorials/the-docker-ecosystem-an-introduction-to-common-components).\n\n### Option 1 – Using a Package Manager (Preferred)\n\nA package manager allows you to install and keep up with new `doctl` versions using only a few commands. Currently, `doctl` is available as part of [Homebrew](https://brew.sh/) for macOS users and [Snap](https://snapcraft.io/) for GNU/Linux users.\n\nYou can use [Homebrew](https://brew.sh/) to install `doctl` on macOS with this command:\n\n```\nbrew install doctl\n```\n\nYou can use [Snap](https://snapcraft.io/) on [Snap-supported](https://snapcraft.io/docs/core/install) systems to install `doctl` with this command:\n\n```\nsudo snap install doctl\n```\n  #### Arch Linux \n  Arch users not using snaps can install from the [AUR](https://aur.archlinux.org/packages/doctl-bin/).\n\nSupport for Windows package managers is on the way.\n\n### Option 2 — Downloading a Release from GitHub\n\nVisit the [Releases page](https://github.com/digitalocean/doctl/releases) for the [`doctl` GitHub project](https://github.com/digitalocean/doctl), and find the appropriate archive for your operating system and architecture.  You can download the archive from from your browser, or copy its URL and retrieve it to your home directory with `wget` or `curl`.\n\nFor example, with `wget`:\n\n```\ncd ~\nwget https://github.com/digitalocean/doctl/releases/download/v1.8.3/doctl-1.8.3-linux-amd64.tar.gz\n```\n\nOr with `curl`:\n\n```\ncd ~\ncurl -OL https://github.com/digitalocean/doctl/releases/download/v1.8.3/doctl-1.8.3-linux-amd64.tar.gz\n```\n\nExtract the binary. On GNU/Linux or OS X systems, you can use `tar`.\n\n```\ntar xf ~/doctl-1.8.3-linux-amd64.tar.gz\n```\n\nOr download and extract with this oneliner:\n```\ncurl -sL https://github.com/digitalocean/doctl/releases/download/v1.8.3/doctl-1.8.3-linux-amd64.tar.gz | tar -xzv\n```\n\nOn Windows systems, you should be able to double-click the zip archive to extract the `doctl` executable.\n\nMove the `doctl` binary to somewhere in your path. For example, on GNU/Linux and OS X systems:\n\n```\nsudo mv ~/doctl /usr/local/bin\n```\n\nWindows users can follow [How to: Add Tool Locations to the PATH Environment Variable](https://msdn.microsoft.com/en-us/library/office/ee537574(v=office.14).aspx) in order to add `doctl` to their `PATH`.\n\n### Option 3 — Building the Development Version from Source\n\nIf you have a [Go environment](https://www.digitalocean.com/community/tutorials/how-to-install-go-1-6-on-ubuntu-16-04) configured, you can install the development version of `doctl` from the command line.\n\n```\ngo get -u github.com/digitalocean/doctl/cmd/doctl\n```\n\nWhile the development version is a good way to take a peek at `doctl`'s latest features before they get released, be aware that it may have bugs. Officially released versions will generally be more stable.\n\n### Option 4 — Building with Docker\n\nIf you have [Docker](https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-16-04) configured, you can build a Docker image using `doctl`'s [Dockerfile](https://github.com/digitalocean/doctl/blob/master/Dockerfile) and run `doctl` within a container.\n\n```\ndocker build -t doctl .\n```\n\nThen you can run it within a container.\n\n```\ndocker run --rm -e DIGITALOCEAN_ACCESS_TOKEN=\"your_DO_token\" doctl any_doctl_command\n```\n\n## Authenticating with DigitalOcean\n\nIn order to use `doctl`, you need to authenticate with DigitalOcean by providing an access token, which can be created from the [Applications \u0026 API](https://cloud.digitalocean.com/settings/api/tokens) section of the Control Panel. You can learn how to generate a token by following the [DigitalOcean API guide](https://www.digitalocean.com/community/tutorials/how-to-use-the-digitalocean-api-v2).\n\nDocker users will have to use the `DIGITALOCEAN_ACCESS_TOKEN` environmental variable to authenticate, as explained in the Installation section of this document.\n\nIf you're not using Docker to run `doctl`, authenticate with the `auth init` command.\n\n```\ndoctl auth init\n```\n\nYou will be prompted to enter the DigitalOcean access token that you generated in the DigitalOcean control panel.\n\n```\nDigitalOcean access token: your_DO_token\n```\n\nAfter entering your token, you will receive confirmation that the credentials were accepted. If the token doesn't validate, make sure you copied and pasted it correctly.\n\n```\nValidating token: OK\n```\n\nThis will create the necessary directory structure and configuration file to store your credentials.\n\n### Logging in to multiple DigitalOcean accounts\n\n`doctl` allows you to log in to multiple DigitalOcean accounts at the same time and easily switch between them with the use of authentication contexts.\n\nBy default, a context named `default` is used. To create a new context, run `doctl auth init --context new-context-name`. You may also pass the new context's name using the `DIGITALOCEAN_CONTEXT` variable. You will be prompted for your API access token which will be associated with the new context.\n\nTo use a non-default context, pass the context name as described above to any `doctl` command. To set a new default context, run `doctl auth switch`. This command will save the current context to the config file and use it for all commands by default if a context is not specified.\n\nThe `--access-token` flag or `DIGITALOCEAN_ACCESS_TOKEN` variable are acknowledged only if the `default` context is used. Otherwise, they will have no effect on what API access token is used. To temporarily override the access token if a different context is set as default, use `doctl --context default --access-token your_DO_token ...`.\n\n## Configuring Default Values\n\nThe `doctl` configuration file is used to store your API Access Token as well as the defaults for command flags. If you find yourself using certain flags frequently, you can change their default values to avoid typing them every time. This can be useful when, for example, you want to change the username or port used for SSH.\n\nOn OS X and Linux, `doctl`'s configuration file can be found at `${XDG_CONFIG_HOME}/doctl/config.yaml` if the `${XDG_CONFIG_HOME}` environmental variable is set. Otherwise, the config will be written to `~/.config/doctl/config.yaml`. For Windows users, the config will be available at `%LOCALAPPDATA%/doctl/config/config.yaml`.\n\nThe configuration file was automatically created and populated with default properties when you authenticated with `doctl` for the first time. The typical format for a property is `category.command.sub-command.flag: value`. For example, the property for the `force` flag with tag deletion is `tag.delete.force`.\n\nTo change the default SSH user used when connecting to a Droplet with `doctl`, look for the `compute.ssh.ssh-user` property and change the value after the colon. In this example, we changed it to the username **sammy**.\n\n```\n. . .\ncompute.ssh.ssh-user: sammy\n. . .\n```\n\nSave and close the file. The next time you use `doctl`, the new default values you set will be in effect. In this example, that means that it will SSH as the **sammy** user (instead of the default **root** user) next time you log into a Droplet.\n\n## Enabling Shell Auto-Completion\n\n`doctl` also has auto-completion support. It can be set up so that if you partially type a command and then press `TAB`, the rest of the command is automatically filled in. For example, if you type `doctl comp\u003cTAB\u003e\u003cTAB\u003e drop\u003cTAB\u003e\u003cTAB\u003e` with auto-completion enabled, you'll see `doctl compute droplet` appear on your command prompt.\n\n**Note:** Shell auto-completion is not available for Windows users.\n\nHow you enable auto-completion depends on which operating system you're using. If you installed `doctl` via Homebrew or Snap, auto-completion is activated automatically, though you may need to configure your local environment to enable it.\n\n`doctl` can generate an auto-completion script with the `doctl completion your_shell_here` command. Valid arguments for the shell are Bash (`bash`) and ZSH (`zsh`). By default, the script will be printed to the command line output.  For more usage examples for the `completion` command, use `doctl completion --help`.\n\n### Linux\n\nThe most common way to use the `completion` command is by adding a line to your local profile configuration. At the end of your `~/.profile` file, add this line:\n\n```\nsource \u003c(doctl completion your_shell_here)\n```\n\nThen refresh your profile.\n\n```\nsource ~/.profile\n```\n\n### macOS\n\nmacOS users will have to install the `bash-completion` framework to use the auto-completion feature.\n\n```\nbrew install bash-completion\n```\n\nAfter it's installed, load `bash_completion` by adding following line to your `.profile` or `.bashrc`/`.zshrc` file.\n\n```\nsource $(brew --prefix)/etc/bash_completion\n```\n\n\n## Examples\n\n`doctl` is able to interact with 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](https://www.digitalocean.com/community/tutorials/how-to-use-doctl-the-official-digitalocean-command-line-client).\n\n* List all Droplets on your account:\n```\ndoctl compute droplet list\n```\n* Create a Droplet:\n```\ndoctl compute droplet create \u003cname\u003e --region \u003cregion-slug\u003e --image \u003cimage-slug\u003e --size \u003csize-slug\u003e\n```\n* Assign a Floating IP to a Droplet:\n```\ndoctl compute floating-ip-action assign \u003cip-addr\u003e \u003cdroplet-id\u003e\n```\n* Create a new A record for an existing domain:\n```\ndoctl compute domain records create --record-type A --record-name www --record-data \u003cip-addr\u003e \u003cdomain-name\u003e\n```\n\n`doctl` also simplifies actions without an API endpoint. For instance, it allows you to SSH to your Droplet by name:\n```\ndoctl compute ssh \u003cdroplet-name\u003e\n```\n\nBy default, it assumes you are using the `root` user. If you want to SSH as a specific user, you can do that as well:\n```\ndoctl compute ssh \u003cuser\u003e@\u003cdroplet-name\u003e\n```\n\n## Building and dependencies\n\n`doctl`'s dependencies are managed with [`dep`](https://github.com/golang/dep). To add dependencies, use [`dep ensure -add github.com/foo/bar`](https://github.com/golang/dep#adding-a-dependency)\n\n## More info\n\n* [How To Use Doctl, the Official DigitalOcean Command-Line Client](https://www.digitalocean.com/community/tutorials/how-to-use-doctl-the-official-digitalocean-command-line-client)\n* [How To Work with DigitalOcean Load Balancers Using Doctl](https://www.digitalocean.com/community/tutorials/how-to-work-with-digitalocean-load-balancers-using-doctl)\n* [How To Secure Web Server Infrastructure With DigitalOcean Cloud Firewalls Using Doctl](https://www.digitalocean.com/community/tutorials/how-to-secure-web-server-infrastructure-with-digitalocean-cloud-firewalls-using-doctl) \n* [How To Work with DigitalOcean Block Storage Using Doctl](https://www.digitalocean.com/community/tutorials/how-to-work-with-digitalocean-block-storage-using-doctl) \n* [doctl Releases](https://github.com/digitalocean/doctl/releases)\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F88plug%2Fdoctl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F88plug%2Fdoctl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F88plug%2Fdoctl/lists"}