Skip to main content

tuna secrets

Secrets operations.

Alias: secret.

Guide with examples: Secrets in the CLI.

FlagDescription
--api-key stringYour tuna.am api key (env TUNA_API_KEY).
-o, --output stringOutput format (text, json or yaml).

Subcommands​

CommandDescription
tuna secrets configsManage secrets configs.
tuna secrets deleteDelete one or more secrets.
tuna secrets downloadDownload a config's secrets.
tuna secrets environmentsManage secrets environments.
tuna secrets getGet the value of one or more secrets.
tuna secrets listList secrets in a config.
tuna secrets openOpen the secrets dashboard in a browser.
tuna secrets projectsManage secrets projects.
tuna secrets runRun a command with injected secrets.
tuna secrets setSet the value of one or more secrets.
tuna secrets setupBind a directory to a secrets project and config.
tuna secrets substituteSubstitute secrets into a template file.
tuna secrets uploadUpload secrets from a .env or .json file.

tuna secrets configs​

Manage secrets configs.

Alias: config.

Usage
tuna secrets configs [flags]
FlagDescription
-c, --config stringConfiguration name (the CLI config file path is controlled by TUNA_CONFIG).
--environment stringFilter configs by environment slug.
-p, --project stringProject name.
--scope stringDirectory to scope configuration. Default: ..

Also accepts the flags of tuna secrets.

CommandDescription
tuna secrets configs cloneClone a config within its environment.
tuna secrets configs createCreate a config in an environment.
tuna secrets configs deleteDelete a config.
tuna secrets configs getGet info for a config.
tuna secrets configs lockLock a config to prevent changes.
tuna secrets configs logsList config audit logs.
tuna secrets configs renameRename a config.
tuna secrets configs tokensManage a config's service tokens.
tuna secrets configs unlockUnlock a config.

tuna secrets configs clone​

Clone a config within its environment.

Usage
tuna secrets configs clone [config] [flags]
FlagDescription
-c, --config stringConfiguration name (the CLI config file path is controlled by TUNA_CONFIG).
--name stringName of the new config.
-p, --project stringProject name.
--scope stringDirectory to scope configuration. Default: ..

Also accepts the flags of tuna secrets.

tuna secrets configs create​

Create a config in an environment.

Usage
tuna secrets configs create [name] [flags]
FlagDescription
-c, --config stringConfiguration name (the CLI config file path is controlled by TUNA_CONFIG).
--environment stringEnvironment slug.
--lockedCreate the config locked.
-p, --project stringProject name.
--scope stringDirectory to scope configuration. Default: ..

Also accepts the flags of tuna secrets.

tuna secrets configs delete​

Delete a config.

Alias: rm.

Usage
tuna secrets configs delete [config] [flags]
FlagDescription
-y, --yesSkip the confirmation prompt.
-c, --config stringConfiguration name (the CLI config file path is controlled by TUNA_CONFIG).
-p, --project stringProject name.
--scope stringDirectory to scope configuration. Default: ..

Also accepts the flags of tuna secrets.

tuna secrets configs get​

Get info for a config.

Usage
tuna secrets configs get [config] [flags]
FlagDescription
-c, --config stringConfiguration name (the CLI config file path is controlled by TUNA_CONFIG).
-p, --project stringProject name.
--scope stringDirectory to scope configuration. Default: ..

Also accepts the flags of tuna secrets.

tuna secrets configs lock​

Lock a config to prevent changes.

Usage
tuna secrets configs lock [config] [flags]
FlagDescription
-c, --config stringConfiguration name (the CLI config file path is controlled by TUNA_CONFIG).
-p, --project stringProject name.
--scope stringDirectory to scope configuration. Default: ..

Also accepts the flags of tuna secrets.

tuna secrets configs logs​

List config audit logs.

Usage
tuna secrets configs logs [flags]
FlagDescription
-c, --config stringConfiguration name (the CLI config file path is controlled by TUNA_CONFIG).
--page intPage number.
--page-size intPage size.
-p, --project stringProject name.
--scope stringDirectory to scope configuration. Default: ..

Also accepts the flags of tuna secrets.

tuna secrets configs rename​

Rename a config.

