Doppler CLI Documentation

repository·master·Indexed 18 days ago

https://github.com/dopplerhq/cli

The official command-line tool for interacting with Doppler secrets and configuration. It enables developers to manage secrets, projects, and environments, and execute applications with secrets automatically injected into their environment. The CLI supports installation via Homebrew, Winget, Scoop, and various Linux package managers (apk, apt, yum), as well as Docker and GitHub Actions.

Tokens
20.9K
Snippets
130
Records
138
Agent score
62%

What's inside Doppler CLI

  1. Manage CLI authentication scope

    master

    When logging in, you can control the reach of your authentication token using the --scope flag. This determines which directories can access the Doppler credentials.

    • Global scope (Default): --scope=/ (accessible from any subdirectory).
    • Current directory scope: doppler login --scope=./.
    • Specific path scope: doppler login --scope ~/projects/backend.
    $ doppler login --scope=./
  2. Install the Doppler CLI on macOS

    master

    You can install the Doppler CLI on macOS using Homebrew, which is the recommended method. Alternatively, you can use a shell script or a .pkg file from the Releases page. Note that manual installations via shell script or .pkg install the binary to /usr/local/bin and do not support seamless updates; you must re-run the installation to update.

    # Using Homebrew (Recommended)
    $ brew install dopplerhq/cli/doppler
    $ doppler --version
    
    # To update
    $ brew upgrade doppler
  3. Use the Doppler CLI in Docker or GitHub Actions

    master
    • Docker: Use the dopplerhq/cli image, which is based on Alpine. Detailed guidance can be found in the Doppler documentation.
    • GitHub Actions: Use the cli-action to install the latest version of the CLI within your workflows.
  4. Install the Doppler CLI on Windows

    master

    The Doppler CLI can be installed on Windows using Winget (recommended), Scoop, or Git Bash.

    # Using Winget (Recommended)
    $ winget install doppler
    $ doppler --version
    
    # To update
    $ winget upgrade doppler
    
    # Using Scoop
    $ scoop bucket add doppler https://github.com/DopplerHQ/scoop-doppler.git
    $ scoop install doppler
    $ doppler --version
    
    # To update
    $ scoop update doppler
    
    # Using Git Bash
    $ mkdir -p $HOME/bin
    $ curl -Ls --tlsv1.2 --proto "=https" --retry 3 https://cli.doppler.com/install.sh | sh -s -- --install-path $HOME/bin
    $ doppler --version
  5. Install the Doppler CLI via Shell Script

    master

    For quick installations or ephemeral environments like CI jobs, you can use a POSIX-compliant shell script. This script automatically detects your architecture and installs the appropriate binary. For long-lived environments, using a package manager is recommended to ensure seamless updates.

    (curl -Ls --tlsv1.2 --proto "=https" --retry 3 https://cli.doppler.com/install.sh || wget -t 3 -qO- https://cli.doppler.com/install.sh) | sh
  6. Build the Doppler CLI for development

    master

    To build the Doppler CLI from source for development purposes, ensure you have Golang installed on your system. Use the make build command to compile the binary.

    $ make build
    $ ./doppler --version
  7. Install the Doppler CLI on Linux

    master

    The Doppler CLI is available for several Linux distributions via their respective package managers.

    # Alpine (apk)
    $ wget -q -t3 'https://packages.doppler.com/public/cli/rsa.8004D9FF50437357.key' -O /etc/apk/keys/cli@doppler-8004D9FF50437357.rsa.pub
    $ echo 'https://packages.doppler.com/public/cli/alpine/any-version/main' | tee -a /etc/apk/repositories
    $ apk add doppler
    $ doppler --version
    
    # To update Alpine
    $ apk upgrade doppler
    
    # Debian/Ubuntu (apt)
    $ apt-get update && apt-get install -y apt-transport-https ca-certificates curl gnupg sudo
    $ curl -sLf --retry 3 --tlsv1.2 --proto "=https" 'https://packages.doppler.com/public/cli/gpg.DE2A7741A397C129.key' | gpg --dearmor | sudo tee /etc/apt/keyrings/doppler.gpg >/dev/null
    $ echo "deb [signed-by=/etc/apt/keyrings/doppler.gpg] https://packages.doppler.com/public/cli/deb/debian any-version main" | sudo tee /etc/apt/sources.list.d/doppler-cli.list
    $ sudo apt-get update && sudo apt-get install doppler
    $ doppler --version
    
    # To update Debian/Ubuntu
    $ sudo apt-get update && sudo apt-get upgrade doppler
    
    # RedHat/CentOS (yum)
    $ sudo rpm --import 'https://packages.doppler.com/public/cli/gpg.DE2A7741A397C129.key'
    $ curl -sLf --retry 3 --tlsv1.2 --proto "=https" 'https://packages.doppler.com/public/cli/config.rpm.txt' | sudo tee /etc/yum.repos.d/doppler-cli.repo
    $ sudo yum update && sudo yum install doppler
    $ doppler --version
    
    # To update RedHat/CentOS
    $ sudo yum update doppler
  8. Install the Doppler CLI

    master

    The Doppler CLI is the official tool for managing secrets, projects, and environments, and for executing applications with injected secrets. You can install it via several methods depending on your operating system or environment.

    ### macOS (via Homebrew)
    $ brew install dopplerhq/cli/doppler
    $ doppler --version
    
    ### Windows (via winget)
    $ winget install doppler
    $ doppler --version
    
    ### Shell Script (Recommended for CI)
    $ (curl -Ls --tlsv1.2 --proto "=https" --retry 3 https://cli.doppler.com/install.sh || wget -t 3 -qO- https://cli.doppler.com/install.sh) | sh
  9. Install the Doppler CLI via Docker or GitHub Action

    master

    For containerized environments or CI/CD pipelines, you can use the following methods:

    • Docker: Follow the specific instructions in the Install documentation.
    • GitHub Action: Use the official cli-action repository to integrate the CLI into your workflows.
  10. Release a new version

    master

    Releases are managed via a GitHub Action. To release a new version:

    1. Manually trigger the release GitHub Action.
    2. Specify whether to bump the major, minor, or patch version.

    Note: Releasing requires approval from a CLI admin before the action can execute.

  11. Set up the Doppler CLI

    master

    To begin using the CLI, you must authorize it to access your Doppler workplace and then select your specific project and configuration. This is a two-step process:

    1. Login: Generate authentication credentials.
    2. Setup: Select your project and configuration.

    By default, doppler login scopes the auth token to the root directory (--scope=/), making it accessible to any subdirectory. You can restrict this using the --scope flag (e.g., doppler login --scope=./).

    doppler setup scopes the selected project and config to the current directory (--scope=./) by default. You can modify this using the --scope flag.

    $ doppler login                     # generate auth credentials
    $ doppler setup                     # select your project and config
    # optional
    $ doppler configure --all           # view local configuration