Skip to main content

Description

This command enables you to perform CRUD (create, read, update, delete) operations on secrets within your Infisical project. With it, you can view, create, update, and delete secrets in your environment.

Sub-commands

infisical secrets

Use this command to print out all of the secrets in your project

Environment variables

Used to fetch secrets via a machine identity apposed to logged in credentials. Simply, export this variable in the terminal before running this command.
Alternatively, you may use service tokens.
Used to disable the check for new CLI versions. This can improve the time it takes to run this command. Recommended for production environments.To use, simply export this variable in the terminal before running this command.

Flags

Parse shell parameter expansions in your secretsDefault value: true
The project ID to fetch secrets from. This is required when using a machine identity to authenticate.
Used to select the environment name on which actions should be taken onDefault value: dev
The --path flag indicates which project folder secrets will be injected from.
The --plain flag will output all your secret values without formatting, one per line.
The --silent flag disables output of tip/info messages. Useful when running in scripts or CI/CD pipelines.
Can be used inline to replace INFISICAL_DISABLE_UPDATE_CHECK
This command allows you selectively print the requested secrets by name

Flags

Used to select the environment name on which actions should be taken onDefault value: dev
The --plain flag will output all your requested secret values without formatting, one per line.Default value: false
When running in CI/CD environments or in a script, set INFISICAL_DISABLE_UPDATE_CHECK=true or add the --silent flag. This will help hide any CLI info/debug output and only show the secret value.
The --silent flag disables output of tip/info messages. Useful when running in scripts or CI/CD pipelines.
Can be used inline to replace INFISICAL_DISABLE_UPDATE_CHECK
Use --plain instead, as it supports single and multiple secrets.Used to print the plain value of a single requested secret without any table style.Default value: falseExample: infisical secrets get DOMAIN --raw-value
When running in CI/CD environments or in a script, set INFISICAL_DISABLE_UPDATE_CHECK=true or add the --silent flag. This will help hide any CLI info/debug output and only show the secret value.
This command allows you to set or update secrets in your environment. If the secret key provided already exists, its value will be updated with the new value. If the secret key does not exist, a new secret will be created using both the key and value provided.
When setting secret values:
  • Use secretName=@path/to/file to load the secret value from a file
  • Use secretName=\@value if you need the literal ’@’ character at the beginning of your value
Example:

Flags

Used to select the environment name on which actions should be taken onDefault value: dev
Used to select the project folder in which the secrets will be set. This is useful when creating new secrets under a particular path.
Used to select the type of secret to create. This could be either personal or shared (defaults to shared)
Used to attach tags to the secret. If a tag does not exist on the server, it will be created automatically. This flag overrides any existing tags on the secret. If not provided, existing tags are kept intact. You can specify multiple --tag flags to add multiple tags.
Used to set secrets from a file, supporting both .env and YAML formats. The file path can be either absolute or relative to the current working directory.The file should contain secrets in the following formats:
  • key=value for .env files
  • key: value for YAML files
Comments can be written using # comment or // comment. Empty lines will be ignored during processing.
This command allows you to delete secrets by their name(s).

Flags

Used to select the environment name on which actions should be taken onDefault value: dev
The --path flag indicates which project folder secrets will be injected from.
This command allows you to fetch, create and delete folders from within a path from a given project.

sub commands

Used to fetch all folders within a path in a given project

Flags

The path from where folders should be fetched fromDefault value: /
Fetch folders using a machine identity access token.Default value: “
Used to create a folder by name within a path.

Flags

Path to where the folder should be createdDefault value: /
Name of the folder to be created in selected --pathDefault value: “
Used to delete a folder by name within a path.

Flags

Path to where the folder should be createdDefault value: /
Name of the folder to be deleted within selected --pathDefault value: “
This command allows you to generate an example .env file from your secrets and with their associated comments and tags. This is useful when you would like to let others who work on the project but do not use Infisical become aware of the required environment variables and their intended values.To place default values in your example .env file, you can simply include the syntax DEFAULT:<value> within your secret’s comment in Infisical. This will result in the specified value being extracted and utilized as the default.

Flags

Used to select the environment name on which actions should be taken onDefault value: dev