Usage
tuna secrets configs rename [config] [flags]
FlagDescription
-c, --config stringConfiguration name (the CLI config file path is controlled by TUNA_CONFIG).
--name stringNew config name.
-p, --project stringProject name.
--scope stringDirectory to scope configuration. Default: ..

Also accepts the flags of tuna secrets.

tuna secrets configs tokens​

Manage a config's service tokens.

Alias: token.

Usage
tuna secrets configs tokens [flags]
FlagDescription
-c, --config stringConfiguration name (the CLI config file path is controlled by TUNA_CONFIG).
-p, --project stringProject name.
--scope stringDirectory to scope configuration. Default: ..

Also accepts the flags of tuna secrets.

CommandDescription
tuna secrets configs tokens createCreate a service token for a config.
tuna secrets configs tokens revokeRevoke a service token.

tuna secrets configs tokens create​

Create a service token for a config.

Usage
tuna secrets configs tokens create [flags]
FlagDescription
--access stringToken access (read or write). Default: read.
-c, --config stringConfiguration name (the CLI config file path is controlled by TUNA_CONFIG).
--description stringToken description.
--max-age stringToken lifetime as Go duration (e.g. 720h); empty means no expiration.
--plainPrint only the token without a trailing newline.
-p, --project stringProject name.
--scope stringDirectory to scope configuration. Default: ..

Also accepts the flags of tuna secrets.

tuna secrets configs tokens revoke​

Revoke a service token.

Alias: delete, rm.

Usage
tuna secrets configs tokens revoke ID [flags]
FlagDescription
-y, --yesSkip the confirmation prompt.

Also accepts the flags of tuna secrets.

tuna secrets configs unlock​

Unlock a config.

Usage
tuna secrets configs unlock [config] [flags]
FlagDescription
-c, --config stringConfiguration name (the CLI config file path is controlled by TUNA_CONFIG).
-p, --project stringProject name.
--scope stringDirectory to scope configuration. Default: ..

Also accepts the flags of tuna secrets.

tuna secrets delete​

Delete one or more secrets.

Alias: rm.

Usage
tuna secrets delete KEY... [flags]
FlagDescription
-y, --yesSkip the confirmation prompt.
-c, --config stringConfiguration name (the CLI config file path is controlled by TUNA_CONFIG).
-p, --project stringProject name.
--scope stringDirectory to scope configuration. Default: ..

Also accepts the flags of tuna secrets.

tuna secrets download​

Download a config's secrets.

Usage
tuna secrets download [filename] [flags]
FlagDescription
-c, --config stringConfiguration name.
--format stringOutput format (json, yaml, env, env-no-quotes or docker). Default: json.
--name-transformer stringTransform secret names (upper-camel, camel, lower-snake, lower-kebab, tf-var, dotnet or dotnet-env).
--no-filePrints response to Stdout.
-p, --project stringProject name.
--scope stringDirectory to scope configuration. Default: ..

Also accepts the flags of tuna secrets.

tuna secrets environments​

Manage secrets environments.

Alias: envs, environment.

Usage
tuna secrets environments [flags]
FlagDescription
-c, --config stringConfiguration name (the CLI config file path is controlled by TUNA_CONFIG).
-p, --project stringProject name.
--scope stringDirectory to scope configuration. Default: ..

Also accepts the flags of tuna secrets.

CommandDescription
tuna secrets environments createCreate an environment.
tuna secrets environments deleteDelete an environment.
tuna secrets environments getGet info for an environment.
tuna secrets environments renameRename an environment.

tuna secrets environments create​

Create an environment.

Usage
tuna secrets environments create NAME [flags]
FlagDescription
-c, --config stringConfiguration name (the CLI config file path is controlled by TUNA_CONFIG).
--personal-configsEnable personal configs for the environment.
-p, --project stringProject name.
--scope stringDirectory to scope configuration. Default: ..
--slug stringEnvironment slug (defaults to a slugified name).

Also accepts the flags of tuna secrets.

tuna secrets environments delete​

Delete an environment.

Alias: rm.

