Skip to main content
This is the CLI reference in Markdown. Each command has the same anchor here as on that page. Anchors on that page can also point to a command’s argument, flag, or environment variable, such as #secrets-manager-run--flag-path. Here, the part before -- is the command’s heading, and the item is listed under it: #secrets-manager-run--flag-path is the --path flag under #secrets-manager-run. Some commands moved, so a link to the CLI reference can use an anchor that no longer exists. To find where an old anchor points now:
  1. If the anchor exists on the CLI reference, use it as it is
  2. Otherwise, find the longest old anchor in the list of moved anchors that the link’s anchor starts with, and replace that part with its new anchor: #<old>-<rest> becomes #<new>-<rest>
  3. If the result doesn’t exist because the command no longer has that argument or flag, use the command’s anchor, the part before --
The moved anchors:
  • #sm is now #secrets-manager
  • #sm-projects-list is now #secrets-manager-projects-get
  • #sm-secrets-folders is now #secrets-manager-folders
  • #sm-secrets-set is now #secrets-manager-secrets-create
  • #sm-secrets-folders-create--flag-name is now #secrets-manager-folders-create--arg-name
  • #sm-secrets-folders-delete--flag-name is now #secrets-manager-folders-delete--arg-name
  • #sm-secrets-generate-example-env is now #secrets-manager-secrets
  • #dynamic-secrets is now #secrets-manager-dynamic-secrets
  • #export is now #secrets-manager-secrets-export
  • #run is now #secrets-manager-run
  • #secrets is now #secrets-manager-secrets
  • #secrets-folders is now #secrets-manager-folders
  • #secrets-folders-create--flag-name is now #secrets-manager-folders-create--arg-name
  • #secrets-folders-delete--flag-name is now #secrets-manager-folders-delete--arg-name
  • #secrets-generate-example-env is now #secrets-manager-secrets
  • #secrets-set is now #secrets-manager-secrets-create
  • #pam-agentic is now #pam-access
  • #pam-agentic-access is now #pam-access

Global flags

Every command accepts these flags.

