Skip to content

secret create

Creates and stores a new Secret using the FlexAI Secret Store.

By default, when the -p/--value-stdin flag is not passed, a Secret’s value is entered interactively through a masked prompt where you can either enter the value manually or paste it.

Terminal window
flexai secret create <secret_name>
secret_name
<string>
Required

The name that will be used to identify the Secret while performing operations on it.

Examples
  • hf-token-dev
Optional
String

Take the Secret’s value directly from the Standard input (stdin) instead of the default interactive prompt.

Especially useful for storing secrets from environment variables or files.

Examples
  • cat gcp-service-account.json | flexai secret create gcp-sa --value-stdin
  • echo $HF_TOKEN | flexai secret create -p hf-token-dev
Terminal window
flexai secret create hf-token-dev
Secret Value: █

Setting a Secret’s value from an Environment Variable:

Terminal window
cat gcp-service-account.json | flexai secret create -p secret-from-sa-file