Usage
tuna secrets environments delete ENVIRONMENT [flags]
FlagDescription
-y, --yesSkip the confirmation prompt.
-c, --config stringConfiguration name (the CLI config file path is controlled by TUNA_CONFIG).
-p, --project stringProject name.
--scope stringDirectory to scope configuration. Default: ..

Also accepts the flags of tuna secrets.

tuna secrets environments get​

Get info for an environment.

Usage
tuna secrets environments get ENVIRONMENT [flags]
FlagDescription
-c, --config stringConfiguration name (the CLI config file path is controlled by TUNA_CONFIG).
-p, --project stringProject name.
--scope stringDirectory to scope configuration. Default: ..

Also accepts the flags of tuna secrets.

tuna secrets environments rename​

Rename an environment.

Usage
tuna secrets environments rename ENVIRONMENT [flags]
FlagDescription
-c, --config stringConfiguration name (the CLI config file path is controlled by TUNA_CONFIG).
--name stringNew environment name.
-p, --project stringProject name.
--scope stringDirectory to scope configuration. Default: ..
--slug stringNew environment slug.

Also accepts the flags of tuna secrets.

tuna secrets get​

Get the value of one or more secrets.

Usage
tuna secrets get KEY... [flags]
FlagDescription
-c, --config stringConfiguration name (the CLI config file path is controlled by TUNA_CONFIG).
--plainPrint only raw values without a trailing newline (multiple values are separated by newlines).
-p, --project stringProject name.
--scope stringDirectory to scope configuration. Default: ..

Also accepts the flags of tuna secrets.

tuna secrets list​

List secrets in a config.

Alias: ls.

Usage
tuna secrets list [flags]
FlagDescription
-c, --config stringConfiguration name (the CLI config file path is controlled by TUNA_CONFIG).
--only-namesOnly print the secret names.
-p, --project stringProject name.
--scope stringDirectory to scope configuration. Default: ..
--valuesShow values instead of fingerprints in the VALUE column.

Also accepts the flags of tuna secrets.

tuna secrets open​

Open the secrets dashboard in a browser.

Usage
tuna secrets open [flags]
FlagDescription
-c, --config stringConfiguration name (the CLI config file path is controlled by TUNA_CONFIG).
-p, --project stringProject name.
--scope stringDirectory to scope configuration. Default: ..

Also accepts the flags of tuna secrets.

tuna secrets projects​

Manage secrets projects.

Alias: project.

Usage
tuna secrets projects

Also accepts the flags of tuna secrets.

CommandDescription
tuna secrets projects createCreate a project.
tuna secrets projects deleteDelete a project.
tuna secrets projects getGet info for a project.
tuna secrets projects updateUpdate a project.

tuna secrets projects create​

Create a project.

Usage
tuna secrets projects create [name] [flags]
FlagDescription
--description stringProject description.
--slug stringProject slug (defaults to a slugified name).

Also accepts the flags of tuna secrets.

tuna secrets projects delete​

Delete a project.

Alias: rm.

Usage
tuna secrets projects delete [project] [flags]
FlagDescription
-y, --yesSkip the confirmation prompt.

Also accepts the flags of tuna secrets.

tuna secrets projects get​

Get info for a project.

Usage
tuna secrets projects get [project] [flags]
FlagDescription
-c, --config stringConfiguration name (the CLI config file path is controlled by TUNA_CONFIG).
-p, --project stringProject name.
--scope stringDirectory to scope configuration. Default: ..

Also accepts the flags of tuna secrets.

tuna secrets projects update​

Update a project.

Usage
tuna secrets projects update [project] [flags]
FlagDescription
-c, --config stringConfiguration name (the CLI config file path is controlled by TUNA_CONFIG).
--description stringNew project description.
--name stringNew project name.
-p, --project stringProject name.
--scope stringDirectory to scope configuration. Default: ..
--slug stringNew project slug.

Also accepts the flags of tuna secrets.

tuna secrets run​

Run a command with injected secrets.

