Commands

Secrets.env includes a command-line interface. To access assistance from the command line, simply run secrets.env --help to view the full list of available commands.

secrets.env completion

Print shell completion script for this command.

You can enable completion by running following command in your terminal:

eval “$(secrets.env completion)”

secrets.env completion [OPTIONS] [[bash|zsh|fish]]

Options

-q, --quiet

Silent mode. Don’t show logs until error.

-v, --verbose

Increase output verbosity.

Arguments

SHELL

Optional argument

secrets.env run

Load values into environment variable then run the command.

Make secrets.env reads the configuration file, loads values from the defined sources, sets the environment variables, and then executes the specified command within this updated environment.

Note that the command should be separated from the options with a double dash (), in order to avoid ambiguity.

secrets.env run [OPTIONS] ARGS...

Options

-f, --config <config>

Specify configuration file.

--partial

Accept partial values loading. Or stop when failed to load any value.

-q, --quiet

Silent mode. Don’t show logs until error.

-v, --verbose

Increase output verbosity.

Arguments

ARGS

Required argument(s)

secrets.env set

Manage value in per-user storage.

This command group provides a way to store user-specific information in a secure and convenient manner. By storing values in a per-user configuration, you can avoid the need to re-enter sensitive information each time you run secrets.env.

secrets.env set [OPTIONS] COMMAND [ARGS]...

password

Save or delete the password in user storage.

This command saves the password in the user’s keyring, allowing it to be used for authenticating the user to the target host.

Read password from stdin:

$ echo P@ssw0rd | secrets.env set password -t https://example.com -u demo_user -p -

When password is not provided, it will be prompted:

$ secrets.env set password -t https://example.com -u demo_user
secrets.env set password [OPTIONS] --target URL --username TEXT --password
                         TEXT

Options

-t, --target <target>

Required Specify target host name for which the password will be used.

-u, --username <username>

Required Specify the username for the target host.

-p, --password <password>

Specify the password value to store. Set to - to read from stdin. If not provided, a prompt will be shown.

-d, --delete

Delete the stored password for the target host.

-q, --quiet

Silent mode. Don’t show logs until error.

-v, --verbose

Increase output verbosity.

username

Set or delete the username in user storage.

This command saves the username in a user-specific configuration file, allowing it to be used for authenticating the user to the target host.

Read username from stdin:

$ echo demo_user | secrets.env set username -t https://example.com -u -

When username is not provided, it will be prompted:

$ secrets.env set username -t https://example.com/
secrets.env set username [OPTIONS] --target URL --username TEXT

Options

-t, --target <target>

Required Specify target host name for which the password will be used.

-u, --username <username>

Specify the username for the target host. Set to - to read from stdin. If not provided, a prompt will be shown.

-d, --delete

Delete the stored username for the target host.

-q, --quiet

Silent mode. Don’t show logs until error.

-v, --verbose

Increase output verbosity.

secrets.env shell

Spawns a shell with the specified environment variables loaded.

secrets.env shell [OPTIONS]

Options

-f, --config <config>

Specify configuration file.

--partial

Accept partial values loading. Or stop when failed to load any value.

-q, --quiet

Silent mode. Don’t show logs until error.

-v, --verbose

Increase output verbosity.

secrets.env show

Print the contents of the configuration file to the console.

It provides insight into how secrets.env interprets the configuration file. It also identifies some critical errors. However, it’s important to note that certain errors are only evaluated during runtime, so this command may not detect all potential issues.

secrets.env show [OPTIONS]

Options

-f, --config <config>

Specify configuration file.

-q, --quiet

Silent mode. Don’t show logs until error.

-v, --verbose

Increase output verbosity.