Stashbase

Pull

Command to pull secrets from Stashbase

You can easily pull the environments and its secrets using the pull command. This command is similar to run but it will save the secrets to selected files. Stashbase CLI will automatically search for the config file stashbase.yaml file in the current directory. If there are multiple entries in the config file like above, Stashbase CLI will propmpt you to select one. The command will return error if there is not pull property in the selected entry.

Learn more about custom config files

For now you must use this command with custom config files. As with the run command you can provide the arguments to override secrets config like exclude or change the output format directly in the pull command.

stashbase pull [OPTIONS]

Options

Prop

Type

Example

This is an example of using custom config file with pull command.

Config file

- project: our-project
  environment: api_prod
  description: Used only for database migrations
  pull:
    file: secrets.yaml
  secrets:
    only:
      - DATABASE_URL

- project: our-project
  environment: api_dev
  description: Database in test environment
  pull:
    file: .env.yaml
    # specific for pull command
    secrets:
      exclude:
        - JWT_SECRET

Command

# auto detect config file in the current directory and select
stashbase pull

# provide custom config file path
stashbase pull --file my-file.yaml

# override options
stashbase pull --exclude DATABASE_URL  --file .env.local --format dotenv

On this page