Usage
tuna secrets run -- [COMMAND] [ARGUMENTS] [flags]
FlagDescription
--command stringCommand to execute via shell (e.g. "echo $HOME && env").
-c, --config stringConfiguration name.
--fallback stringPath to the encrypted fallback file (default is derived from the configuration).
--fallback-onlyRead secrets from the fallback file without contacting the API.
--fallback-passphrase stringPassphrase for the fallback file, env TUNA_SECRETS_FALLBACK_PASSPHRASE (default is derived from the API key, project and config).
--fallback-readonlyDisable modifying the fallback file.
--forward-signalsForward signals to the child process (defaults to true when stdout is not a TTY). Default: true.
--mount stringWrite secrets to an ephemeral file (named pipe), accessible at TUNA_SECRETS_MOUNT_PATH; secrets are not injected into the environment.
--mount-format stringMount file format (env, env-no-quotes, json, yaml or docker). Default: env.
--mount-max-reads intMaximum number of times the mounted file can be read (0 for unlimited).
--mount-template stringTemplate file to render into the mount instead of a fixed format.
--name-transformer stringTransform secret names (upper-camel, camel, lower-snake, lower-kebab, tf-var or dotnet-env).
--no-fallbackDisable reading and writing the fallback file.
--offlineAlias for --fallback-only.
--only-secretsPass only secrets to the child process (plus PATH, HOME, PS1, USER, SHELL, TMPDIR).
--preserve-env stringList of secrets, comma-separated, for which the existing environment value takes precedence; "true" preserves all existing values. Default: false.
-p, --project stringProject name.
--scope stringDirectory to scope configuration. Default: ..
--watchAutomatically restart the process when secrets change.

Also accepts the flags of tuna secrets.

CommandDescription
tuna secrets run cleanDelete old fallback files.

tuna secrets run clean​

Delete old fallback files.

Usage
tuna secrets run clean [flags]
FlagDescription
--allDelete all fallback files regardless of age.
--dry-runOnly report what would be deleted.
--max-age durationDelete fallback files older than this age. Default: 336h.

Also accepts the flags of tuna secrets. Also accepts the flags of tuna secrets run.

tuna secrets set​

Set the value of one or more secrets.

Value can be passed inline (KEY=VALUE), as a separate argument (KEY VALUE), piped via stdin (echo value | tuna secrets set KEY) or entered interactively.

Usage
tuna secrets set KEY=VALUE... [flags]
FlagDescription
-c, --config stringConfiguration name (the CLI config file path is controlled by TUNA_CONFIG).
--no-interactiveDo not allow entering the secret value interactively.
--note stringNote to set on the secrets.
-p, --project stringProject name.
--scope stringDirectory to scope configuration. Default: ..
--type stringSecret value type (string, json, boolean, integer, decimal, email, url, yaml, xml, date, datetime).
--visibility stringSecret visibility (masked, unmasked or restricted).

Also accepts the flags of tuna secrets.

tuna secrets setup​

Bind a directory to a secrets project and config.

The binding is looked up from --scope up to the git repository root: the secrets section of .tuna.yml is shared with everyone who clones the repository, a personal binding in the CLI config overrides it on this machine.

Usage
tuna secrets setup [flags]
Examples
tuna secrets setup
tuna secrets setup --local -p backend -c dev
tuna secrets setup -p backend -c dev_ivan
tuna secrets setup --unset
FlagDescription
-c, --config stringConfiguration name.
--localSave the binding to the secrets section of .tuna.yml in the scope directory.
--no-interactiveFail instead of prompting when project or config is not specified.
-p, --project stringProject name.
--scope stringDirectory to scope configuration. Default: ..
--unsetRemove the personal binding of the scope directory.

Also accepts the flags of tuna secrets.

tuna secrets substitute​

Substitute secrets into a template file.

Usage
tuna secrets substitute TEMPLATE [flags]
FlagDescription
-c, --config stringConfiguration name (the CLI config file path is controlled by TUNA_CONFIG).
--output stringPath to the output file (default is stdout).
-p, --project stringProject name.
--scope stringDirectory to scope configuration. Default: ..

Also accepts the flags of tuna secrets.

tuna secrets upload​

Upload secrets from a .env or .json file.

Usage
tuna secrets upload FILE [flags]
FlagDescription
-c, --config stringConfiguration name (the CLI config file path is controlled by TUNA_CONFIG).
-p, --project stringProject name.
--scope stringDirectory to scope configuration. Default: ..

Also accepts the flags of tuna secrets.

Global flags work too.