CH·02CLI reference

gpu secrets set

Create a secret or replace its value

Create a secret or replace its value

Synopsis

Creates the secret NAME, or replaces its value if it exists. NAME is the environment variable the value is delivered as.

The value is read from --from-file, from standard input when it is piped, or from a hidden prompt when run in a terminal. It is never taken as an argument, so it does not end up in your shell history or a process listing. One trailing newline is removed unless --keep-newline is set.

Machines already running keep the value they were given. The next launch, function call, or job gets the new one.

Names follow environment variable rules: a letter or underscore, then letters, digits, and underscores, at most 128 characters. Names starting with GPUAI_ and a few system names such as PATH and LD_PRELOAD are reserved. A value can be up to 32 KiB.

gpu secrets set NAME [flags]

Examples

# Prompts for the value without echo
gpu secrets set HF_TOKEN

# From a script or another tool
printf %s "$TOKEN" | gpu secrets set HF_TOKEN

# A multi-line value, kept exactly as in the file
gpu secrets set TLS_KEY --from-file key.pem --keep-newline --description "API TLS key"

Options

      --description string   A short note shown with the secret (not secret)
      --from-file string     Read the value from this file
  -h, --help                 help for set
      --keep-newline         Keep a trailing newline in the value

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