LinuxCommandLibrary

doctl-account

Manage DigitalOcean account authentication

TLDR

Display account info

$ doctl account [[g|get]]
copy

Show the hourly API limit, progress towards it, and when the rate limit resets
$ doctl account [[rl|ratelimit]]
copy

Display help
$ doctl account [[-h|--help]]
copy

SYNOPSIS

doctl account subcommand [flags]

doctl account get [flags]
doctl account rate-limit [flags]

PARAMETERS

--access-token string
    DigitalOcean API access token. Can also be set via the DIGITALOCEAN_ACCESS_TOKEN environment variable.

--config string
    Path to the doctl configuration file. Defaults to $HOME/.config/doctl/config.yaml.

--format string
    Specify columns to include in the output, separated by commas (e.g., "Email,DropletLimit"). This flag is inherited from the main doctl command.

--no-header
    Disable the header row in tabular output. This flag is inherited from the main doctl command.

--output string
    Specify the output format: text (default) or json. This flag is inherited from the main doctl command.

--trace
    Enable tracing of API requests, showing HTTP request/response details. This flag is inherited from the main doctl command.

--verbose
    Enable verbose output for more detailed command execution information. This flag is inherited from the main doctl command.

DESCRIPTION

The doctl command-line interface is the official tool for interacting with the DigitalOcean API. The doctl account subcommand is specifically designed to retrieve information about the currently authenticated DigitalOcean account and its associated API rate limits. It provides a quick and easy way to verify the active user, check the account's status, and monitor API consumption directly from the terminal.


This subcommand is crucial for administrators and developers working with DigitalOcean resources, allowing them to gain insights into their account's overall health and adherence to API limits. It offers high-level details such as the account's email, droplet limit, email verification status, and UUID, without exposing overly sensitive billing information. The primary sub-subcommands are get, which fetches general account details, and rate-limit, which displays the remaining, limit, and reset time for the API rate limits.

CAVEATS

Using doctl account requires a valid DigitalOcean API token with at least read permissions for your account. The command needs an active internet connection to communicate with the DigitalOcean API. The information returned is strictly limited by the scope and permissions granted to the API token used for authentication. Sensitive billing details like credit card numbers are not exposed through this command for security reasons.

USAGE EXAMPLES

Here are some common usage examples for doctl account:

1. Retrieve general account information:
doctl account get

2. Check API rate limits:
doctl account rate-limit

3. Get account information in JSON format:
doctl account get --output json

4. Display specific account columns (e.g., email and UUID):
doctl account get --format "Email,UUID"

AUTHENTICATION (API TOKEN)

To use doctl, you need a DigitalOcean API token. You can generate one from the DigitalOcean Control Panel under API > Tokens/Keys. Once generated, you can configure doctl by running doctl auth init and following the prompts, or by setting the DIGITALOCEAN_ACCESS_TOKEN environment variable, or by passing it directly with the --access-token flag.

HISTORY

The doctl command-line tool was developed by DigitalOcean to provide a programmatic interface for managing their cloud resources. The account subcommand has been a fundamental component since the early releases of doctl, offering users essential insights into their DigitalOcean account status and API consumption. Its evolution has paralleled the growth and diversification of DigitalOcean's services, continuously integrating new features and improving usability for managing account-specific information.

SEE ALSO

doctl(1), doctl-auth(1), doctl-compute(1), aws cli(1), gcloud(1), az(1)

Copied to clipboard