Flags

  • --domain <string> (default https://app.infisical.com): The Infisical instance to connect to, such as https://eu.infisical.com for EU Cloud or your self-hosted URL. Check out Set the Infisical instance for more information.
  • --log-destination <string>: Where to write logs: stderr or stdout. Defaults to stderr. Can also be set with LOG_DESTINATION.
  • --log-format <string>: How to format logs: console for colored text, plain for text without color, or json for structured logs. Defaults to console. Set NO_COLOR=1 to drop the colors from console. Can also be set with LOG_FORMAT.
  • --log-level <string> (-l): The lowest level of log message to print: trace, debug, info, warn, error, or fatal. Defaults to info. Can also be set with LOG_LEVEL.
  • --org <string>: The organization to use for this command, by name, slug, or ID. It overrides the profile’s organization without changing it. Can also be set with INFISICAL_ORG.
  • --profile <string>: The login profile to use for this command. Run infisical profile list to see your profiles. Can also be set with INFISICAL_PROFILE.
  • --silent: Hide update notices, the notice naming the profile in use, and the warning that a token is overriding your login. Useful in scripts and CI.
  • --telemetry (default true): Send usage telemetry to Infisical.

agent

Run the Infisical Agent, a daemon that authenticates as a machine identity and renders secrets into files for your application to read. This command runs the agent in the foreground. To run the agent as a service that starts when the machine boots, use infisical agent service install. Everything is set in the YAML configuration file, including the auth method, sinks, templates, and the Infisical instance in infisical.address, which defaults to Infisical Cloud. The global --domain flag has no effect. To pass the configuration without a file, set INFISICAL_AGENT_CONFIG_BASE64 to the base64-encoded YAML. It takes precedence over --config. For a daemon that only manages certificates, use infisical cert-manager agent.

Flags

  • --config <string> (default agent-config.yaml): The path to the agent’s YAML configuration file. Ignored when INFISICAL_AGENT_CONFIG_BASE64 is set.

Examples

Start the agent with the default config file
Start the agent with a config file elsewhere
Pass the configuration as an environment variable

agent service

Install, start, stop, or remove a service that runs the agent, so the agent starts when the machine boots and restarts if it crashes. Each command takes the service’s name, which defaults to infisical-agent. To run several agents with different configs on one machine, install each agent with its own name.
  • On Linux, you run the commands as root, and the service is a systemd service that logs to the systemd journal (sudo journalctl -u <name>)
  • On Windows, you run the commands from a terminal opened with Run as administrator, and the service is a Windows service that logs to %ProgramData%\Infisical\Agent\<name>.log (errors also go to the Windows Event Log)
The commands don’t run on macOS. start, stop, and uninstall only act on services that install created.

agent service install

Install the agent as a service that starts when the machine boots. The command doesn’t start the service, so run infisical agent service start next. The service runs as root on Linux and as LocalSystem on Windows, so it runs its own copy of the config that only administrators can change. Relative paths in the copy still resolve from the directory of the original config. The copy is:
  • /etc/infisical/agents/<name>.service-config.yaml on Linux
  • %ProgramFiles%\Infisical\Agent\<name>\service-config.yaml on Windows, next to the service’s own copy of infisical.exe (to upgrade the service, uninstall it and install it again)
To change the config, edit the original, then uninstall and install the service again. If you edit the copy instead, stop and start the service to apply the change, and also make the change in the original, because uninstall deletes the copy. install refuses a config that:
  • Sets infisical.exit-after-auth: true, which would make the agent exit after its first render
  • Reads or writes files in /home, /tmp, or /var/tmp on Linux, because the service can’t read /home and has its own private /tmp and /var/tmp (keep these files in a directory such as /etc/infisical/agents)

Arguments

  • name (optional): The service’s name. Defaults to infisical-agent.

Flags

  • --config <string> (default agent-config.yaml): The path to the agent’s YAML configuration file. The service doesn’t use INFISICAL_AGENT_CONFIG_BASE64.

Examples

Install a service on Linux
Install a service on Windows

agent service start

Start an agent service and wait until the agent has loaded its config. If the agent can’t start, the command fails and prints where to find the agent’s logs.

Arguments

  • name (optional): The service to start. Defaults to infisical-agent.

Examples

Start a service on Linux
Start a service on Windows

agent service stop

Stop an agent service and wait for the agent to exit. If the config sets infisical.revoke-credentials-on-shutdown: true, the agent revokes its credentials before it exits, which can take up to five minutes. The service starts again the next time the machine boots.

Arguments

  • name (optional): The service to stop. Defaults to infisical-agent.

Examples

Stop a service on Linux
Stop a service on Windows

agent service uninstall

Stop an agent service and remove it, along with the service’s copy of the config, so changes made only to the copy are lost. The original config and the agent’s logs stay where they are.

Arguments

  • name (optional): The service to remove. Defaults to infisical-agent.

Examples

Remove a service on Linux
Remove a service on Windows

agent start

Run the agent in the foreground, as infisical agent does, with relative paths in the config resolved from the config’s directory. The systemd service that infisical agent service install creates runs this command. Unlike infisical agent, agent start ignores INFISICAL_AGENT_CONFIG_BASE64.

Flags

  • --config <string> (default agent-config.yaml): The path to the agent’s YAML configuration file. Can also be set with INFISICAL_AGENT_CONFIG_PATH.

Examples

Start the agent with a config set in the environment

agent-vault

Run Agent Vault, which lets AI agents call services such as LLM providers, GitHub, and Slack without holding the credentials. A proxy adds the real credential to each request the agent sends. Run the proxy with infisical agent-vault proxy, usually where agent traffic leaves your network, and launch agents through it with infisical agent-vault run. Create and revoke sessions on their own with infisical agent-vault sessions create and infisical agent-vault sessions revoke. Upload skills for those agents with infisical agent-vault skills push, and list, download, and delete them with the other infisical agent-vault skills commands. Reach database and SSH services from an agent with infisical agent-vault connect. av is an alias, so infisical av run works wherever infisical agent-vault run does. Agent Vault commands don’t read domain from the project config file. To connect them to an instance other than US Cloud, pass --domain, set INFISICAL_DOMAIN, or log in to that instance.

agent-vault proxy

Run an Agent Vault proxy in the foreground. For each request, the proxy decides whether the agent’s session allows the host and attaches the real credential on the way out, so the agent never holds a secret. Start the proxy with its proxy token. You can run the proxy on as many machines as you need with the same token. Each time the proxy starts, it loads its settings and certificate authority from Infisical. If it can’t reach Infisical, it retries for 60 seconds, then starts from the cache in --data-dir if there is one, or exits. You set the proxy’s traffic policy, exceptions, and poll interval in Infisical, not with flags.

Flags

  • --ca-cert <string>: Your own certificate authority to serve instead of the one Infisical generates, as PEM text, PEM encoded as base64, or the path to a PEM file. Pass it with --ca-key. Can also be set with INFISICAL_AGENT_VAULT_CA_CERT.
  • --ca-key <string>: The ECDSA P-256 private key for --ca-cert, in the same formats. Can also be set with INFISICAL_AGENT_VAULT_CA_KEY, which keeps the key off the command line.
  • --data-dir <string>: The directory where the proxy keeps a cache of its settings and certificate authority, if the directory is writable. The proxy starts from the cache if it can’t reach Infisical. Defaults to ~/.infisical/agent-vault, or /etc/infisical/agent-vault when run as root. Can also be set with INFISICAL_AGENT_VAULT_DATA_DIR.
  • --log-file <string>: A file to also write logs to, as JSON lines. The file is appended to.
  • --log-format <string> (default console): The format of the logs written to stderr: console or json.
  • --port <int> (default 17323): The port to listen on, on all interfaces. 0 picks any free port, which the startup line reports. Can also be set with INFISICAL_AGENT_VAULT_PORT.
  • --proxy-token <string>: The proxy token, which Infisical shows once when you create the proxy or rotate its token. Can also be set with INFISICAL_AGENT_VAULT_PROXY_TOKEN, which keeps it off the command line.

Examples

Start a proxy
Serve your own certificate authority
Log JSON to a file on a custom port

agent-vault run

Launch an agent with its HTTP traffic routed through an Agent Vault proxy. The agent needs a session. You can provide one in either of the following ways: If you pass --access-bundle, the command also needs the Agent Vault project that holds the access bundle. It reads the project in this order, and stops with an error if none is set:
  1. --project-id
  2. INFISICAL_AGENT_VAULT_PROJECT_ID
  3. INFISICAL_PROJECT_ID
A session token already belongs to a project, so the command doesn’t need a project if you pass --session-token.
The CLI gives flags precedence over environment variables. If you pass either a session token or access bundle as a flag, the CLI will ignore any session token or access bundle that you’ve set as an environment variable.
The command also needs the proxy’s address. You can provide it either by passing --proxy or by setting INFISICAL_AGENT_VAULT_PROXY_ADDRESS. The command starts the agent with HTTP_PROXY and HTTPS_PROXY set to the proxy’s address, and sets the variables that make the agent’s HTTP clients trust the proxy’s certificate. It also sets INFISICAL_AGENT_VAULT_URL to the URL of the Infisical instance that the proxy connects to, so the agent can list the services its session can use through the proxy. The agent inherits the rest of your environment, and the command exits with the agent’s exit code. It also gives the agent INFISICAL_AGENT_VAULT_SESSION_TOKEN, INFISICAL_AGENT_VAULT_PROXY_ADDRESS, INFISICAL_AGENT_VAULT_CA_FILE (unless you pass --no-ca-trust), and INFISICAL_DOMAIN (unless it’s already set), so the agent can run infisical agent-vault connect. Before the agent starts, the command gets the session’s skills through the proxy (the access bundle’s, the ones picked from the project, and the ones sent with it), installs them in ~/.agents/skills, and links them for Claude Code and Hermes. It also installs Agent Vault’s built-in skill, infisical-agent-vault, which tells the agent how to work behind the proxy. The installed skills stay after the agent exits.
  • To install the skills in another folder, pass --skills-dir
  • To leave out only the built-in skill, pass --no-agent-vault-skill
  • To start the agent without any skills, pass --no-skills
  • To pick up skills that changed while the agent runs, restart the agent
If the agent’s command is claude, the command also adds the session’s MCP servers that are ready to Claude Code with --mcp-config, on top of any you pass, so Claude Code has their tools from the start. To leave them out, pass --no-mcp-servers. For the folders the command links and replaces, see Skill folders.

Arguments

  • command (required): The agent’s command, after --. Everything after -- is passed to it unchanged.

Flags

  • --access-bundle <stringArray>: The access bundle to create a session with, by name, such as coding-agent. A session holds one access bundle, so pass the flag only once. Can’t be combined with --session-token. Can also be set with INFISICAL_AGENT_VAULT_ACCESS_BUNDLE.
  • --ca-file <string>: Where to write the certificate authority fetched from the proxy. This is an output path, not a certificate to trust. Defaults to ca-<proxy-id>.pem in ~/.infisical/agent-vault, or /etc/infisical/agent-vault when run as root, one file per proxy.
  • --ca-fingerprint <string>: The SHA256 fingerprint of the proxy’s certificate authority, from the Proxies page. The command stops before writing anything or starting the agent if the proxy serves a different one. Accepted with or without the SHA256: prefix and colons.
  • --client-id <string>: The client ID of the machine identity that creates the session, for --access-bundle. Can also be set with INFISICAL_UNIVERSAL_AUTH_CLIENT_ID.
  • --client-secret <string>: The client secret of the machine identity that creates the session, for --access-bundle. Can also be set with INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET.
  • --keep-session: Leave a session created with --access-bundle active when the agent exits, instead of revoking it. Can’t be combined with --session-token.
  • --label <string>: A short description of what a session created with --access-bundle is for, shown on the Sessions page, such as nightly deploy. Up to 128 characters, without line breaks, tabs, or invisible characters. Can’t be combined with --session-token.
  • --metadata <stringArray>: A key and value to attach to a session created with --access-bundle, as key=value, such as runId=8812. Pass the flag once for each key. The value is everything after the first =, so it can contain = but the key can’t. The value can’t be empty. Up to 20 keys. A key can be up to 255 characters and a value up to 1020, and neither can contain line breaks, tabs, or invisible characters. Can’t be combined with --session-token.
  • --no-agent-vault-skill: Start the agent without Agent Vault’s built-in skill, infisical-agent-vault, which tells the agent how to work behind the proxy and how to list its services. The session’s other skills are still installed. --no-skills leaves out the built-in skill too.
  • --no-ca-trust: Skip writing the certificate authority, setting the trust variables, and adding it to the macOS keychain, for a machine that already trusts this proxy. --ca-fingerprint is still checked.
  • --no-mcp-servers: Start Claude Code without the session’s MCP servers. By default, if the agent’s command is claude, the command adds the session’s MCP servers that are ready to it with --mcp-config.
  • --no-proxy <string>: More hosts for the agent to reach directly instead of through the proxy, separated by commas. Always merged with localhost,127.0.0.1 and any NO_PROXY in your environment.
  • --no-skills: Start the agent without installing any skills, including the built-in infisical-agent-vault skill. Can’t be combined with --skills-dir.
  • --project-id <string>: The ID of the Agent Vault project to create the session in, for --access-bundle. If you leave it out, the CLI reads INFISICAL_AGENT_VAULT_PROJECT_ID, then INFISICAL_PROJECT_ID. Can’t be combined with --session-token.
  • --proxy <string>: The Agent Vault proxy’s address as host:port, such as 10.0.1.5:17323. A leading http:// or https:// is dropped. Required unless INFISICAL_AGENT_VAULT_PROXY_ADDRESS is set.
  • --session-token <string>: A session token created in Infisical. The command never revokes this session. Can’t be combined with --access-bundle. Can also be set with INFISICAL_AGENT_VAULT_SESSION_TOKEN, which keeps it off the command line.
  • --skills-dir <string>: The folder to install the session’s skills in, instead of ~/.agents/skills. The CLI doesn’t link skills in this folder for Claude Code or Hermes. Can’t be empty, and can’t be combined with --no-skills.
  • --ttl <string> (default never): How long a session created with --access-bundle lasts: one number and one unit, such as 30m, 8h, or 7d (not 2h30m), or never. Defaults to never because the session is revoked when the agent exits, so an expiry only governs one that outlives the command. Can’t be combined with --session-token.

Environment variables

  • INFISICAL_AGENT_VAULT_ACCESS_BUNDLE: The access bundle to create a session with, by name. Used if neither --access-bundle nor --session-token is passed.
  • INFISICAL_AGENT_VAULT_PROJECT_ID: The ID of the Agent Vault project to create the session in. Used if --project-id isn’t passed.
  • INFISICAL_AGENT_VAULT_PROXY_ADDRESS: The Agent Vault proxy’s address as host:port. Used if --proxy isn’t passed.
  • INFISICAL_AGENT_VAULT_SESSION_TOKEN: A session token created in Infisical, which keeps the token off the command line. Used if neither --session-token nor --access-bundle is passed.
  • INFISICAL_PROJECT_ID: The ID of the Agent Vault project to create the session in. Used if --project-id and INFISICAL_AGENT_VAULT_PROJECT_ID aren’t set.
  • INFISICAL_UNIVERSAL_AUTH_CLIENT_ID: The client ID of the machine identity that creates the session. Used if --client-id isn’t passed.
  • INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET: The client secret of the machine identity that creates the session. Used if --client-secret isn’t passed.

Examples

Run an agent with a session token
Create a session from an access bundle
Pin the proxy’s certificate authority
Create the session as a machine identity
Read the settings from environment variables

agent-vault connect

Open a port on 127.0.0.1 for each database or SSH service you name, or for every one in the session with --all. Each connection goes to the Agent Vault proxy over TLS, and the proxy logs in with the service’s account, so the client uses any username and no password. The command keeps running. Once the ports are open, it prints each service’s address and an example command, and the ports stay open until you stop the command with Ctrl+C. Before it opens any port, the command checks each service with the proxy. If the proxy refuses a service you named, the command stops with the proxy’s reason. With --all, it skips each refused service and prints its name and the reason. It stops only if the proxy refuses every service. Under infisical agent-vault run, the command reads the session token, the proxy’s address, and the proxy’s certificate authority from the variables run sets, so it needs no flags. Before it sends the session token to the proxy, it checks the proxy’s certificate authority. If you pass --ca-fingerprint, it checks against that fingerprint only. Otherwise, it checks against the file run wrote, then against the fingerprints Infisical lists for the session’s proxies. If none of them matches, it refuses to connect.

Arguments

  • service: The names of the database or SSH services to open ports for. Required unless you pass --all.

Flags

  • --all: Open a port for every database and SSH service in the session, skipping any the proxy refuses. Can’t be combined with service names.
  • --ca-fingerprint <string>: The SHA256 fingerprint of the proxy’s certificate authority, from the Certificate Authority column on the Proxies page. The command trusts the proxy only if it serves this certificate authority, and checks nothing else. Accepted with or without the SHA256: prefix and colons.
  • --port <int>: The local port to open. Works only with one named service. Without it, the command picks a free port.
  • --proxy <string>: The Agent Vault proxy’s address as host:port, such as 10.0.1.5:17323. A leading http:// or https:// is dropped. Required unless INFISICAL_AGENT_VAULT_PROXY_ADDRESS is set.
  • --session-token <string>: The session token. Can also be set with INFISICAL_AGENT_VAULT_SESSION_TOKEN. Prefer the variable, because other users on the machine can read anything on a command line.

Environment variables

  • INFISICAL_AGENT_VAULT_CA_FILE: The proxy’s certificate authority file that infisical agent-vault run wrote. The command trusts the proxy if it serves a certificate authority in this file.
  • INFISICAL_AGENT_VAULT_PROXY_ADDRESS: The Agent Vault proxy’s address as host:port. Used if --proxy isn’t passed.
  • INFISICAL_AGENT_VAULT_SESSION_TOKEN: The session token. Used if --session-token isn’t passed.

Examples

Open ports for two services
Open ports for every database and SSH service in the session
Open a service on a fixed local port
Connect outside infisical agent-vault run

agent-vault sessions

Create and revoke Agent Vault sessions from a script, for example to create a session in one step of a job and start the agent with infisical agent-vault run in another.

agent-vault sessions create

Create a session with an access bundle and print its session token. The command prints only the token, so you can save it in a variable and pass it to infisical agent-vault run or to an agent. Pass -o json or -o yaml to also print the session’s ID, project ID, access bundle, label, metadata, and expiry. The command reads the Agent Vault project in this order, and stops with an error if none is set:
  1. --project-id
  2. INFISICAL_AGENT_VAULT_PROJECT_ID
  3. INFISICAL_PROJECT_ID
If the project doesn’t come from --project-id, the command prints the project’s ID and where it came from to stderr, unless you pass --silent or -o. The session stays active until it expires or you revoke it with infisical agent-vault sessions revoke. Because --ttl defaults to never, set a --ttl unless you always revoke the session.

Flags

  • --access-bundle <stringArray> (required): The access bundle to create the session with, by name, such as coding-agent. A session holds one access bundle, so pass the flag only once. Can also be set with INFISICAL_AGENT_VAULT_ACCESS_BUNDLE.
  • --client-id <string>: The client ID of the machine identity that creates the session. Can also be set with INFISICAL_UNIVERSAL_AUTH_CLIENT_ID.
  • --client-secret <string>: The client secret of the machine identity that creates the session. Can also be set with INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET.
  • --label <string>: A short description of what the session is for, shown on the Sessions page, such as nightly deploy. Up to 128 characters.
  • --metadata <stringArray>: A key and value to attach to the session, as key=value, such as runId=8812. Pass the flag once for each key. The value is everything after the first =, so it can contain = but the key can’t. The value can’t be empty. Up to 20 keys. A key can be up to 255 characters and a value up to 1020, and neither can contain line breaks, tabs, or invisible characters.
  • --output <string> (-o): Print the session’s ID, token, project ID, access bundle, label, metadata, and expiry as json or yaml, instead of only the token.
  • --project-id <string>: The ID of the Agent Vault project to create the session in. If you leave it out, the CLI reads INFISICAL_AGENT_VAULT_PROJECT_ID, then INFISICAL_PROJECT_ID.
  • --ttl <string> (default never): How long the session lasts: one number and one unit, such as 30m, 8h, or 7d (not 2h30m), or never.

Environment variables

  • INFISICAL_AGENT_VAULT_ACCESS_BUNDLE: The access bundle to create the session with, by name. Used if --access-bundle isn’t passed.
  • INFISICAL_AGENT_VAULT_PROJECT_ID: The ID of the Agent Vault project to create the session in. Used if --project-id isn’t passed.
  • INFISICAL_PROJECT_ID: The ID of the Agent Vault project to create the session in. Used if --project-id and INFISICAL_AGENT_VAULT_PROJECT_ID aren’t set.
  • INFISICAL_UNIVERSAL_AUTH_CLIENT_ID: The client ID of the machine identity that creates the session. Used if --client-id isn’t passed.
  • INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET: The client secret of the machine identity that creates the session. Used if --client-secret isn’t passed.
  • INFISICAL_TOKEN: A machine identity access token to create the session as. Used if no client ID and client secret are set.

Examples

Create a session and keep its token in a variable
Print the session’s details as JSON

agent-vault sessions revoke

Revoke an Agent Vault session, so the proxy stops attaching credentials to the agent’s requests within one poll interval. The command doesn’t ask for confirmation. Name the session in one of two ways:
  • Pass the session’s ID to revoke it as your logged-in user or as a machine identity that has access to the session
  • Pass --session-token with the session token to revoke the session without logging in, such as from the agent that holds the token
If you pass neither, the command revokes the session whose token is in INFISICAL_AGENT_VAULT_SESSION_TOKEN. If you pass a session ID, the command ignores that variable. If the session is already revoked or expired, the command still succeeds.

Arguments

  • session-id: The ID of the session to revoke, as shown on the Sessions page. Leave it out to revoke by session token.

Flags

  • --client-id <string>: The client ID of the machine identity to revoke the session as, when you revoke by ID. Can also be set with INFISICAL_UNIVERSAL_AUTH_CLIENT_ID.
  • --client-secret <string>: The client secret of the machine identity to revoke the session as, when you revoke by ID. Can also be set with INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET.
  • --session-token <string>: The session token of the session to revoke, instead of its ID. Can’t be combined with a session ID. Can also be set with INFISICAL_AGENT_VAULT_SESSION_TOKEN.

Environment variables

  • INFISICAL_AGENT_VAULT_SESSION_TOKEN: The session token of the session to revoke. Used if neither a session ID nor --session-token is passed.

Examples

Revoke a session by its ID
Revoke the session in INFISICAL_AGENT_VAULT_SESSION_TOKEN

agent-vault skills

Manage the skills that Agent Vault installs for agents:

agent-vault skills push

Upload a skill folder to an Agent Vault project. Each command pushes one folder, and the name in the folder’s SKILL.md decides which skill in the project the folder updates:
  • If no skill has that name, the command creates the skill
  • If a skill has that name, the command publishes the folder as the skill’s next version
  • If the files match the skill’s latest version, the command prints unchanged and doesn’t create a version
The command skips hidden files and folders, such as .DS_Store, and refuses a folder that holds a symbolic link. To push as a machine identity from a script or CI, pass --client-id and --client-secret, or set INFISICAL_TOKEN to the identity’s access token. The user or machine identity needs the Admin role in the Agent Vault project. The command reads the project the same way as infisical agent-vault sessions create: from --project-id, then INFISICAL_AGENT_VAULT_PROJECT_ID, then INFISICAL_PROJECT_ID. It stops with an error if none is set.

Arguments

  • folder (required): The folder that holds one skill, with SKILL.md at its root.

Flags

  • --client-id <string>: The client ID of the machine identity to push as. Can also be set with INFISICAL_UNIVERSAL_AUTH_CLIENT_ID.
  • --client-secret <string>: The client secret of the machine identity to push as. Can also be set with INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET.
  • --project-id <string>: The ID of the Agent Vault project to push the skill to. If you leave it out, the CLI reads INFISICAL_AGENT_VAULT_PROJECT_ID, then INFISICAL_PROJECT_ID.

Environment variables

  • INFISICAL_AGENT_VAULT_PROJECT_ID: The ID of the Agent Vault project to push the skill to. Used if --project-id isn’t passed.
  • INFISICAL_PROJECT_ID: The ID of the Agent Vault project to push the skill to. Used if --project-id and INFISICAL_AGENT_VAULT_PROJECT_ID aren’t set.
  • INFISICAL_UNIVERSAL_AUTH_CLIENT_ID: The client ID of the machine identity to push as. Used if --client-id isn’t passed.
  • INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET: The client secret of the machine identity to push as. Used if --client-secret isn’t passed.
  • INFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN: A machine identity access token to push as. Used if no client ID and client secret are set.
  • INFISICAL_TOKEN: A machine identity access token to push as. Used if no client ID and client secret are set and INFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN isn’t set.

Examples

Push a skill as the logged-in user
Push a skill as a machine identity

agent-vault skills get

List the skills in an Agent Vault project, or pass a skill’s name to show one skill. Without a name, the command prints each skill’s name, its latest version, and the access bundles it’s in (for a member, only the ones granted to them):
With a name, the command prints the same details for that skill, followed by the paths of the files in its latest version:
To download the files, run infisical agent-vault skills pull. An admin of the project sees every skill. A member sees only the skills on the access bundles they’ve been granted. To run as a machine identity from a script or CI, pass --client-id and --client-secret, or set INFISICAL_TOKEN to the identity’s access token. Without them, the command runs as your logged-in user. The command reads the project the same way as infisical agent-vault skills push: from --project-id, then INFISICAL_AGENT_VAULT_PROJECT_ID, then INFISICAL_PROJECT_ID.

Arguments

  • name (optional): The name of the skill to show. Without it, the command lists every skill in the project.

Flags

  • --client-id <string>: The client ID of the machine identity to get the skills as. Can also be set with INFISICAL_UNIVERSAL_AUTH_CLIENT_ID.
  • --client-secret <string>: The client secret of the machine identity to get the skills as. Can also be set with INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET.
  • --output <string> (-o): Print the skills, or the one skill and its files, as json or yaml instead of a table.
  • --project-id <string>: The ID of the Agent Vault project that holds the skills. If you leave it out, the CLI reads INFISICAL_AGENT_VAULT_PROJECT_ID, then INFISICAL_PROJECT_ID.

Environment variables

  • INFISICAL_AGENT_VAULT_PROJECT_ID: The ID of the Agent Vault project that holds the skills. Used if --project-id isn’t passed.
  • INFISICAL_PROJECT_ID: The ID of the Agent Vault project that holds the skills. Used if --project-id and INFISICAL_AGENT_VAULT_PROJECT_ID aren’t set.
  • INFISICAL_UNIVERSAL_AUTH_CLIENT_ID: The client ID of the machine identity to get the skills as. Used if --client-id isn’t passed.
  • INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET: The client secret of the machine identity to get the skills as. Used if --client-secret isn’t passed.
  • INFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN: A machine identity access token to get the skills as. Used if no client ID and client secret are set.
  • INFISICAL_TOKEN: A machine identity access token to get the skills as. Used if no client ID and client secret are set and INFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN isn’t set.

Examples

List the skills in a project
Show one skill as JSON

agent-vault skills pull

Download a skill’s files to a folder, so you can edit them and upload them again with infisical agent-vault skills push. The command downloads the latest version unless you pass --version, and prints the version and the folder:
If the folder already exists, the command stops without downloading anything, unless you pass --force. pull and push skip hidden files, so a skill’s hidden files are lost if you pull it and push it again.
--force deletes everything in the folder that isn’t part of the skill, including hidden files and folders such as .git.
An admin of the project can pull any version of any skill. A member can pull only the latest version of the skills on the access bundles they’ve been granted. To pull a skill, edit it, and push it again, you need the Admin role, because skills push needs it. To run as a machine identity from a script or CI, pass --client-id and --client-secret, or set INFISICAL_TOKEN to the identity’s access token. Without them, the command runs as your logged-in user. The command reads the project the same way as infisical agent-vault skills push: from --project-id, then INFISICAL_AGENT_VAULT_PROJECT_ID, then INFISICAL_PROJECT_ID.

Arguments

  • name (required): The name of the skill to download.
  • folder (optional): The folder to save the skill’s files in. Defaults to a folder with the skill’s name in the current directory.

Flags

  • --client-id <string>: The client ID of the machine identity to pull as. Can also be set with INFISICAL_UNIVERSAL_AUTH_CLIENT_ID.
  • --client-secret <string>: The client secret of the machine identity to pull as. Can also be set with INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET.
  • --force: Replace the folder if it already exists. The folder then holds only the skill’s files, so the command deletes every other file in it, including hidden files such as .git.
  • --project-id <string>: The ID of the Agent Vault project that holds the skill. If you leave it out, the CLI reads INFISICAL_AGENT_VAULT_PROJECT_ID, then INFISICAL_PROJECT_ID.
  • --version <int>: The version of the skill to download, instead of the latest. Only an admin of the project can download a version other than the latest.

Environment variables

  • INFISICAL_AGENT_VAULT_PROJECT_ID: The ID of the Agent Vault project that holds the skill. Used if --project-id isn’t passed.
  • INFISICAL_PROJECT_ID: The ID of the Agent Vault project that holds the skill. Used if --project-id and INFISICAL_AGENT_VAULT_PROJECT_ID aren’t set.
  • INFISICAL_UNIVERSAL_AUTH_CLIENT_ID: The client ID of the machine identity to pull as. Used if --client-id isn’t passed.
  • INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET: The client secret of the machine identity to pull as. Used if --client-secret isn’t passed.
  • INFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN: A machine identity access token to pull as. Used if no client ID and client secret are set.
  • INFISICAL_TOKEN: A machine identity access token to pull as. Used if no client ID and client secret are set and INFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN isn’t set.

Examples

Pull the latest version of a skill
Pull an earlier version over an existing folder

agent-vault skills delete

Delete a skill and every version of it from an Agent Vault project. Infisical removes the skill from every access bundle, so agents don’t get the skill the next time they start. Copies of the skill that the CLI already installed on agents’ hosts stay until you delete them. The user or machine identity needs the Admin role in the Agent Vault project. The command asks you to type the skill’s name before it deletes anything. To skip the question, pass --yes. If there’s no terminal to ask in, such as in a script or an agent, and you don’t pass --yes, the command deletes nothing, fails with confirmation_required, and prints the command to run again with --yes. The command needs --project-id, even if you’ve set the project in an environment variable.

Arguments

  • name (required): The name of the skill to delete.

Flags

  • --client-id <string>: The client ID of the machine identity to delete as. Can also be set with INFISICAL_UNIVERSAL_AUTH_CLIENT_ID.
  • --client-secret <string>: The client secret of the machine identity to delete as. Can also be set with INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET.
  • --output <string> (-o): Print the deleted skill as json or yaml.
  • --project-id <string> (required): The ID of the Agent Vault project that holds the skill.
  • --yes (-y): Delete without asking for confirmation. Required when there’s no terminal to ask in, such as in a script or an agent.

Environment variables

  • INFISICAL_UNIVERSAL_AUTH_CLIENT_ID: The client ID of the machine identity to delete as. Used if --client-id isn’t passed.
  • INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET: The client secret of the machine identity to delete as. Used if --client-secret isn’t passed.
  • INFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN: A machine identity access token to delete as. Used if no client ID and client secret are set.
  • INFISICAL_TOKEN: A machine identity access token to delete as. Used if no client ID and client secret are set and INFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN isn’t set.

Examples

Delete a skill
Delete a skill from a script

bootstrap

Set up a new self-hosted Infisical instance without the web UI, for automated deployments. The command creates an admin user, an organization, and an instance admin machine identity, and prints the result as JSON, including the machine identity’s access token. Bootstrapping works only once per instance. The machine identity has the highest privileges on the instance. Treat its token as a root credential. With --output=k8-secret, the command writes the result to a Kubernetes secret instead, creating it or updating it if it exists. It must run inside a Kubernetes pod whose service account can get, create, and update secrets in the namespace.

Flags

  • --domain <string> (required): The URL of the Infisical instance to bootstrap. Can also be set with INFISICAL_DOMAIN, or the older INFISICAL_API_URL.
  • --email <string> (required): The email address of the admin user to create. Can also be set with INFISICAL_ADMIN_EMAIL.
  • --ignore-if-bootstrapped: Exit without an error message if bootstrapping fails, for example because the instance is already bootstrapped. Use it to make scripts safe to run twice.
  • --k8-secret-name <string>: The name of the Kubernetes secret to create or update. Required with --output=k8-secret.
  • --k8-secret-namespace <string>: The namespace of the Kubernetes secret. Required with --output=k8-secret.
  • --k8-secret-template <string> (default {"data":{"token":"{{.Identity.Credentials.Token}}"}}): A Go template that renders the secret’s data and stringData as JSON, for --output=k8-secret. It can read the response fields, such as .Identity.Credentials.Token, .Organization.ID, and .User.Email, and use the encodeBase64 function.
  • --organization <string> (required): The name of the organization to create. Can also be set with INFISICAL_ADMIN_ORGANIZATION.
  • --output <string>: Where to send the result. k8-secret writes it to a Kubernetes secret. Any other value, or none, prints it as JSON.
  • --password <string> (required): The password of the admin user to create. Can also be set with INFISICAL_ADMIN_PASSWORD.

Examples

Bootstrap an instance
Capture the admin token
Store the token in a Kubernetes secret

cert-manager

Manage certificates with the Infisical Agent. infisical cert-manager agent runs the agent in certificate management mode.

cert-manager agent

Run the Infisical Agent in certificate management mode. The agent authenticates as a machine identity, requests the certificates in its configuration, writes them to disk, and renews them before they expire. It runs until it gets SIGINT, SIGTERM, or SIGQUIT. On restart, the agent reuses each certificate it already issued instead of requesting a new one. It tracks each certificate in a hidden state file next to it, named .<certificate-file>.infisical-agent-state.json. The agent issues a new certificate if that file is missing, the certificate files changed on disk, or the certificate’s configuration changed. Certificates configured with certificate-id, csr, or csr-path aren’t reused. The configuration can’t include secret templates. To render secrets as well, use infisical agent. To pass the configuration without a file, set INFISICAL_AGENT_CONFIG_BASE64 to the base64-encoded YAML.

Flags

  • --config <string> (default certificate-agent-config.yaml): The path to the agent’s YAML configuration file. Ignored when INFISICAL_AGENT_CONFIG_BASE64 is set.
  • --verbose (-v): Log at debug level, for troubleshooting.

Examples

Start the certificate agent
Start it with debug logging

gateway

Run an Infisical gateway, which lets Infisical reach resources in a private network, such as a database in a private subnet. A gateway either connects out to a relay, so it needs no inbound firewall rules, or listens for Infisical to connect to it directly. Run it in the foreground with infisical gateway start, or as a systemd service with infisical gateway systemd install.

gateway start

Start a gateway in the foreground. A gateway authenticates in one of two ways. With --enroll-method, the gateway authenticates as itself. With token, it exchanges a one-time enrollment token from Infisical for an access token on first start. With aws, gcp, or kubernetes, it proves its cloud identity on each start. It saves its credentials to ~/.infisical/gateways/<name>.conf, or /etc/infisical/gateways/<name>.conf when run as root, so later starts need only the name. With --auth-method or --token, the gateway logs in as a machine identity instead, using the same flags as infisical login.

Arguments

  • name (required): The gateway’s name. Use the same name on every start so the gateway reuses its saved credentials. Can also be set with INFISICAL_GATEWAY_NAME.

Flags

  • --auth-method <string>: Log in as a machine identity with this method instead of enrolling: universal-auth, kubernetes, azure, gcp-id-token, gcp-iam, aws-iam, or oidc-auth. Can also be set with INFISICAL_AUTH_METHOD.
  • --bind <string>: The local host:port to listen on when Infisical connects to the gateway directly. Defaults to all interfaces on the configured direct port. Can also be set with INFISICAL_GATEWAY_BIND_ADDRESS.
  • --client-id <string>: The machine identity’s client ID, for --auth-method=universal-auth. Can also be set with INFISICAL_UNIVERSAL_AUTH_CLIENT_ID.
  • --client-secret <string>: The machine identity’s client secret, for --auth-method=universal-auth. Can also be set with INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET.
  • --domain <string>: The Infisical instance to connect to. Without it, the gateway uses the domain it saved when it enrolled, then your active profile’s domain.
  • --enroll-method <string>: How the gateway authenticates on its own: token for a one-time enrollment token from Infisical, aws, gcp, or kubernetes. Can also be set with INFISICAL_GATEWAY_ENROLL_METHOD.
  • --gateway-id <string>: The gateway’s ID from Infisical. Required with --enroll-method=aws, gcp, or kubernetes, unless the gateway saved it on an earlier start. Can also be set with INFISICAL_GATEWAY_ID.
  • --gcp-auth-type <string>: How the gateway proves its GCP identity with --enroll-method=gcp: gce reads a token from the instance metadata server, covering Compute Engine VMs and GKE workload identity, and iam signs a JWT through the IAM Credentials API. Defaults to gce. Can also be set with INFISICAL_GATEWAY_GCP_AUTH_TYPE.
  • --jwt <string>: The JWT to exchange for an access token, for --auth-method=oidc-auth.
  • --listen-address <string>: The stable host:port the gateway advertises so Infisical can connect to it directly instead of through a relay. Can also be set with INFISICAL_GATEWAY_LISTEN_ADDRESS.
  • --machine-identity-id <string>: The machine identity’s ID, for every --auth-method except universal-auth.
  • --name <string> (deprecated): Deprecated: pass the name as an argument instead, as in infisical gateway start <name>.
  • --organization-slug <string>: The slug of a sub-organization to scope the machine identity’s session to. Without it, the session uses the organization the machine identity was created in.
  • --pam-session-recording-path <string>: The directory to store PAM session recordings in. Defaults to /var/lib/infisical/session_recordings. Can also be set with INFISICAL_PAM_SESSION_RECORDING_PATH.
  • --pkcs11-module <string>: The absolute path to a PKCS#11 driver, such as /opt/fortanix/pkcs11/fortanix_pkcs11.so. The gateway loads it and serves HSM operations through it. Can also be set with INFISICAL_PKCS11_MODULE.
  • --relay <string> (deprecated): Deprecated: use --target-relay-name instead.
  • --service-account-key-file-path <string>: The path to a GCP service account key file, for --auth-method=gcp-iam. Can also be set with INFISICAL_GCP_IAM_SERVICE_ACCOUNT_KEY_FILE_PATH.
  • --service-account-token-path <string>: The path to the Kubernetes service account token, for --auth-method=kubernetes. Defaults to /var/run/secrets/kubernetes.io/serviceaccount/token. Can also be set with INFISICAL_KUBERNETES_SERVICE_ACCOUNT_TOKEN_PATH.
  • --target-relay-name <string>: The relay to connect through. Without it, the gateway picks the healthy relay with the lowest latency.
  • --token <string>: With --enroll-method=token, the one-time enrollment token. Otherwise, a machine identity access token to connect with, which can also be set with INFISICAL_TOKEN.

Examples

Enroll and start a gateway
Start an enrolled gateway again
Start a gateway on AWS
Start a gateway in Kubernetes

gateway systemd

Install or remove a systemd service that runs a gateway. Both commands run only on Linux, as root.

gateway systemd install

Install and enable a systemd service that runs the gateway. The service is named after the gateway, and its configuration is written to /etc/infisical/gateways/<name>.conf. Start it with sudo systemctl start <name>. Run the command as root on Linux.

Arguments

  • name (required): The gateway’s name. The service is named after it.

Flags

  • --bind <string>: The local host:port to listen on when Infisical connects to the gateway directly. Defaults to all interfaces on the configured direct port.
  • --domain <string>: The Infisical instance to connect to.
  • --enroll-method <string>: How the gateway authenticates: token for a one-time enrollment token, or aws or gcp to prove its cloud identity each time the service starts. kubernetes isn’t available, because in-cluster gateways aren’t managed by systemd.
  • --gateway-id <string>: The gateway’s ID from Infisical. Required with --enroll-method=aws or --enroll-method=gcp.
  • --gcp-auth-type <string>: How the gateway proves its GCP identity with --enroll-method=gcp: gce or iam. Defaults to gce.
  • --listen-address <string>: The stable host:port the gateway advertises so Infisical can connect to it directly instead of through a relay.
  • --log-file <string>: A file to write the service’s logs to, such as /var/log/infisical/gateway.log. Without it, logs aren’t written to a file.
  • --name <string> (deprecated): Deprecated: pass the name as an argument instead, as in infisical gateway systemd install <name>.
  • --pkcs11-module <string>: The absolute path to a PKCS#11 driver. The service starts the gateway with the driver loaded for HSM operations.
  • --relay <string> (deprecated): Deprecated: use --target-relay-name instead.
  • --service-account-key-file-path <string>: The path to a GCP service account key file, for --gcp-auth-type=iam. Use an absolute path outside /home and /tmp, such as one in /etc/infisical, because the service can’t read those directories.
  • --target-relay-name <string>: The relay to connect through. Without it, the gateway picks the healthy relay with the lowest latency.
  • --token <string>: With --enroll-method=token, the one-time enrollment token. Otherwise, a machine identity access token.

Examples

Install a gateway service
Start the installed service

gateway systemd uninstall

Stop and remove a gateway’s systemd service. Run the command as root on Linux.

Arguments

  • name (optional): The gateway whose service to remove. Without it, the command removes the single infisical-gateway service that older CLI versions installed.

Examples

Remove a gateway service

init

Link the current directory to an Infisical project. The command lists the projects in your profile’s organization and writes the one you choose to .infisical.yaml, so later commands in this directory and its subdirectories know which project to use. It needs a user login, and starts one if you have no profile. If the current directory already has an .infisical.yaml or a legacy .infisical.json, the command asks before writing a new .infisical.yaml. The new file holds only the project ID, and the CLI reads it instead of the old file, so settings you added, such as the default environment, no longer apply. To keep those settings, edit the existing file instead of running init. See project config for the file format.
If you run init without a terminal, such as in CI or from a script, the command never prompts. It exits with an error unless you pass --project-id, and it doesn’t replace an existing .infisical.yaml or legacy .infisical.json. To link a different project, edit secrets-management.project-id in .infisical.yaml, or workspaceId in a legacy .infisical.json.

Flags

  • --project-id <string>: Project ID to link this directory to. When set, skips the interactive org and project pickers and writes .infisical.yaml directly. Find the ID with infisical secrets-manager projects get.

Examples

Link the current directory to a project
Link a known project without prompts
Link a project using another profile

kmip

Run a KMIP server, which lets clients that use the Key Management Interoperability Protocol (KMIP) use Infisical as their key manager. Run it in the foreground with infisical kmip start, or as a systemd service with infisical kmip systemd install.

kmip start

Start a KMIP server in the foreground. It authenticates to Infisical either by enrolling with --enroll-method, or as a machine identity with --identity-client-id and --identity-client-secret.

Arguments

  • server-name (required): The KMIP server’s name. Can also be passed with --server-name or INFISICAL_KMIP_SERVER_NAME.

Flags

  • --certificate-ttl <string>: How long the server’s certificate is valid. Defaults to 1y. Can also be set with INFISICAL_KMIP_CERTIFICATE_TTL.
  • --domain <string>: The Infisical instance to connect to.
  • --enroll-method <string>: How the server authenticates on its own: token for a one-time enrollment token, or aws. When set, the machine identity flags are ignored.
  • --hostnames-or-ips <string>: The hostnames or IP addresses clients use to reach the server, separated by commas. They go into its certificate. Can also be set with INFISICAL_KMIP_HOSTNAMES_OR_IPS.
  • --identity-auth-method <string> (default universal-auth): How to log in as a machine identity when you don’t use --enroll-method.
  • --identity-client-id <string>: The machine identity’s client ID. Can also be set with INFISICAL_UNIVERSAL_AUTH_CLIENT_ID.
  • --identity-client-secret <string>: The machine identity’s client secret. Can also be set with INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET.
  • --kmip-server-id <string>: The KMIP server’s ID from Infisical, for --enroll-method=aws.
  • --listen-address <string>: The address to listen on. Defaults to localhost:5696. Can also be set with INFISICAL_KMIP_LISTEN_ADDRESS.
  • --server-name <string>: The server’s name, if you don’t pass it as an argument.
  • --token <string>: The one-time enrollment token, for --enroll-method=token.

Examples

Enroll and start a KMIP server
Start as a machine identity

kmip systemd

Install or remove a systemd service that runs a KMIP server. Both commands run only on Linux, as root.

kmip systemd install

Install and enable a systemd service that runs the KMIP server. Run the command as root on Linux.

Arguments

  • server-name (required): The KMIP server’s name. Can also be passed with --server-name.

Flags

  • --certificate-ttl <string>: How long the server’s certificate is valid.
  • --domain <string>: The Infisical instance to connect to.
  • --enroll-method <string>: How the server authenticates on its own: token or aws. When set, the machine identity flags are ignored.
  • --hostnames-or-ips <string>: The hostnames or IP addresses clients use to reach the server, separated by commas.
  • --identity-client-id <string>: The machine identity’s client ID, when you don’t use --enroll-method.
  • --identity-client-secret <string>: The machine identity’s client secret, when you don’t use --enroll-method.
  • --kmip-server-id <string>: The KMIP server’s ID from Infisical, for --enroll-method=aws.
  • --listen-address <string>: The address to listen on.
  • --server-name <string>: The server’s name, if you don’t pass it as an argument.
  • --token <string>: The one-time enrollment token, for --enroll-method=token.

Examples

Install a KMIP server service

kmip systemd uninstall

Stop and remove the KMIP server’s systemd service. Run the command as root on Linux.

Examples

Remove the KMIP server service

login

Log in to Infisical. By default, infisical login opens a browser, and falls back to prompts in the terminal if the browser login fails. Pass --interactive to go straight to the prompts, or --email, --password, and --organization-id to log in with no prompts at all. Without a terminal (when standard input isn’t a TTY), the browser login waits for the browser to send the session back to the CLI, and doesn’t offer to let you paste a token instead. A user login is stored as a profile: an account on an Infisical instance, plus the organization it uses. Without --save-as or --profile, the profile is named after the account and organization, such as [email protected]. Credentials are kept in your system keyring; see infisical vault to store them elsewhere. If you log in as a machine identity (any --method other than user), the CLI doesn’t create a profile. It prints an access token, which later commands read from --token or INFISICAL_TOKEN. For any instance other than US Cloud, pass --domain or set INFISICAL_DOMAIN.

Flags

  • --clear-domains: Remove all saved self-hosted domains from the CLI’s config file, then exit without logging in.
  • --client-id <string>: The client ID of a machine identity, for --method=universal-auth. Can also be set with INFISICAL_UNIVERSAL_AUTH_CLIENT_ID.
  • --client-secret <string>: The client secret of a machine identity, for --method=universal-auth. Can also be set with INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET.
  • --email <string>: Your email address, for logging in without prompts along with --password and --organization-id. Can also be set with INFISICAL_EMAIL.
  • --interactive (-i): Prompt for your email and password in the terminal instead of opening a browser.
  • --jwt <string>: The JWT to exchange for an access token, for --method=oidc-auth and --method=jwt-auth. Can also be set with INFISICAL_JWT.
  • --machine-identity-id <string>: The ID of the machine identity to log in as. Required for every --method except user and universal-auth. Can also be set with INFISICAL_MACHINE_IDENTITY_ID.
  • --method <string> (default user): How to authenticate: user for your own account, or a machine identity method: universal-auth, kubernetes, azure, gcp-id-token, gcp-iam, aws-iam, oidc-auth, or jwt-auth.
  • --oidc-jwt <string> (deprecated): Deprecated: use --jwt instead. The JWT for --method=oidc-auth.
  • --organization-id <string>: The organization to log in to, for logging in without prompts. Not needed with --profile, which already has one. Can also be set with INFISICAL_ORGANIZATION_ID.
  • --organization-slug <string>: The slug of a sub-organization to scope a machine identity’s session to. Without it, the session uses the organization the machine identity was created in.
  • --password <string>: Your password, for logging in without prompts. Can also be set with INFISICAL_PASSWORD.
  • --plain: Print only the access token, with no other output. Combine with --silent to capture the token in a variable.
  • --save-as <string>: Store this user login as a profile with this name, creating the profile or replacing its session. To sign back in to an existing profile, pass --profile instead.
  • --service-account-key-file-path <string>: The path to a GCP service account key file, for --method=gcp-iam. Can also be set with INFISICAL_GCP_IAM_SERVICE_ACCOUNT_KEY_FILE_PATH.
  • --service-account-token-path <string>: The path to the Kubernetes service account token, for --method=kubernetes. Defaults to /var/run/secrets/kubernetes.io/serviceaccount/token. Can also be set with INFISICAL_KUBERNETES_SERVICE_ACCOUNT_TOKEN_PATH.

Examples

Log in through the browser
Log in to EU Cloud
Log in as a machine identity
Log in without prompts

login status

Show whether the CLI is authenticated to Infisical and, when available, the organization the session is scoped to. It checks the session of the profile in effect, or a machine identity token set in the environment.

Flags

  • --json: Print the status as JSON.
  • --token <string>: A machine identity access token to inspect instead of the active session or environment variables.

Examples

Check the current session
Print the status as JSON

logout

End a login session. The CLI removes the profile’s stored credentials from this machine, and revokes its session on the server unless another profile still uses that session. The command also deletes the secrets the CLI saved for offline use. Every profile on this machine shares them, so they’re deleted even when other profiles stay logged in, and the CLI saves them again the next time a profile fetches secrets. The profile itself is kept, so infisical login --profile <name> signs back in without setting it up again. To remove the profile, run infisical profile delete. Without --all or --profile, the command logs out of the profile in effect. See infisical profile for how that profile is chosen.

Flags

  • --all: Log out of every profile on this machine.
  • --local-only: Remove the stored credentials without revoking the session on the server. The session stays valid until it expires.

Examples

Log out of the current profile
Log out of a specific profile
Log out of every profile

migrate-config

Convert a legacy .infisical.json into .infisical.yaml. The command looks for the project config in the current directory, then in each parent directory. It writes .infisical.yaml next to the file it finds, copies every setting into it, and deletes .infisical.json. If the project already uses .infisical.yaml, the command changes nothing. It warns you when a leftover .infisical.json sits in the same directory, because .infisical.yaml takes precedence and the old file is no longer read. See Migrate to .infisical.yaml for the full steps.

Examples

Convert the legacy project config

org

List organizations, and change the one your profile uses. The organization is a setting on your login profile, not a separate login. Run infisical profile current to see the profile and organization in effect, and pass --org to any command to use a different organization for that command only.

org list

List the organizations that the current profile’s account can use. The organization the profile uses is marked.

Examples

List your organizations

org switch

Change the current profile’s organization. This is the same command as infisical profile set-org. To use a different organization for a single command, pass --org to that command instead. To keep a second organization available at the same time, give it its own profile with infisical profile create.

Arguments

  • organization (optional): The organization to use, by name, slug, or ID. Without it, the CLI asks you to pick one.

Flags

  • --org-id <string> (deprecated): Deprecated: pass the organization as an argument instead. The ID of the organization to use.

Examples

Pick an organization from a list
Switch to an organization by name

pam

Connect to databases, servers, Kubernetes clusters, and cloud accounts managed by Infisical Privileged Access Management (PAM) from your terminal. A gateway supplies each account’s credential, which never reaches your machine. The one exception is an AWS IAM account without a gateway, which gets temporary credentials on your machine. Infisical records every session. People and AI agents use the same commands. List the accounts you can access with infisical pam accounts get, then open one with infisical pam access, or run a single command against it with infisical pam access <folder/account> -- <command>. PAM for AI agents describes how an agent uses these commands.

pam access

Open a session for one PAM account. The command runs as a machine identity if you set --token, --auth-method, INFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN or INFISICAL_TOKEN, or INFISICAL_AUTH_METHOD, checked in that order. Otherwise, it runs as the user you logged in as with infisical login. With a command after --, the CLI opens the session, runs the command once, ends the session, and exits with the command’s exit code. SSH accounts run the command on the target. Database, Redis, Snowflake, Kubernetes, GCP, and Azure accounts run it on your machine, pointed at a local proxy:
  • INFISICAL_PAM_HOST, INFISICAL_PAM_PORT, and INFISICAL_PAM_URL hold the proxy’s address and connection string
  • The variables each client reads are set too: PGHOST, PGPORT, PGUSER, and PGDATABASE for PostgreSQL and CockroachDB, MYSQL_HOST and MYSQL_TCP_PORT for MySQL, SQLCMDSERVER, SQLCMDUSER, and SQLCMDDBNAME for SQL Server, SNOWSQL_ACCOUNT, SNOWSQL_USER, and SNOWSQL_PWD for Snowflake, KUBECONFIG for Kubernetes, which points at a temporary file rather than your own kubeconfig, the CLOUDSDK_PROXY_*, CLOUDSDK_AUTH_ACCESS_TOKEN_FILE, and CLOUDSDK_CORE_CUSTOM_CA_CERTS_FILE settings for gcloud, and AZURE_CONFIG_DIR and HTTPS_PROXY for az, which the CLI signs in before it runs the command
  • Any username works and no password is needed (Oracle needs the placeholder password that infisical pam accounts get <folder/account> shows)
AWS IAM accounts with a gateway also run the command against a local proxy. The CLI sets HTTPS_PROXY, AWS_CA_BUNDLE, and placeholder credentials, and the gateway signs each AWS request. AWS IAM accounts without a gateway run the command with the session’s temporary credentials in AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and AWS_SESSION_TOKEN, and the CLI stops it when they expire. Your shell expands variables before the CLI sets them. To use one of these variables in the command, wrap the command in sh -c '...'. A host or port in a MySQL option file, such as ~/.my.cnf or /etc/my.cnf, overrides MYSQL_HOST and MYSQL_TCP_PORT, and mysql then connects directly instead of through the proxy. Pass the address as flags instead: -- sh -c 'mysql --no-defaults -h "$INFISICAL_PAM_HOST" -P "$INFISICAL_PAM_PORT" -e "select 1"'. Windows accounts can’t run a command after --. To use one from a script or an agent, start the RDP proxy in the background and open the .rdp file it prints with an RDP client. Without a command, SSH accounts connect you to a shell on the target. Pass --proxy to start a local proxy instead. If no terminal is attached, the CLI starts the proxy instead of a shell. For database, Redis, Snowflake, Kubernetes, GCP, Azure, and Windows accounts, and AWS IAM accounts with a gateway, the CLI starts a local proxy on 127.0.0.1 and prints how to connect to it. For AWS IAM accounts without a gateway, the CLI writes temporary credentials to your AWS credentials file instead. The page for each account type describes how to connect. A proxy runs until you press Ctrl+C or the session expires, and the CLI then restores anything it changed, such as your kubeconfig. To use several database, Redis, or SSH accounts at once, such as to copy data between two databases, start a proxy for each in the background with its own --port, such as infisical pam access prod/orders-db --port 15432 < /dev/null > orders-db.log 2>&1 &. Stop each one with kill, which ends its session. Kubernetes and GCP proxies edit your shared kubeconfig and gcloud configuration, so stopping one breaks the others. For those accounts, run one command per account with -- instead. In a terminal, Azure accounts and AWS IAM accounts with a gateway also open a shell that uses the proxy. Ctrl+C in that shell stops only the running command, so type exit to end the session. In a terminal, the CLI asks before it files an access request for an account that requires approval, and has you complete MFA in your browser. Without a terminal, such as when an AI agent runs it, the CLI never prompts:
  • Approval: the CLI files an access request with --reason and --duration and exits with an error saying the request is waiting (if a request is already waiting, it files nothing new). If an auto-approval rule approves the request, the CLI connects right away
  • MFA: the CLI exits with an error that has a link where a person completes verification
  • Login: if you aren’t logged in or your login expired, the CLI exits with an error instead of starting a login
To check whether a request was approved, run infisical pam accounts get <folder/account>. After approval, run the command again. After a person completes MFA, run the command again with --mfa-session and the value from the error. Every error says what went wrong. Most errors also give the command to run next. The CLI’s own errors exit with 1. A command that can’t be started exits with 127, and a command stopped by a signal exits with 128 plus the signal number.

Arguments

  • path (required): The account to open, as folder/account. A leading / is optional.
  • command (optional): A command to run once, after --. SSH accounts run it on the target. Database, Redis, Snowflake, Kubernetes, GCP, Azure, and AWS IAM accounts run it on your machine. The CLI exits with the command’s exit code.

Flags

  • --auth-method <string>: Log in as a machine identity with this method: universal-auth, kubernetes, azure, gcp-id-token, gcp-iam, aws-iam, oidc-auth, jwt-auth, or ldap-auth. The CLI renews the machine identity’s token while the session runs. Can also be set with INFISICAL_AUTH_METHOD.
  • --client-id <string>: The machine identity’s client ID, for --auth-method=universal-auth. Can also be set with INFISICAL_UNIVERSAL_AUTH_CLIENT_ID.
  • --client-secret <string>: The machine identity’s client secret, for --auth-method=universal-auth. Can also be set with INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET.
  • --duration <string> (default 1h): How long the session lasts, in Go duration format such as 30m, 1h, or 2h30m. With a command after --, the CLI stops the command when the session ends. The account’s template can cap the session at a shorter length. Also the duration of an access request the CLI files.
  • --jwt <string>: The JWT to log in with, for --auth-method=oidc-auth or jwt-auth. Can also be set with INFISICAL_JWT.
  • --ldap-password <string>: The LDAP password, for --auth-method=ldap-auth. Can also be set with INFISICAL_LDAP_PASSWORD.
  • --ldap-username <string>: The LDAP username, for --auth-method=ldap-auth. Can also be set with INFISICAL_LDAP_USERNAME.
  • --machine-identity-id <string>: The machine identity’s ID, for every --auth-method except universal-auth. Can also be set with INFISICAL_MACHINE_IDENTITY_ID.
  • --mfa-session <string>: The MFA session to use after a person completed verification in the browser. The MFA error gives the value and the link to open.
  • --no-approval-request: Don’t file an access request when the account requires approval. The CLI exits with an error instead.
  • --organization-slug <string>: The slug of a sub-organization to scope the machine identity’s session to. Without it, the session uses the organization the machine identity was created in.
  • --port <int> (default 0): The port the local proxy listens on at 127.0.0.1. 0 picks a free port. For SSH accounts, it applies only when a proxy runs. Has no effect on AWS IAM accounts without a gateway.
  • --proxy: Start a local proxy for your own SSH, SCP, or SFTP client instead of opening a shell. It changes only SSH accounts, and you can’t combine it with a command after --.
  • --reason <string>: Why you’re accessing the account, recorded for audit and shown to approvers on an access request. If the account requires a reason and you don’t pass one, the CLI prompts for it in a terminal and exits with an error otherwise.
  • --service-account-key-file-path <string>: The path to a GCP service account key file, for --auth-method=gcp-iam. Can also be set with INFISICAL_GCP_IAM_SERVICE_ACCOUNT_KEY_FILE_PATH.
  • --service-account-token-path <string>: The path to the Kubernetes service account token, for --auth-method=kubernetes. Required with that method. Can also be set with INFISICAL_KUBERNETES_SERVICE_ACCOUNT_TOKEN_PATH.
  • --target <string>: The host to connect to, for accounts that allow several hosts, such as Windows AD accounts.
  • --token <string>: A machine identity access token to run as. Service tokens aren’t accepted. Without it, the CLI reads INFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN, then INFISICAL_TOKEN.

Examples

Run one query against a database
Run one command on a server
Run kubectl against a cluster
Run gcloud as a GCP service account
Run the AWS CLI as an AWS IAM account
Use an environment variable in the command
Open a database session for two hours
Open a shell on a server
Start a local SSH proxy

pam accounts

List the PAM accounts you can access. Use infisical pam accounts get.

pam accounts get

List the PAM accounts you can access, with each account’s type and access status. The status is one of:
  • ready: run infisical pam access on it now
  • needs approval (needs_approval in JSON): infisical pam access files an access request for a person to approve
  • pending: a request is waiting for approval
  • approved: approved access is active until the time shown
  • unavailable: the account can’t be used right now. Name the account to see why, or read disabledReason with -o json
Name one account as folder/account to see its details, any reason or MFA it requires, and a command that connects to it. A bare account name finds the account in any folder. With -o json, each account also has an example field holding that command, which is empty for an unavailable account.

Arguments

  • path (optional): A folder, to list only its accounts, or one account to show, as folder/account. Without it, the command lists every account you can access.

Flags

  • --output <string> (-o): Print the accounts as json or yaml instead of a table.
  • --token <string>: A machine identity access token to run as. The command also accepts the other machine identity flags of infisical pam access, such as --auth-method.

Examples

List the accounts you can access
List the accounts in one folder
Show how to connect to one account
List the accounts as JSON

profile

Manage login profiles. A profile is one login: an account on one instance, plus the organization it uses by default. Selecting a profile selects all three, so switching between organizations or instances never means logging in again. Create your first profile with infisical login, one per extra organization with infisical profile create, and one per extra account or instance with infisical login --save-as <name>. A command uses the first of these that’s set:
  1. --profile on the command
  2. The INFISICAL_PROFILE environment variable, set by infisical profile pin
  3. A directory bound with infisical profile bind
  4. The machine’s default profile, set with infisical profile use

profile bind

Bind a directory, and everything under it, to a profile. Commands run inside that directory select the profile with no flag or environment variable, so moving between projects moves between organizations. If several parent directories are bound, the closest one applies. Bindings are stored in your CLI configuration, never in the repository. Remove one with infisical profile unbind.

Arguments

  • name (optional): The profile to bind. Defaults to the profile in effect.
  • path (optional): The directory to bind. Defaults to the current directory.

Examples

Bind this directory to the profile in effect
Bind this directory to another profile
Bind a different directory

profile create

Create a profile for another organization without logging in again. The new profile reuses the account and instance you’re signed in to, scoped to the organization you choose, so both organizations stay usable at the same time. Pass the organization with --org, or pick it when asked. Creating a profile doesn’t change which profile other terminals use. Pass --pin to start using it in this terminal, or --use to make it the default for the machine. To add a different account, or an account on another instance, use infisical login --save-as <name> instead.

Arguments

  • name (required): The name of the new profile.

Flags

  • --pin: Also pin this terminal to the new profile. Run the command through eval for the pin to take effect.
  • --use: Also make the new profile the default for this machine.

Examples

Create a profile for another organization
Create it and use it in this terminal
Create it and make it the default

profile current

Show which profile the CLI uses in this terminal and directory, and why. The output also shows the Agent Vault project that commands such as infisical agent-vault run use in this directory, and where the CLI read it from. The command also shows the project, environment, and folder that secrets-manager commands use in this directory when you don’t pass --projectId, --env, or --path, and where each value comes from, such as INFISICAL_ENVIRONMENT or .infisical.yaml. Run it before you write secrets, to check where they’ll go. If you authenticate as a machine identity, run, secrets export, and secrets get don’t read the project from the project config file, so pass --projectId or set INFISICAL_PROJECT_ID.

Flags

  • --plain: Print only the profile name, for use in shell prompts.

Examples

Show the profile in effect
Print only its name

profile delete

Delete a profile and its stored credentials. The CLI also revokes the profile’s session on the server, unless another profile still uses that session.

Arguments

  • name (required): The profile to delete.

Flags

  • --local-only: Remove the profile without revoking its session on the server. The session stays valid until it expires.

Examples

Delete a profile

profile list

List every login profile on this machine.

Examples

List your profiles

profile pin

Pin the current terminal to a profile. Only this terminal changes: the default profile and every other terminal keep what they were using, so you can work in several organizations at once. Undo it with infisical profile unpin. The command prints an export statement for POSIX shells such as Bash and Zsh, so run it through eval. If you run it without eval, it prints the eval form and changes nothing. In PowerShell, set the variable directly with $env:INFISICAL_PROFILE = 'acme'. In scripts and CI, set INFISICAL_PROFILE or pass --profile instead.

Arguments

  • name (required): The profile to pin this terminal to.

Examples

Pin this terminal to a profile

profile rename

Rename a profile. Its stored session, the default-profile setting, and directory bindings all follow the new name. Terminals pinned to the old name with infisical profile pin keep pointing at it and need pinning again.

Arguments

  • name (required): The profile’s current name.
  • new-name (required): The name to give it.

Examples

Rename a profile

profile set-org

Change the current profile’s organization. This is the same command as infisical org switch. To use a different organization for a single command, pass --org to that command instead. To keep a second organization available at the same time, give it its own profile with infisical profile create.

Arguments

  • organization (optional): The organization to use, by name, slug, or ID. Without it, the CLI asks you to pick one.

Flags

  • --org-id <string> (deprecated): Deprecated: pass the organization as an argument instead. The ID of the organization to use.

Examples

Pick an organization from a list
Set the organization by name

profile unbind

Remove a directory’s profile binding.

Arguments

  • path (optional): The bound directory. Defaults to whichever binding covers the current directory, so running the command inside a bound tree removes that binding.

Examples

Remove the binding that covers this directory
Remove a specific directory’s binding

profile unpin

Remove the current terminal’s profile pin, so it falls back to a bound directory or the default profile. The command prints an unset statement, so run it through eval. If you run it without eval, it prints the eval form and changes nothing. In PowerShell, run Remove-Item Env:INFISICAL_PROFILE instead.

Examples

Unpin this terminal

profile use

Make a profile the default for this machine. Commands use the default when nothing more specific applies. To choose a profile for one terminal, use infisical profile pin, and for one directory, use infisical profile bind.

Arguments

  • name (required): The profile to make the default.

Examples

Make a profile the default

proxy

Run the Infisical Proxy, which sits between your applications and Infisical and caches secret responses, so applications keep getting secrets when Infisical is unreachable.

proxy start

Start the Infisical Proxy. Point your applications at its --listen-address instead of your Infisical instance. They call the same API endpoints with the same credentials, and the proxy forwards requests, caches the responses, and refreshes the cache.

Flags

  • --access-token-check-interval <string> (default 5m): How often to check that cached access tokens are still valid, such as 5m or 1h.
  • --client-id <string>: A universal auth machine identity’s client ID. Required with --enable-event-subscriptions. Can also be set with INFISICAL_UNIVERSAL_AUTH_CLIENT_ID.
  • --client-secret <string>: The machine identity’s client secret. Required with --enable-event-subscriptions. Can also be set with INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET.
  • --domain <string>: The Infisical instance to forward requests to, such as https://app.infisical.com.
  • --enable-event-subscriptions: Invalidate cached secrets in real time from Infisical events instead of refreshing them on a timer. Falls back to polling when events are unavailable. Requires --client-id and --client-secret.
  • --eviction-strategy <string> (default optimistic): How to handle the cache when Infisical is unreachable. optimistic, the only strategy, keeps serving cached data.
  • --listen-address <string> (default localhost:8081): The address to listen on.
  • --polling-fallback-interval <string> (default 10m): How often to poll for secret changes when event subscriptions are unavailable, such as 1m. Used only with --enable-event-subscriptions.
  • --static-secrets-refresh-interval <string> (default 1h): How often to refresh cached secrets, such as 30m or 1h. Not used with --enable-event-subscriptions.
  • --tls-cert-file <string>: The proxy’s TLS certificate file. Required while --tls-enabled is on.
  • --tls-enabled (default true): Serve the proxy over TLS. Pass --tls-enabled=false to serve plain HTTP.
  • --tls-key-file <string>: The proxy’s TLS private key file. Required while --tls-enabled is on.

Examples

Start the proxy with TLS
Start the proxy locally without TLS

relay

Run an Infisical relay, which carries traffic between Infisical and your gateways, so gateways need only outbound connections. Run it in the foreground with infisical relay start, or as a systemd service with infisical relay systemd install.

relay start

Start a relay in the foreground. An organization relay authenticates by enrolling with --enroll-method, or as a machine identity with the same flags as infisical login. An instance relay authenticates with the secret in INFISICAL_RELAY_AUTH_SECRET.

Flags

  • --auth-method <string>: Log in as a machine identity with this method instead of enrolling: universal-auth, kubernetes, azure, gcp-id-token, gcp-iam, aws-iam, or oidc-auth. Can also be set with INFISICAL_AUTH_METHOD.
  • --client-id <string>: The machine identity’s client ID, for --auth-method=universal-auth. Can also be set with INFISICAL_UNIVERSAL_AUTH_CLIENT_ID.
  • --client-secret <string>: The machine identity’s client secret, for --auth-method=universal-auth. Can also be set with INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET.
  • --domain <string>: The Infisical instance to connect to. Without it, the relay uses the domain it saved when it enrolled, then your active profile’s domain.
  • --enroll-method <string>: How the relay authenticates on its own: token for a one-time enrollment token, or aws. Can also be set with INFISICAL_RELAY_ENROLL_METHOD.
  • --host <string>: The IP address or hostname gateways use to reach the relay. Required unless you use --enroll-method. Can also be set with INFISICAL_RELAY_HOST.
  • --jwt <string>: The JWT to exchange for an access token, for --auth-method=oidc-auth.
  • --machine-identity-id <string>: The machine identity’s ID, for every --auth-method except universal-auth.
  • --name <string>: The relay’s name. Can also be set with INFISICAL_RELAY_NAME.
  • --relay-id <string>: The relay’s ID from Infisical. Required with --enroll-method=aws, unless the relay saved it on an earlier start. Can also be set with INFISICAL_RELAY_ID.
  • --service-account-key-file-path <string>: The path to a GCP service account key file, for --auth-method=gcp-iam.
  • --service-account-token-path <string>: The path to the Kubernetes service account token, for --auth-method=kubernetes.
  • --token <string>: With --enroll-method=token, the one-time enrollment token. Otherwise, a machine identity access token to connect with.
  • --type <string>: org for a relay that belongs to your organization, or instance for a relay that serves the whole Infisical instance, run by the instance’s admins. Defaults to org. Can also be set with INFISICAL_RELAY_TYPE.

Examples

Enroll and start a relay
Start a relay on AWS
Start an instance relay

relay systemd

Install or remove a systemd service that runs a relay. Both commands run only on Linux, as root.

relay systemd install

Install and enable a systemd service that runs the relay. Run the command as root on Linux.

Arguments

  • name (optional): The relay’s name. Required with --enroll-method=token.

Flags

  • --domain <string>: The Infisical instance to connect to.
  • --enroll-method <string>: How the relay authenticates: token for a one-time enrollment token, or aws.
  • --host <string>: The IP address or hostname gateways use to reach the relay. Required with --type=instance.
  • --log-file <string>: A file to write the service’s logs to, such as /var/log/infisical/relay.log.
  • --relay-auth-secret <string>: The secret an instance relay authenticates with. Required with --type=instance.
  • --relay-id <string>: The relay’s ID from Infisical. Required with --enroll-method=aws.
  • --token <string>: The one-time enrollment token, for --enroll-method=token.
  • --type <string> (default org): org for a relay that belongs to your organization, or instance for a relay that serves the whole Infisical instance, run by the instance’s admins.

Examples

Install an organization relay
Install a relay on AWS
Install an instance relay

relay systemd uninstall

Stop and remove a relay’s systemd service. Run the command as root on Linux.

Arguments

  • name (optional): The relay whose service to remove. Without it, the command removes the single relay service that older CLI versions installed.

Examples

Remove a relay service

reset

Delete all the data the CLI stores on your machine and return it to its default state. Use it when a problem persists and you want a clean start. The command revokes the session of every profile on the server, then deletes every profile’s credentials from your system keyring and deletes the ~/.infisical directory. That directory also holds cached secrets and the credentials that gateways, relays, and KMIP servers saved when you ran them as a non-root user, so those are deleted too. A session that can’t be revoked stays valid until it expires, and the command prints a warning for it. .infisical.yaml and .infisical.json files in your projects aren’t touched. Log in again with infisical login afterwards. Directory bindings are deleted with the rest of the configuration, and terminals pinned with infisical profile pin point to a profile that no longer exists.

Flags

  • --local-only: Delete local data without revoking the sessions on the server. The sessions stay valid until they expire.

Examples

Reset the CLI
Reset without contacting the server

scan

Scan a Git repository’s history, a directory, or standard input for leaked secrets. The scan runs locally and doesn’t need an Infisical login. By default, the CLI reads git log -p for every commit on every branch of the repository at --source. Pass --log-opts to choose the commits, --no-git to scan the files in their current state, or --pipe to scan standard input. To change the rules or skip known findings, see Scan code locally with the CLI. The command exits with --exit-code when it finds leaks, and with 1 when the scan fails.

Flags

  • --baseline-path <string> (-b): A JSON report from an earlier infisical scan run. Findings already in it aren’t reported again. If the file can’t be loaded, the scan logs an error and continues without it.
  • --confidence <string> (default medium): The lowest confidence a finding needs to be reported: low, medium, or high. Findings from rules that don’t set a confidence are always reported.
  • --config <string> (-c): The scan config file to use. Without it, the CLI uses .infisical-scan.toml in the --source directory, then the built-in rules. Can also be set with INFISICAL_SCAN_CONFIG.
  • --exit-code <int> (default 1): The exit code to use when the scan finds leaks. Pass 0 to exit successfully anyway.
  • --follow-symlinks: Scan the files that symbolic links point to. Applies only with --no-git.
  • --log-opts <string>: Options to pass to git log -p to choose the commits to scan, such as --all commitA..commitB. They replace the default --full-history --all. Has no effect with --no-git or --pipe.
  • --max-target-megabytes <int> (default 0): Skip files larger than this many megabytes. 0 means no limit. Applies only with --no-git.
  • --no-color: Turn off color in verbose output.
  • --no-git: Scan the files in --source as a plain directory instead of reading Git history.
  • --pipe: Scan standard input instead of --source, as in cat app.log | infisical scan --pipe. Has no effect with --no-git.
  • --platform <string>: The source code platform to link findings to: github, gitlab, azuredevops, bitbucket, or gitea, or none for no links. Without it, the CLI detects the platform from the repository’s remote URL. Applies only to Git history scans.
  • --redact: Replace secrets with REDACTED in verbose output. Reports written with --report-path still contain the secrets.
  • --report-format <string> (-f, default json): The report’s format: json, csv, sarif, or junit.
  • --report-path <string> (-r): The file to write a report of the findings to. Without it, no report is written.
  • --source <string> (-s, default .): The repository, directory, or file to scan.
  • --verbose (-v): Print each finding: the file, where in the file, and the secret.

Examples

Scan a repository’s history
Scan a range of commits
Scan a directory without Git
Write a report, ignoring known findings

scan git-changes

Scan the uncommitted changes in a Git repository for leaked secrets, by reading git diff. Without --staged, the scan covers changes you haven’t staged yet. With it, the scan covers what the next commit will contain, which makes it suited to a pre-commit hook. infisical scan install sets one up. The scan uses the same config and .infisicalignore file as infisical scan, and exits with --exit-code when it finds leaks.

Flags

  • --confidence <string> (default medium): The lowest confidence a finding needs to be reported: low, medium, or high. Findings from rules that don’t set a confidence are always reported.
  • --staged: Scan the changes staged with git add instead of the unstaged changes.

Inherited flags

  • --config <string> (-c): The scan config file to use. Without it, the CLI uses .infisical-scan.toml in the --source directory, then the built-in rules. Can also be set with INFISICAL_SCAN_CONFIG.
  • --exit-code <int> (default 1): The exit code to use when the scan finds leaks. Pass 0 to exit successfully anyway.
  • --no-color: Turn off color in verbose output.
  • --redact: Replace secrets with REDACTED in verbose output. Reports written with --report-path still contain the secrets.
  • --report-format <string> (-f, default json): The report’s format: json, csv, sarif, or junit.
  • --report-path <string> (-r): The file to write a report of the findings to. Without it, no report is written.
  • --source <string> (-s, default .): The Git repository to scan.
  • --verbose (-v): Print each finding: the file, where in the file, and the secret.

Examples

Scan unstaged changes
Scan staged changes before a commit

scan install

Install a Git pre-commit hook in the current repository with --pre-commit-hook. Without that flag, the command does nothing. The hook runs infisical scan git-changes -v --staged before each commit and blocks the commit when it finds secrets. The CLI writes it to .git/hooks/pre-commit, or adds it to the end of that file if one exists. To turn the hook off in a repository, run git config hooks.infisical-scan false.

Flags

  • --pre-commit-hook: Install a Git pre-commit hook that scans staged changes before each commit.

Examples

Install the pre-commit hook

secrets-manager

Manage secrets, and the projects, environments, and folders that hold them. The secrets-manager commands inject secrets into a process, export them to a file, read and write them, and lease credentials from dynamic secrets. sm is an alias, so infisical sm run is the same command as infisical secrets-manager run.

Confirm before deleting

Every delete asks you to type the name of what it deletes, or the number of secrets if you delete more than one, and deletes nothing if what you type doesn’t match. Pass --yes (-y) to skip the question. If there’s no terminal to ask in, such as in CI, and you don’t pass --yes, the command deletes nothing and fails with confirmation_required. Add --yes to scripts that delete with secrets-manager or sm.

Errors in scripts

If one of the following fails, it prints what went wrong and the command to run next, and exits with status 1:
  • The projects, environments, and folders commands
  • secrets create and secrets update
With --output=json or --output=yaml, the command prints the error to standard error in that format instead:
If Infisical returned the error, the JSON also has statusCode and requestId. code is one of the following:

secrets-manager dynamic-secrets

List the dynamic secrets in an environment and folder, with each one’s provider, default TTL, and max TTL. A dynamic secret generates credentials on demand, such as a database user, and each set of credentials it generates is a lease. Manage leases with infisical secrets-manager dynamic-secrets lease.

Flags

  • --env <string> (default dev): The environment to work in. Every infisical secrets-manager dynamic-secrets subcommand accepts it. Defaults to INFISICAL_ENVIRONMENT, then the default environment in .infisical.yaml, then dev.
  • --output <string> (-o): Print the dynamic secrets as json, yaml, or dotenv instead of a table.
  • --path <string> (default /): The folder to list dynamic secrets from. Defaults to INFISICAL_SECRET_PATH, then the default folder in .infisical.yaml, then /.
  • --project-slug <string>: The slug of the project to list dynamic secrets from. Takes precedence over --projectId.
  • --projectId <string>: The ID of the project to list dynamic secrets from. Without it or --project-slug, the CLI uses the project in .infisical.yaml. Can also be set with INFISICAL_PROJECT_ID.
  • --token <string>: A machine identity access token to authenticate with, instead of your login. Without it, the CLI reads INFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN, then INFISICAL_TOKEN.

Examples

List dynamic secrets in dev
List dynamic secrets in a production folder
Print dynamic secrets as JSON

secrets-manager dynamic-secrets lease

Create, list, renew, and delete the leases of a dynamic secret.

Inherited flags

  • --env <string> (default dev): The environment that holds the dynamic secret.

secrets-manager dynamic-secrets lease create

Generate a new set of credentials from a dynamic secret. The command prints the lease ID, when the lease expires, and the credentials. Keep the lease ID to renew or delete the lease later, or find it with infisical secrets-manager dynamic-secrets lease list. The table and --plain show only credentials whose values are strings. Pass --output to get every credential the provider returns.

Arguments

  • name (required): The name of the dynamic secret to lease.

Flags

  • --kubernetes-namespace <string>: The namespace to create the lease in. Used only by Kubernetes dynamic secrets.
  • --output <string> (-o): Print only the credentials, as json, yaml, or dotenv, instead of the lease details and a table.
  • --path <string> (-p, default /): The folder that holds the dynamic secret. Defaults to INFISICAL_SECRET_PATH, then the default folder in .infisical.yaml, then /.
  • --plain: Print each credential as KEY=value, one per line, with no other output. Ignored when you pass --output.
  • --principals <string>: The principals to put in the certificate, separated by commas. Required by SSH dynamic secrets, and each one must be allowed by the dynamic secret.
  • --project-slug <string>: The slug of the project that holds the dynamic secret. Takes precedence over --projectId.
  • --projectId <string>: The ID of the project that holds the dynamic secret. Without it or --project-slug, the CLI uses the project in .infisical.yaml. Can also be set with INFISICAL_PROJECT_ID.
  • --token <string>: A machine identity access token to authenticate with, instead of your login. Without it, the CLI reads INFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN, then INFISICAL_TOKEN.
  • --ttl <string>: How long the lease lasts, such as 30m or 1h. Defaults to the dynamic secret’s default TTL, and can’t exceed its max TTL.

Inherited flags

  • --env <string> (default dev): The environment that holds the dynamic secret.

Examples

Lease database credentials for an hour
Lease credentials as JSON
Lease an SSH certificate

secrets-manager dynamic-secrets lease delete

Delete a lease before it expires, and revoke its credentials with the provider. The command asks you to type the lease ID before it deletes anything, unless you pass --yes. --env and --path must point to the folder that holds the lease’s dynamic secret, or Infisical reports that the lease doesn’t exist.

Arguments

  • lease-id (required): The ID of the lease to delete.

Flags

  • --output <string> (-o): Print the deleted lease as json, yaml, or dotenv instead of a table.
  • --path <string> (-p, default /): The folder that holds the lease’s dynamic secret. Defaults to INFISICAL_SECRET_PATH, then the default folder in .infisical.yaml, then /.
  • --project-slug <string>: The slug of the project that holds the lease. Takes precedence over --projectId.
  • --projectId <string>: The ID of the project that holds the lease. Without it or --project-slug, the CLI uses the project in .infisical.yaml. Can also be set with INFISICAL_PROJECT_ID.
  • --token <string>: A machine identity access token to authenticate with, instead of your login. Without it, the CLI reads INFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN, then INFISICAL_TOKEN.
  • --yes (-y): Delete without asking for confirmation. Required when there’s no terminal to ask in, such as in CI.

Inherited flags

  • --env <string> (default dev): The environment that holds the lease’s dynamic secret.

Examples

Delete a lease

secrets-manager dynamic-secrets lease list

List the active leases of a dynamic secret, with each lease’s ID, expiry time, and creation time.

Arguments

  • name (required): The name of the dynamic secret to list leases for.

Flags

  • --output <string> (-o): Print the leases as json, yaml, or dotenv instead of a table.
  • --path <string> (-p, default /): The folder that holds the dynamic secret. Defaults to INFISICAL_SECRET_PATH, then the default folder in .infisical.yaml, then /.
  • --project-slug <string>: The slug of the project that holds the dynamic secret. Takes precedence over --projectId.
  • --projectId <string>: The ID of the project that holds the dynamic secret. Without it or --project-slug, the CLI uses the project in .infisical.yaml. Can also be set with INFISICAL_PROJECT_ID.
  • --token <string>: A machine identity access token to authenticate with, instead of your login. Without it, the CLI reads INFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN, then INFISICAL_TOKEN.

Inherited flags

  • --env <string> (default dev): The environment that holds the dynamic secret.

Examples

List a dynamic secret’s leases

secrets-manager dynamic-secrets lease renew

Extend a lease before it expires, and print its new expiry time. A renewal can’t push the lease past the dynamic secret’s max TTL, counted from when the lease was created. --env and --path must point to the folder that holds the lease’s dynamic secret, or Infisical reports that the lease doesn’t exist.

Arguments

  • lease-id (required): The ID of the lease to renew.

Flags

  • --output <string> (-o): Print the renewed lease as json, yaml, or dotenv instead of a table.
  • --path <string> (-p, default /): The folder that holds the lease’s dynamic secret. Defaults to INFISICAL_SECRET_PATH, then the default folder in .infisical.yaml, then /.
  • --project-slug <string>: The slug of the project that holds the lease. Takes precedence over --projectId.
  • --projectId <string>: The ID of the project that holds the lease. Without it or --project-slug, the CLI uses the project in .infisical.yaml. Can also be set with INFISICAL_PROJECT_ID.
  • --token <string>: A machine identity access token to authenticate with, instead of your login. Without it, the CLI reads INFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN, then INFISICAL_TOKEN.
  • --ttl <string>: How long to extend the lease by, from its current expiry, such as 30m or 1h. Defaults to the dynamic secret’s default TTL.

Inherited flags

  • --env <string> (default dev): The environment that holds the lease’s dynamic secret.

Examples

Extend a lease by 30 minutes

secrets-manager environments

List, create, rename, and delete the environments of a Secrets Management project, such as dev and prod. Other commands take an environment’s slug with --env. environment is an alias, so infisical secrets-manager environment get also works. The commands take the project from --projectId, then INFISICAL_PROJECT_ID, then .infisical.yaml, except delete, which takes it only from --projectId. They don’t accept service tokens. If INFISICAL_TOKEN holds a service token, the commands use your login instead.

secrets-manager environments create

Create an environment in a project. If an environment already has the slug, the command fails with environment_exists.

Arguments

  • slug (required): The slug of the new environment, such as qa.

Flags

  • --name <string>: The environment’s display name. Defaults to the slug.
  • --output <string> (-o): Print the created environment as json or yaml instead of a table.
  • --projectId <string>: The project to create the environment in. Defaults to INFISICAL_PROJECT_ID, then the project linked in .infisical.yaml.
  • --token <string>: A machine identity access token to authenticate with, instead of your login. Without it, the CLI reads INFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN, then INFISICAL_TOKEN.

Examples

Create an environment
Create an environment with a display name

secrets-manager environments delete

Delete an environment and every secret in it. The command asks you to type the environment’s slug before it deletes anything, unless you pass --yes. The environment stays pending deletion for 14 days, and is deleted permanently after that. Until then, you can restore it from the project’s settings in Infisical, and no other environment can use its slug. Pass --force to delete it permanently now.

Arguments

  • slug (required): The slug of the environment to delete.

Flags

  • --force: Delete the environment permanently now, instead of after 14 days. Also deletes an environment that’s already pending deletion, which frees its slug.
  • --output <string> (-o): Print the deleted environment as json or yaml instead of a table.
  • --projectId <string> (required): The project that holds the environment. The command doesn’t read INFISICAL_PROJECT_ID or .infisical.yaml.
  • --token <string>: A machine identity access token to authenticate with, instead of your login. Without it, the CLI reads INFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN, then INFISICAL_TOKEN.
  • --yes (-y): Delete without asking for confirmation. Required when there’s no terminal to ask in, such as in CI.

Examples

Delete an environment
Delete an environment permanently in a script

secrets-manager environments get

List a project’s environments with each one’s name, slug, and ID, or show the environment you name. The list also shows the environments pending deletion, with the day each one will be deleted permanently. In JSON and YAML, those environments are in pendingDeletion.

Arguments

  • slug (optional): The slug of the environment to show. Without it, the command lists every environment in the project.

Flags

  • --output <string> (-o): Print the environments as json or yaml instead of a table.
  • --projectId <string>: The project to read environments from. Defaults to INFISICAL_PROJECT_ID, then the project linked in .infisical.yaml.
  • --token <string>: A machine identity access token to authenticate with, instead of your login. Without it, the CLI reads INFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN, then INFISICAL_TOKEN.

Examples

List the environments of the linked project
Show one environment as JSON

secrets-manager environments update

Change an environment’s display name, its slug, or both. Pass at least one of --name and --slug, or the command fails with nothing_to_update. If another environment already has the new slug, the command fails with environment_exists.

Arguments

  • slug (required): The current slug of the environment to change.

Flags

  • --name <string>: The environment’s new display name.
  • --output <string> (-o): Print the updated environment as json or yaml instead of a table.
  • --projectId <string>: The project that holds the environment. Defaults to INFISICAL_PROJECT_ID, then the project linked in .infisical.yaml.
  • --slug <string>: The environment’s new slug. Commands that pass the old slug with --env stop working.
  • --token <string>: A machine identity access token to authenticate with, instead of your login. Without it, the CLI reads INFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN, then INFISICAL_TOKEN.

Examples

Change an environment’s display name
Change an environment’s slug

secrets-manager folders

List, create, rename, and delete the folders in an environment. Folders organize an environment’s secrets into paths such as /backend/api, which other commands take with --path. Each folders command works on the folders directly inside --path, so to work on /backend/api, pass api as the name and --path=/backend. A folder name can contain only letters, numbers, dashes, and underscores. The commands take the project from --projectId, then INFISICAL_PROJECT_ID, then .infisical.yaml, except delete, which takes it only from --projectId. A service token works only in its own project. If you select a different project, the command fails with token_project_mismatch.

secrets-manager folders create

Create a folder inside --path. If a folder with that name already exists there, the command fails with folder_exists and creates nothing.

Arguments

  • name (required): The name of the new folder.

Flags

  • --description <string>: A description of the folder.
  • --env <string> (default dev): The environment to create the folder in. Defaults to INFISICAL_ENVIRONMENT, then the default environment in .infisical.yaml, then dev.
  • --output <string> (-o): Print the created folder as json or yaml instead of a table.
  • --path <string> (default /): The folder to create the new folder in. Folders in the path that don’t exist yet are created too. Defaults to INFISICAL_SECRET_PATH, then the default folder in .infisical.yaml, then /.
  • --projectId <string>: The project to create the folder in. Defaults to INFISICAL_PROJECT_ID, then the project linked in .infisical.yaml. A service token always uses its own project.
  • --token <string>: A machine identity access token or service token to authenticate with, instead of your login. Without it, the CLI reads INFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN, then INFISICAL_TOKEN.

Examples

Create a folder
Create a folder and its missing parents, with a description

secrets-manager folders delete

Delete a folder and everything in it: its secrets, its dynamic secrets, and the folders inside it. The command asks you to type the folder’s name before it deletes anything, unless you pass --yes.

Arguments

  • name (required): The name of the folder to delete.

Flags

  • --env <string> (default dev): The environment that holds the folder. Defaults to INFISICAL_ENVIRONMENT, then the default environment in .infisical.yaml, then dev.
  • --output <string> (-o): Print the deleted folder as json or yaml instead of a table.
  • --path <string> (default /): The folder that contains the folder to delete. Defaults to INFISICAL_SECRET_PATH, then the default folder in .infisical.yaml, then /.
  • --projectId <string> (required): The project that holds the folder. The command doesn’t read INFISICAL_PROJECT_ID or .infisical.yaml.
  • --token <string>: A machine identity access token or service token to authenticate with, instead of your login. Without it, the CLI reads INFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN, then INFISICAL_TOKEN.
  • --yes (-y): Delete without asking for confirmation. Required when there’s no terminal to ask in, such as in CI.

Examples

Delete a folder
Delete a folder in a script

secrets-manager folders get

List the folders inside --path, or show the folder you name. In JSON and YAML, each folder’s path is its own full path, such as /backend/api, which you can pass to --path to work inside the folder.

Arguments

  • name (optional): The name of the folder to show. Without it, the command lists the folders inside --path.

Flags

  • --env <string> (default dev): The environment to read folders from. Defaults to INFISICAL_ENVIRONMENT, then the default environment in .infisical.yaml, then dev.
  • --output <string> (-o): Print the folders as json or yaml instead of a table.
  • --path <string> (default /): The folder to list folders from. Defaults to INFISICAL_SECRET_PATH, then the default folder in .infisical.yaml, then /.
  • --projectId <string>: The project to read folders from. Defaults to INFISICAL_PROJECT_ID, then the project linked in .infisical.yaml. A service token always uses its own project.
  • --token <string>: A machine identity access token or service token to authenticate with, instead of your login. Without it, the CLI reads INFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN, then INFISICAL_TOKEN.

Examples

List the folders at the root
Show one folder as JSON

secrets-manager folders update

Rename a folder, change its description, or both. Pass at least one of --name and --description, or the command fails with nothing_to_update. If another folder in --path already has the new name, the command fails with folder_exists.

Arguments

  • name (required): The current name of the folder to change.

Flags

  • --description <string>: The folder’s new description. Pass --description="" to remove it.
  • --env <string> (default dev): The environment that holds the folder. Defaults to INFISICAL_ENVIRONMENT, then the default environment in .infisical.yaml, then dev.
  • --name <string>: The folder’s new name. Commands that pass the folder’s old path with --path stop working.
  • --output <string> (-o): Print the updated folder as json or yaml instead of a table.
  • --path <string> (default /): The folder that contains the folder to change. Defaults to INFISICAL_SECRET_PATH, then the default folder in .infisical.yaml, then /.
  • --projectId <string>: The project that holds the folder. Defaults to INFISICAL_PROJECT_ID, then the project linked in .infisical.yaml. A service token always uses its own project.
  • --token <string>: A machine identity access token or service token to authenticate with, instead of your login. Without it, the CLI reads INFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN, then INFISICAL_TOKEN.

Examples

Rename a folder
Remove a folder’s description

secrets-manager projects

Find, create, change, and delete Secrets Management projects. Use these commands to find the project ID that infisical init and the --projectId flag take, or to manage projects without opening Infisical. The commands don’t accept service tokens, except projects get with a project ID. If INFISICAL_TOKEN holds a service token, the commands use your login instead.

secrets-manager projects create

Create a Secrets Management project in your organization with the Development, Staging, and Production environments. The user or machine identity that creates the project becomes the project’s admin. The command prints the project and its environments, followed by the infisical init command that links the current directory to the project.

Flags

  • --description <string>: A description of the project, up to 1024 characters.
  • --name <string> (required): The name of the project, up to 64 characters.
  • --output <string> (-o): Print the created project as json or yaml instead of a table.
  • --slug <string>: The project’s slug, from 5 to 64 characters. Without it, Infisical generates a slug from the name.
  • --token <string>: A machine identity access token to authenticate with, instead of your login. Without it, the CLI reads INFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN, then INFISICAL_TOKEN.

Examples

Create a project and link this directory to it
Create a project with a description and slug

secrets-manager projects delete

Delete a project, with all of its environments, folders, and secrets. The command asks you to type the project’s slug before it deletes anything, unless you pass --yes.

Arguments

Flags

  • --output <string> (-o): Print the deleted project as json or yaml instead of a table.
  • --token <string>: A machine identity access token to authenticate with, instead of your login. Without it, the CLI reads INFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN, then INFISICAL_TOKEN.
  • --yes (-y): Delete without asking for confirmation. Required when there’s no terminal to ask in, such as in CI.

Examples

Delete a project
Delete a project in a script

secrets-manager projects get

List the name, slug, and ID of each Secrets Management project you’re a member of, or show one project with the name, slug, and ID of each of its environments. With a machine identity, the list has the projects the identity is a member of. Use an environment’s slug with the --env flag of other secrets-manager commands. Without an argument, the command lists your projects, even in a directory linked to one. It doesn’t use INFISICAL_PROJECT_ID or .infisical.yaml.

Arguments

  • slug-or-id (optional): The slug or ID of the project to show. Without it, the command lists your projects.

Flags

  • --output <string> (-o): Print the projects as json or yaml instead of a table.
  • --projectId <string> (deprecated): Deprecated: pass the project’s ID as the argument instead. The ID of the project to show.
  • --token <string>: A machine identity access token to authenticate with, instead of your login. Without it, the CLI reads INFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN, then INFISICAL_TOKEN.

Examples

List your projects
Show a project and its environments
List a machine identity’s projects as JSON

secrets-manager projects update

Change a project’s name, slug, or description. Pass at least one of --name, --slug, and --description, or the command fails with nothing_to_update.

Arguments

  • slug-or-id (required): The slug or ID of the project to change.

Flags

  • --description <string>: The project’s new description, up to 1024 characters. Pass --description="" to remove it.
  • --name <string>: The project’s new name, up to 64 characters.
  • --output <string> (-o): Print the updated project as json or yaml instead of a table.
  • --slug <string>: The project’s new slug, up to 64 characters. Commands that name the project by its old slug stop working.
  • --token <string>: A machine identity access token to authenticate with, instead of your login. Without it, the CLI reads INFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN, then INFISICAL_TOKEN.

Examples

Rename a project
Change a project’s slug
Remove a project’s description

secrets-manager run

Inject secrets from Infisical into a process as environment variables. The CLI fetches the secrets for the project linked in .infisical.yaml, or the one you pass with --projectId, and starts your command with them set. Secrets override variables that are already set in your shell. Secrets named HOME, PATH, PS1, PS2, PWD, EDITOR, XAUTHORITY, USER, TERM, TERMINFO, SHELL, or MAIL, or starting with XDG_ or LC_, are never injected.

Arguments

  • command (optional): The command to run, after --. Everything after -- is passed to it unchanged. Required unless you pass --command.

Flags

  • --command <string> (-c): A shell command to run instead of the arguments after --, such as "npm run build && npm start". Use it to chain several commands.
  • --env <string> (-e, default dev): The environment to fetch secrets from, such as dev, staging, or prod. Defaults to INFISICAL_ENVIRONMENT, then the default environment in .infisical.yaml, then dev.
  • --expand (default true): Resolve secret references and shell parameter expansions in secret values before injecting them. Pass --expand=false to inject values exactly as stored.
  • --include-imports (default true): Include secrets imported into the environment from other environments or folders.
  • --path <stringArray> (default /): The folder to fetch secrets from. Repeat the flag to inject secrets from several folders. When a secret exists in more than one, the value from the last --path wins. Defaults to INFISICAL_SECRET_PATH, then the default folder in .infisical.yaml, then /.
  • --project-config-dir <string>: The directory that contains .infisical.yaml. Use it when the file isn’t in the directory you run the command from, such as in a monorepo.
  • --projectId <string>: The project to fetch secrets from. Required when you authenticate with a machine identity. Can also be set with INFISICAL_PROJECT_ID.
  • --recursive: Also inject the secrets in every subfolder of each --path.
  • --secret-overriding (default true): Use your personal secrets in place of shared secrets with the same name. Pass --secret-overriding=false to use only shared secrets.
  • --tags <string> (-t): Only inject secrets with these tag slugs, separated by commas.
  • --token <string>: A machine identity access token to fetch secrets with, instead of your login. Without it, the CLI reads INFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN, then INFISICAL_TOKEN.
  • --watch: Restart the command whenever secrets change in Infisical. Intended for local development.
  • --watch-interval <int> (default 10): How often, in seconds, --watch checks for changes. The minimum is 5.

Examples

Start a dev server with secrets
Use another environment and two folders
Run in CI with a machine identity
Restart when secrets change

secrets-manager secrets

Print the secrets in an environment and folder as a table. Pass --output to print them as JSON, YAML, or dotenv instead.

Flags

  • --env <string> (default dev): The environment to list secrets from. Every infisical secrets-manager secrets subcommand accepts it. Defaults to INFISICAL_ENVIRONMENT, then the default environment in .infisical.yaml, then dev.
  • --expand (default true): Resolve secret references and shell parameter expansions in secret values.
  • --include-imports (default true): Include secrets imported into the environment from other environments or folders.
  • --output <string> (-o): Print the secrets as json, yaml, or dotenv instead of a table.
  • --path <string> (default /): The folder to list secrets from. Defaults to INFISICAL_SECRET_PATH, then the default folder in .infisical.yaml, then /.
  • --plain (deprecated): Deprecated: use --output instead. Print each secret as KEY=value, one per line.
  • --projectId <string>: The project to list secrets from. Required when you authenticate with a machine identity. Can also be set with INFISICAL_PROJECT_ID.
  • --recursive: Also list the secrets in every subfolder of --path.
  • --secret-overriding (default true): Show your personal secrets in place of shared secrets with the same name. Pass --secret-overriding=false to show only shared secrets.
  • --tags <string> (-t): Only list secrets with these tag slugs, separated by commas. infisical secrets-manager secrets get accepts it too.
  • --token <string>: A machine identity access token to fetch secrets with, instead of your login. Without it, the CLI reads INFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN, then INFISICAL_TOKEN.

Examples

List secrets in dev
List every secret in a folder tree
Print production secrets as JSON

secrets-manager secrets create

Create secrets. If any of them already exists, the command fails with secret_exists and writes none of them. To change a secret that exists, run infisical secrets-manager secrets update. The result table masks values unless you pass --show-values. Your shell saves the values you pass on the command line in its history file. To keep them out, pass --file or NAME=@path, or set your shell to skip these commands.

Arguments

  • name=value (optional, repeatable): A secret to create. Use NAME=@path/to/file to read the value from a file, and NAME=\@value for a value that starts with @. Required unless you pass --file.

Flags

  • --file <string>: A .env or YAML file to read secrets from, instead of arguments. Lines starting with # or // are comments.
  • --output <string> (-o): Print the created secrets as json, yaml, or dotenv instead of a table.
  • --path <string> (default /): The folder that holds the new secrets. Defaults to INFISICAL_SECRET_PATH, then the default folder in .infisical.yaml, then /.
  • --projectId <string>: The project that holds the new secrets. Defaults to INFISICAL_PROJECT_ID, then the project linked in .infisical.yaml. A service token always writes to its own project, and fails with token_project_mismatch if you select another one.
  • --show-values: Show secret values in the result table instead of masking them.
  • --tag <stringArray>: A tag to attach, created if it doesn’t exist. Repeat the flag for several tags.
  • --token <string>: A machine identity access token or service token to authenticate with, instead of your login. Without it, the CLI reads INFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN, then INFISICAL_TOKEN.
  • --type <string> (default shared): shared for secrets everyone on the project sees, or personal for secrets that override them only for you.

Inherited flags

  • --env <string> (default dev): The environment to create the secrets in.
  • --tags <string> (-t): Has no effect on this command. Use --tag to attach tags.

Examples

Create two secrets
Load a value from a file
Import a .env file
Override a secret only for yourself

secrets-manager secrets delete

Delete secrets by name. The command asks you to type the secret’s name, or the number of secrets if you name more than one, before it deletes anything, unless you pass --yes. Without --type, the command deletes your personal secrets with those names. Pass --type=shared to delete the shared secrets that everyone on the project sees.

Arguments

  • name (required, repeatable): The names of the secrets to delete.

Flags

  • --output <string> (-o): Print the result as json, yaml, or dotenv instead of a table.
  • --path <string> (default /): The folder to delete from. Defaults to INFISICAL_SECRET_PATH, then the default folder in .infisical.yaml, then /.
  • --projectId <string>: The project to delete from. Required when you authenticate with a machine identity. Can also be set with INFISICAL_PROJECT_ID.
  • --token <string>: A machine identity access token to authenticate with, instead of your login. Without it, the CLI reads INFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN, then INFISICAL_TOKEN.
  • --type <string> (default personal): Which secrets to delete: personal or shared.
  • --yes (-y): Delete without asking for confirmation. Required when there’s no terminal to ask in, such as in CI.

Inherited flags

  • --env <string> (default dev): The environment to delete from.

Examples

Delete two shared secrets
Delete a secret in a script
Remove your personal override of a secret

secrets-manager secrets export

Print an environment’s secrets in a file format such as .env or JSON, for tools that read configuration from a file. Output goes to standard output unless you pass --output-file. This command used to be infisical export, which still works. dotenv writes each secret as KEY='value', and dotenv-export adds export in front. Neither escapes quotes inside values. dotenv-eval also writes export statements, but quotes each value so the output is safe to load with eval or source. No format escapes secret names, so load output into a shell only when every name is a valid shell variable name. --template takes a Go template that fetches secrets with the functions the Infisical Agent provides, such as listSecrets and getSecretByName.

Flags

  • --env <string> (-e, default dev): The environment to export secrets from, such as dev, staging, or prod. Defaults to INFISICAL_ENVIRONMENT, then the default environment in .infisical.yaml, then dev.
  • --expand (default true): Resolve secret references and shell parameter expansions in secret values. Pass --expand=false to export values exactly as stored.
  • --format <string> (-f, default dotenv): The output format: dotenv, dotenv-export, dotenv-eval, csv, json, or yaml.
  • --include-imports (default true): Include secrets imported into the environment from other environments or folders.
  • --output-file <string> (-o): A file or directory to write to, instead of standard output. In a directory, the CLI writes .env, secrets.json, secrets.csv, or secrets.yaml, depending on the format. A file name without an extension gets the format’s extension, and missing parent directories are created.
  • --path <string> (default /): The folder to export secrets from. Defaults to INFISICAL_SECRET_PATH, then the default folder in .infisical.yaml, then /.
  • --projectId <string>: The project to export secrets from. Required when you authenticate with a machine identity. Can also be set with INFISICAL_PROJECT_ID.
  • --secret-overriding (default true): Export your personal secrets in place of shared secrets with the same name. Pass --secret-overriding=false to export only shared secrets.
  • --tags <string> (-t): Only export secrets with these tag slugs, separated by commas.
  • --template <string>: The path to a Go template to render and print instead of a file format. The template chooses its own project, environment, and folder, so every other export flag except --token is ignored.
  • --token <string>: A machine identity access token to authenticate with, instead of your login. Without it, the CLI reads INFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN, then INFISICAL_TOKEN.

Examples

Write a .env file
Export production secrets as JSON
Load secrets into the current shell
Render secrets through a template

secrets-manager secrets get

Print the secrets you name, or every secret in --path if you don’t name any. A name that doesn’t exist prints as *not found*. In scripts, pass --plain --silent to print only the values, with no other output.

Arguments

  • name (optional, repeatable): The names of the secrets to print. Without names, the command prints every secret in --path.

Flags

  • --expand (default true): Resolve secret references and shell parameter expansions in secret values.
  • --include-imports (default true): Also look for the names among secrets imported from other environments or folders.
  • --output <string> (-o): Print the secrets as json, yaml, or dotenv instead of a table.
  • --path <string> (default /): The folder to read from. Defaults to INFISICAL_SECRET_PATH, then the default folder in .infisical.yaml, then /.
  • --plain: Print only the values, one per line.
  • --projectId <string>: The project to read from. Required when you authenticate with a machine identity. Can also be set with INFISICAL_PROJECT_ID.
  • --recursive: Also look for the names in every subfolder of --path.
  • --secret-overriding (default true): Return your personal secret in place of a shared secret with the same name. Pass --secret-overriding=false to return only shared secrets.
  • --token <string>: A machine identity access token to authenticate with, instead of your login. Without it, the CLI reads INFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN, then INFISICAL_TOKEN.

Inherited flags

  • --env <string> (default dev): The environment to read from.
  • --tags <string> (-t): Only return secrets with these tag slugs, separated by commas.

Examples

List the secrets in a folder
Show two secrets
Read a value into a variable
Print production secrets as JSON

secrets-manager secrets update

Change the values of secrets that already exist. If any of them doesn’t exist, the command fails with secret_not_found and writes none of them. To add a secret, run infisical secrets-manager secrets create. The result table masks values unless you pass --show-values. Your shell saves the values you pass on the command line in its history file. To keep them out, pass --file or NAME=@path, or set your shell to skip these commands.

Arguments

  • name=value (optional, repeatable): A secret to change, with its new value. Use NAME=@path/to/file to read the value from a file, and NAME=\@value for a value that starts with @. Required unless you pass --file.

Flags

  • --file <string>: A .env or YAML file to read secrets from, instead of arguments. Lines starting with # or // are comments.
  • --output <string> (-o): Print the updated secrets as json, yaml, or dotenv instead of a table.
  • --path <string> (default /): The folder that holds the secrets. Defaults to INFISICAL_SECRET_PATH, then the default folder in .infisical.yaml, then /.
  • --projectId <string>: The project that holds the secrets. Defaults to INFISICAL_PROJECT_ID, then the project linked in .infisical.yaml. A service token always writes to its own project, and fails with token_project_mismatch if you select another one.
  • --show-values: Show secret values in the result table instead of masking them.
  • --tag <stringArray>: A tag to attach, created if it doesn’t exist. Repeat the flag for several tags. The tags replace the secret’s existing tags.
  • --token <string>: A machine identity access token or service token to authenticate with, instead of your login. Without it, the CLI reads INFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN, then INFISICAL_TOKEN.
  • --type <string> (default shared): shared for secrets everyone on the project sees, or personal for secrets that override them only for you.

Inherited flags

  • --env <string> (default dev): The environment that holds the secrets.
  • --tags <string> (-t): Has no effect on this command. Use --tag to attach tags.

Examples

Change a secret’s value
Change a value and replace its tags
Update secrets from a .env file

service-token

Manage service tokens. Service tokens are deprecated and will be removed in a future release. Use a machine identity instead, and log in as it with infisical login.

service-token create

Create a service token for a project with your user login. Service tokens are deprecated; create a machine identity instead. Without --token-only, the command prints the token’s name, project, access, scopes, and the token itself to standard error, so capturing standard output gets nothing.

Flags

  • --access-level <stringSlice> (-a, required): What the token can do: read, write, or both. Repeat the flag or separate the values with commas.
  • --expiry-seconds <int> (-e, default 86400): How long the token lasts, in seconds from now. Pass 0 for a token that never expires.
  • --name <string> (-n, default Service token generated via CLI): The token’s name.
  • --projectId <string>: The project to create the token for. Without it, the CLI uses the project in .infisical.yaml. Can also be set with INFISICAL_PROJECT_ID.
  • --scope <stringSlice> (-s, required): An environment and folder the token can access, as <env-slug>:<folder-path>, such as dev:/backend. The folder path can be a glob pattern. Repeat the flag for several scopes.
  • --token-only: Print only the token, to standard output, with no other details.

Examples

Create a read-only token for two folders
Create a read and write token that never expires
Capture the token in a variable

ssh

Infisical SSH has been removed, so these commands no longer work. SSH access is now part of Infisical PAM: set up an SSH account, then connect to it with infisical pam access.

ssh add-host

Removed along with Infisical SSH, so this command no longer works. See infisical ssh.

Flags

  • --alias <string>: A friendly name for the host, shown instead of the hostname when infisical ssh connect asks you to pick one.
  • --configure-sshd: Add TrustedUserCAKeys, HostKey, and HostCertificate entries to /etc/ssh/sshd_config. Requires --write-user-ca-to-file and --write-host-cert-to-file. The command doesn’t restart sshd.
  • --force: Overwrite the user CA file, the host certificate, and existing sshd_config entries instead of stopping when they already exist.
  • --hostname <string> (required): The host’s hostname.
  • --projectId <string> (required): The project to register the host in. Can also be set with INFISICAL_PROJECT_ID.
  • --token <string>: A machine identity access token to authenticate with, instead of your login. Without it, the CLI reads INFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN, then INFISICAL_TOKEN.
  • --user-ca-out-file-path <string> (default /etc/ssh/infisical_user_ca.pub): The file to write the user CA public key to, with --write-user-ca-to-file.
  • --write-host-cert-to-file: Have Infisical sign the host’s public key and write the host certificate next to it, as /etc/ssh/ssh_host_<type>_key-cert.pub. The CLI uses the first host key it finds in /etc/ssh, checking ed25519, then ecdsa, then rsa.
  • --write-user-ca-to-file: Write the public key of the CA that signs user certificates to --user-ca-out-file-path, so sshd can trust certificates issued for this host.

ssh connect

Removed along with Infisical SSH, so this command no longer works. To reach SSH hosts through Infisical, use infisical pam access. See infisical ssh.

Flags

  • --hostname <string>: The host to connect to, matched exactly against its hostname. Without it, the CLI asks you to pick one of the hosts you can access.
  • --login-user <string>: The user to log in to the host as. It must be one of the host’s login users. Without it, the CLI asks you to pick one.
  • --out-file-path <string>: Write the private key, public key, and certificate to files instead of connecting. Pass a directory to name them id_ed25519, id_ed25519.pub, and id_ed25519-cert.pub, or a path ending in -cert.pub to name the certificate, with the keys next to it.
  • --token <string>: A machine identity access token to authenticate with, instead of your login. Without it, the CLI reads INFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN, then INFISICAL_TOKEN.
  • --write-host-ca-to-file (default true): Add the host CA’s public key to ~/.ssh/known_hosts as a @cert-authority entry for the host, if it isn’t there yet. Pass --write-host-ca-to-file=false to leave known_hosts unchanged.

ssh issue-credentials

Removed along with Infisical SSH, so this command no longer works. See infisical ssh.

Flags

  • --addToAgent: Add the issued key and certificate to your SSH agent. Needs SSH_AUTH_SOCK to be set. Pass this, --outFilePath, or both.
  • --certType <string> (default user): The kind of certificate to issue: user or host.
  • --certificateTemplateId <string> (required): The ID of the SSH certificate template to issue against.
  • --keyAlgorithm <string> (default RSA_2048): The algorithm of the key pair to generate: RSA_2048, RSA_4096, EC_prime256v1, or EC_secp384r1.
  • --keyId <string>: The key ID to put in the certificate.
  • --outFilePath <string>: The directory to write the private key, public key, and certificate to. It’s created if it doesn’t exist. The files are named after the key algorithm, such as id_rsa_2048, id_rsa_2048.pub, and id_rsa_2048-cert.pub. Pass this, --addToAgent, or both.
  • --principals <string> (required): The principals to issue the certificate for, separated by commas.
  • --token <string>: A machine identity access token to authenticate with, instead of your login. Without it, the CLI reads INFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN, then INFISICAL_TOKEN.
  • --ttl <string>: How long the certificate is valid for. Without it, the certificate template’s default applies.

ssh sign-key

Removed along with Infisical SSH, so this command no longer works. See infisical ssh.

Flags

  • --certType <string> (default user): The kind of certificate to issue: user or host.
  • --certificateTemplateId <string> (required): The ID of the SSH certificate template to sign against.
  • --keyId <string>: The key ID to put in the certificate.
  • --outFilePath <string>: The file to write the certificate to. It must end in -cert.pub. Required with --publicKey. With --publicKeyFilePath, it defaults to the public key’s path with .pub replaced by -cert.pub.
  • --principals <string> (required): The principals to sign the certificate for, separated by commas.
  • --publicKey <string>: The public key to sign, as text. Pass this or --publicKeyFilePath, not both.
  • --publicKeyFilePath <string>: The path to the public key file to sign. It must end in .pub. Pass this or --publicKey, not both.
  • --token <string>: A machine identity access token to authenticate with, instead of your login. Without it, the CLI reads INFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN, then INFISICAL_TOKEN.
  • --ttl <string>: How long the certificate is valid for. Without it, the certificate template’s default applies.

token

Manage machine identity access tokens. The only subcommand is infisical token renew.

token renew

Renew a machine identity access token, such as one printed by infisical login --method=universal-auth, and print the renewed token. How long a token can be renewed for is set by the machine identity’s Access Token TTL and Access Token Max TTL. Service tokens, which start with st., can’t be renewed. The command doesn’t use your login profile, so for any instance other than US Cloud, pass --domain or set INFISICAL_DOMAIN.

Arguments

  • token (required): The machine identity access token to renew.

Examples

Renew an access token
Renew a token on another instance

user

Print a profile’s session token, pick the default profile from a list, or move a profile to another instance. For everything else, use infisical profile.

user get

Print details of a login profile. The only subcommand is infisical user get token.

user get token

Print the access token of the profile in effect, along with its session ID, expiry time, and remaining lifetime. Pass --profile to read another profile’s token, or --org to get a token for a different organization. See infisical profile for how the profile in effect is chosen. If the session has expired, or you have no profile yet, the CLI runs infisical login first.

Flags

  • --plain: Print only the access token, with no labels, session ID, or expiry.

Examples

Show the session token and its expiry
Capture the token in a variable
Get the token of a specific profile

user switch

Pick the machine’s default profile from a list of your profiles, each shown with its account, organization, and instance. This does the same as infisical profile use, which takes the profile name instead of asking. A terminal pinned with infisical profile pin or a directory bound with infisical profile bind keeps using its own profile.

Examples

Pick the default profile from a list

user update

Change a login profile. The only subcommand is infisical user update domain.

user update domain

Point a profile at a different Infisical instance, such as moving it from Infisical Cloud to your self-hosted instance. The command asks which profile to change, then for the new instance’s URL. Only the profile you pick changes, even when other profiles use the same account and instance. A session issued by the old instance isn’t valid on the new one, so the CLI clears the profile’s stored credentials and its organization. Sign in again with infisical login --profile <name> --domain <url>.

Examples

Move a profile to another instance

vault

Show where the CLI stores your login credentials, and list the vaults you can switch to with infisical vault set. There are two vaults. auto, the default, uses your system keyring: the macOS Keychain, Windows Credential Manager, or the Secret Service on Linux. If the CLI can’t write to the system keyring the first time it stores credentials, it switches to file on its own. file stores credentials encrypted in ~/infisical-keyring, with a random passphrase kept in the CLI’s config file, ~/.infisical/infisical-config.json.

Examples

Show the vault in use

vault set

Change where the CLI stores your login credentials. See infisical vault for what each vault is. Credentials in the previous vault can’t be read from the new one, so switching removes every profile, the default profile, and every directory binding. Log in again with infisical login afterwards. Credentials already in the previous vault aren’t deleted.

Arguments

  • vault (required): The vault to store credentials in: auto for the system keyring, or file for an encrypted file.

Examples

Store credentials in an encrypted file
Go back to the system keyring