CH·02CLI reference

gpu secrets import

Import secrets from a .env file or an Infisical export

Import secrets from a .env file or an Infisical export

Synopsis

Imports many secrets at once. The file can be:

  • Infisical JSON, from infisical export --format=json
  • dotenv, from infisical export --format=dotenv or any NAME=value file
  • a JSON object of name to value
The file is parsed on your machine and sent over HTTPS. Every name and value is checked before anything is saved, so a bad line saves nothing. Existing secrets are skipped unless --overwrite is set. Use --file - to read standard input.
gpu secrets import --file PATH [flags]

Examples

# From Infisical, through a file
infisical export --env=prod --format=json > secrets.json
gpu secrets import --file secrets.json
rm secrets.json

# Straight through a pipe, replacing values that already exist
infisical export --env=prod --format=dotenv | gpu secrets import --file - --overwrite

# Any .env file
gpu secrets import --file .env

Output

Created (2): HF_TOKEN, WANDB_API_KEY
Skipped, already exist (1): DB_URL
Pass --overwrite to replace the values of existing secrets.

Options

  -f, --file string   File to import (dotenv, Infisical JSON, or a JSON object); - for standard input
  -h, --help          help for import
      --overwrite     Replace the values of secrets that already exist

Options inherited from parent commands

      --api-base string   API base URL (override with GPUAI_API_BASE env) (default "https://api.gpu.ai/v1")
      --debug             Enable debug logging to stderr
  -o, --output string     Output format: table|json (default table on TTY, json otherwise)

SEE ALSO

  • gpu secrets - Store secrets once and hand them to instances, functions, and jobs

← The gpu CLI