awesome cli.

Security & secrets

Infisical CLI for coding agents

Secret sync, injection, project and environment targeting, and CI auth.

Open the official project ↗

This article follows the official documentation. We haven’t tested this tool for a hands-on review.

When a coding agent runs tests or a development server from your shell, it may need credentials that your project stores in a secrets manager. Infisical CLI retrieves secrets from an Infisical project and passes them as environment variables to a command you launch. An environment variable is a named value that a program reads while it runs.

Use the CLI when the agent needs a secret in a local command, such as a test that connects to a development API. The CLI contacts Infisical for the secrets, then starts the command on your machine. Because the agent can run commands in that environment, it can also read any secret those commands receive. The CLI documentation shows how to pass secrets to commands. It also explains how to choose a project and environment and how to authenticate.

Install and connect a project

On macOS with Homebrew, install the CLI with the command documented in Infisical’s CLI quickstart:

brew install infisical/get-cli/infisical

Log in with your Infisical account when you are working interactively:

infisical login

The CLI guides you through login and saves the Infisical instance you selected. For a local project, connect the current directory to an Infisical project:

infisical init

This command prompts you to select a project and links the directory to it. Run it from the project directory, and confirm that the selected project contains the environment and secrets the command needs. Infisical’s quickstart documents this install, login, and project setup flow.

For unattended use, such as a CI job or scheduled script, Infisical recommends authenticating as a machine identity rather than using a person’s interactive account. A machine identity is an account for software or automation. Set up its authentication outside the instructions you give the agent, and follow the CLI’s documented authentication options. Do not paste a client secret or other credential into an instruction for the agent.

Run a local check without printing a secret

The following example checks that a development secret reaches a local Node.js process without displaying its value:

infisical run --env=dev --path=/ -- node -e 'console.log(process.env.SERVICE_API_KEY ? "SERVICE_API_KEY is set" : "SERVICE_API_KEY is missing")'

Replace dev with an environment in your project, and replace SERVICE_API_KEY with the name of a secret stored at the project’s root folder. The --env flag selects the environment; --path=/ selects the root folder. The -- separates Infisical’s options from the command to run. Infisical fetches the selected secrets and makes them available to the child process, which runs a short Node.js check.

The check prints either SERVICE_API_KEY is set or SERVICE_API_KEY is missing, depending on whether the process received that variable. It does not print the secret itself. The Infisical request is a network call; the Node.js check runs locally. This example reads secrets and starts a local process. It does not write secrets back to Infisical or change the remote project.

A coding agent could use the same pattern after editing code that needs a development credential:

Run the project’s tests with Infisical using the dev environment. Do not print or inspect secret values. Report whether the tests pass and summarize any failures.

Give the agent only the access it needs. If the tests require production credentials, reconsider whether the agent should run them: any shell command the agent can launch in that environment can potentially read the injected variables.

Know what the CLI exposes

The CLI passes secrets into the command’s environment, so the launched program and processes it starts can access them. A test, script, or agent command that prints environment variables can expose their values in terminal output or logs. Keep the example’s check limited to presence, and use development credentials for agent-run work.

Infisical also documents Agent Proxy, which handles credentials at the network boundary instead of passing them to the agent’s process. That approach is designed for agents that need to call services without receiving the real credentials directly. The CLI’s run command and Agent Proxy address different access patterns: use run when a local command needs environment variables, and evaluate the proxy when you want to avoid handing those values to the agent process.

Tool details come from awesome-ai-cli.