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 #sm-run--flag-path. Here, the part before -- is the command’s heading, and the item is listed under it: #sm-run--flag-path is the --path flag under #sm-run. Some commands moved, so links to the CLI reference can use anchors that no longer exist. Each old anchor below maps to a new one, and so do the anchors that start with it: #<old>-<rest> is now #<new>-<rest>. If more than one old anchor matches, the longest one applies.
  • #dynamic-secrets is now #sm-dynamic-secrets
  • #export is now #sm-export
  • #run is now #sm-run
  • #secrets is now #sm-secrets
  • #secrets-agent-proxy is now #sm-agent-proxy

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. Upload skills for those agents with infisical agent-vault skills push. av is an alias, so infisical av run works wherever infisical agent-vault run does. Agent Vault is a different product from the agent proxy that infisical sm agent-proxy runs.

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:
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. The agent inherits the rest of your environment, and the command exits with the agent’s exit code. Before the agent starts, the command installs the skills in the session’s access bundle in ~/.agents/skills, and links them for Claude Code and Hermes. To install the skills in another folder, pass --skills-dir, and to start the agent without them, pass --no-skills. The installed skills stay after the agent exits. To pick up skills that changed while the agent runs, restart the agent. For which folders the command links and replaces, see How agents get skills.

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.
  • --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-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 the session’s skills, so the command doesn’t contact Infisical for them. Use it if the agent’s host can’t reach Infisical. Can’t be combined with --skills-dir.
  • --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_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_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 skills

Manage the skills that Agent Vault installs for agents. infisical agent-vault skills push adds a skill from a folder or publishes a new version of it.

agent-vault skills push

Upload a skill folder to Agent Vault. Each command pushes one folder, and the name in the folder’s SKILL.md decides which skill 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 Agent Vault.

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.

Environment variables

  • 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

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 sm projects list.

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, so you never see it, and every session is recorded. Open one account for yourself with infisical pam access, or give an AI agent brokered access with infisical pam agentic access.

pam access

Open a session for one PAM account. The command runs as the user you logged in as with infisical login; it doesn’t accept a machine identity. To open accounts for an agent, use infisical pam agentic access. SSH accounts connect you to a shell on the target. Pass a command after -- to run only that command, or --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, the CLI starts a local proxy on 127.0.0.1 and prints how to connect to it. For AWS IAM accounts, 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. If the account requires approval, the CLI offers to submit an access request in an interactive terminal. If it requires MFA, the CLI has you complete MFA in your browser before it continues.

Arguments

  • path (required): The account to open, as folder/account. A leading / is optional.
  • command (optional): A command to run on the target instead of opening a shell, after --. SSH accounts only.

Flags

  • --duration <string> (default 1h): How long the session lasts, in Go duration format such as 30m, 1h, or 2h30m.
  • --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.
  • --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. If the account requires a reason and you don’t pass one, the CLI prompts for it in an interactive terminal and fails otherwise.
  • --target <string>: The host to connect to, for accounts that allow several hosts, such as Windows AD accounts.

Examples

Open a database session for two hours
Open a shell on a server
Run one command on a server
Start a local SSH proxy

pam agentic

Run AI agents against PAM accounts. The agent reaches each account through a local proxy and never holds a credential. Start a run with infisical pam agentic access, and see AI agents for how it works.

pam agentic access

Start a local proxy for each PAM account you can launch, then start an AI agent with instructions for reaching them. Everything after -- is the command that starts the agent. The -- is required when that command has flags of its own. The CLI gives each account its own port on 127.0.0.1, and the agent connects through those ports without ever holding a credential. The CLI skips accounts that require MFA and accounts of types agentic access doesn’t support, and lists each skipped account with the reason. To open a skipped account, use infisical pam access. The CLI adds instructions for reaching the accounts to the agent’s system prompt or to a file such as AGENTS.md, depending on the agent. It runs the agent in an OS sandbox, which stops the agent from reading your Infisical login. On a host without a sandbox, the command fails unless you pass --no-sandbox. The run authenticates with --token when one is set, then as a machine identity when --auth-method is set, and otherwise as the user you logged in as with infisical login.

Arguments

  • agent-command (required): The command that starts the agent, such as claude, after --. Everything after -- is passed to it unchanged.

Flags

  • --account <stringArray>: An account to expose, as folder/account. Repeat the flag or separate paths with commas. Defaults to every account you can launch. If a named account can’t be used, the command stops and says why.
  • --agent <string>: The agent type, when the CLI can’t detect it from the command name: claude, codex, gemini, or generic. It sets how the instructions are delivered.
  • --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 for the whole run. 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 each PAM session can last, in Go duration format such as 30m, 1h, or 2h30m. It must be positive.
  • --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.
  • --log-file <string>: A file to write proxy logs to while the agent runs. Without it, proxy logs are discarded.
  • --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.
  • --no-approval-request: Don’t raise access requests for accounts that need approval, and leave those accounts out of the run. By default, the CLI raises a request the first time the agent connects to one, and the account works once a reviewer approves it.
  • --no-sandbox: Run the agent without the OS sandbox, so it can read your Infisical login and other credential files. Required on hosts with no sandbox, such as Windows.
  • --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. Can also be set with INFISICAL_AUTH_ORGANIZATION_SLUG.
  • --reason <string>: Why the agent needs access, recorded for audit. The CLI can’t prompt for a reason while the agent is running in the terminal, so accounts that require a reason need this flag.
  • --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.
  • --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 Claude Code with every account you can launch
Run Codex with two accounts
Record a reason and keep proxy logs
Run your own agent as a machine identity

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.

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

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

sm

Manage secrets from the command line. The sm commands inject secrets into a process, export them to a file, read and write them, lease credentials from dynamic secrets, run the Agent Proxy, and list and create projects.
If infisical --version prints 0.43.145 or earlier, your CLI doesn’t have sm. Upgrade the CLI, or run the commands without sm, such as infisical run instead of infisical sm run. For the Agent Proxy, use infisical secrets agent-proxy instead of infisical sm agent-proxy.

sm agent-proxy

Run the Infisical Agent Proxy, which lets AI agents and untrusted code use secrets without holding them. Agents send their HTTP requests through the proxy, which replaces placeholder credentials with real ones before forwarding each request, so the agent never holds the real secret. For an agent on your own computer, infisical sm agent-proxy run starts a proxy and a sandboxed agent together. For a proxy shared across your network, run infisical sm agent-proxy start on its own host, and launch agents behind it with infisical sm agent-proxy connect.

sm agent-proxy connect

Launch an agent that sends its requests through an agent proxy on another host, started with infisical sm agent-proxy start. See Standalone Agent Proxy. The command authenticates as the agent’s machine identity, with --client-id and --client-secret or a token. It doesn’t use your login. It then 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 your organization’s root certificate. See what connect puts in the agent’s environment. If the agent can read a secret or lease a dynamic secret that a proxied service brokers to it, the command refuses to start, because the agent would get the real value and bypass the proxy. The command exits with the agent’s exit code.

Arguments

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

Flags

  • --allow-readable-brokered-secrets: Start the agent even if it can read the real value of a secret that a proxied service substitutes into its requests. Without this flag, the command exits with an error, and you fix it by removing the agent’s read permission on that secret. Can also be set with INFISICAL_AGENT_PROXY_ALLOW_READABLE_BROKERED_SECRETS.
  • --client-id <string>: The client ID of the agent’s machine identity. Can also be set with INFISICAL_UNIVERSAL_AUTH_CLIENT_ID.
  • --client-secret <string>: The client secret of the agent’s machine identity. Can also be set with INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET.
  • --env <string> (-e, required): The environment to fetch proxied services and secrets from. Without it, the CLI reads INFISICAL_ENVIRONMENT, then the environment that .infisical.yaml maps to your git branch, then its secrets-management.environment.
  • --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.
  • --path <string> (default /): The folder to fetch proxied services and secrets from. Without it, the CLI reads INFISICAL_SECRET_PATH, then secrets-management.secret-path in .infisical.yaml.
  • --projectId <string> (required): The project to fetch proxied services and secrets from. Can also be set with INFISICAL_PROJECT_ID, or read from .infisical.yaml.
  • --proxy <string> (required): The agent proxy’s address as host:port. Can also be set with INFISICAL_AGENT_PROXY_ADDRESS. It’s never read from .infisical.yaml.
  • --token <string>: A machine identity access token to authenticate with, instead of --client-id and --client-secret. Without it, the CLI reads INFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN, then INFISICAL_TOKEN.

Examples

Launch an agent behind a proxy
Read the settings from environment variables
Authenticate as a machine identity

sm agent-proxy run

Launch an agent on your own computer in an OS sandbox, with a proxy that brokers credentials onto its requests. The command starts the proxy, runs the agent, and stops the proxy when the agent exits. It authenticates as your login, or with --token. See Local Agent Proxy. The sandbox stops the agent from reading credential files such as ~/.ssh and ~/.aws. If the host supports it, the sandbox also blocks every network connection except the one to the proxy. The sandbox needs macOS, or Linux with bubblewrap installed. On any other system, the command won’t start unless you pass --no-sandbox. The agent never gets real secret values or an Infisical token. It gets placeholder values for proxied services that substitute credentials into requests. The command removes variables that look like credentials from the agent’s environment, such as any variable with TOKEN or SECRET in its name. To keep one of those variables, pass its name to --pass-env. The command always starts its own proxy. To use a proxy on another host, run infisical sm agent-proxy connect.

Arguments

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

Flags

  • --allow-host <stringArray>: A host the agent can reach, without a credential, when --unmatched-host=block is set. Repeatable.
  • --allow-read <stringArray>: A path the agent can read even though the sandbox blocks it by default, such as ~/.aws/config. The path stays read-only, and the rest of a denied directory stays denied. Repeatable.
  • --allow-write <stringArray>: A path the agent can write, beyond the working directory, the temporary directory, and the state directories of Claude Code, Codex, and Gemini CLI. Repeatable.
  • --env <string> (-e, required): The environment to fetch proxied services from. Without it, the CLI reads INFISICAL_ENVIRONMENT, then the environment that .infisical.yaml maps to your git branch, then its secrets-management.environment.
  • --log-file <string>: A file to write the proxy’s per-request activity to. The file is appended to. Without it, nothing is written, and only warnings and errors print to stderr unless you pass --log-level.
  • --no-sandbox: Run the agent without the OS sandbox. Credentials are still brokered, but the agent can read your files and keyring and reach the network directly.
  • --pass-env <stringArray>: One of your environment variables to pass through to the agent, by name, when the command would otherwise remove it. Repeatable.
  • --path <string> (default /): The folder to fetch proxied services from. Without it, the CLI reads INFISICAL_SECRET_PATH, then secrets-management.secret-path in .infisical.yaml.
  • --poll-interval <int> (default 60): The number of seconds between refreshes of permissions and credentials.
  • --projectId <string> (required): The project to fetch proxied services from. Can also be set with INFISICAL_PROJECT_ID, or read from .infisical.yaml.
  • --sandbox (default true): Run the agent inside the OS sandbox. Pass --sandbox=false or --no-sandbox to turn it off. Can also be set with INFISICAL_AGENT_PROXY_SANDBOX, where 0, false, or off turns it off.
  • --set-env <stringArray>: An environment variable to set in the agent, as KEY=VALUE. It overrides every other value. Repeatable.
  • --token <string>: A token to broker with, instead of your login. Without it, the CLI reads INFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN, then INFISICAL_TOKEN, then uses your login.
  • --unmatched-host <string> (default allow): What to do with requests to a host that has no proxied service: allow forwards them with no credential, and block rejects them.

Examples

Run an agent in the sandbox
Read the project and environment from .infisical.yaml
Allow only proxied services and one registry
Keep a log of proxied requests

sm agent-proxy start

Start an agent proxy in the foreground, for agents on other hosts to connect to with infisical sm agent-proxy connect. See Standalone Agent Proxy. The proxy authenticates as its own machine identity, which needs read access to the secrets your proxied services reference, and renews its access token as it runs. The proxy logs brokered requests at info and blocked requests at warn. To also see requests passed through without a credential, pass --log-level=debug.

Flags

  • --client-id <string> (required): The client ID of the proxy’s machine identity. Can also be set with INFISICAL_UNIVERSAL_AUTH_CLIENT_ID.
  • --client-secret <string> (required): The client secret of the proxy’s machine identity. Can also be set with INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET.
  • --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.
  • --poll-interval <int> (default 60): The number of seconds between refreshes of permissions and credentials for active agents.
  • --port <int> (default 17322): The port to listen on, on all interfaces.
  • --unmatched-host <string> (default allow): What to do with requests to a host that has no proxied service: allow forwards them with no credential, and block rejects them. block also rejects requests to your Infisical instance.

Examples

Start the proxy
Block hosts with no proxied service
Log JSON to a file

sm 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 sm dynamic-secrets lease.

Flags

  • --env <string> (default dev): The environment to work in. Every infisical sm 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

sm 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.

sm 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 sm 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

sm dynamic-secrets lease delete

Delete a lease before it expires, and revoke its credentials with the provider. --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.

Inherited flags

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

Examples

Delete a lease

sm 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

sm 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

sm 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. 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

sm projects

List, inspect, and create Secrets Management projects. Use these commands to find the project ID that infisical init and the --projectId flag take, or to create a project without opening Infisical. project is an alias, so infisical sm project list also works.
The commands work only with Secrets Management projects. Projects of other products, such as Certificate Management or KMS, don’t appear in the list.

sm 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.
Service tokens can’t create projects. If your environment stores a service token in INFISICAL_TOKEN, the command uses your login instead.

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

sm projects get

Show a project’s name, slug, and ID, and the name, slug, and ID of each of its environments. Use an environment’s slug with the --env flag of other sm commands.

Flags

  • --output <string> (-o): Print the project as json or yaml instead of a table.
  • --projectId <string>: The ID of the project to show. 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

Show the project linked to this directory
Show a project by ID

sm projects list

List the name, slug, and ID of each Secrets Management project you’re a member of in your organization. With a machine identity, the command lists the projects the identity is a member of.
Service tokens can’t create projects. If your environment stores a service token in INFISICAL_TOKEN, the command uses your login instead.

Flags

  • --output <string> (-o): Print the projects 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.

Examples

List your projects
List a machine identity’s projects as JSON

sm 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

sm 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 sm 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 only secret values, 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 sm secrets get and infisical sm secrets generate-example-env accept 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

sm secrets delete

Delete secrets by name. 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.

Inherited flags

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

Examples

Delete two shared secrets
Remove your personal override of a secret

sm secrets folders

Create, delete, and list the folders in an environment. Folders organize an environment’s secrets into paths such as /backend/api.

Flags

  • --env <string> (default dev): The environment to work in. Every infisical sm secrets folders subcommand accepts it. Defaults to INFISICAL_ENVIRONMENT, then the default environment in .infisical.yaml, then dev.

Inherited flags

  • --tags <string> (-t): Has no effect on folder commands.

sm secrets folders create

Create a folder named --name inside --path.

Flags

  • --name <string> (-n, required): The name of the folder to create.
  • --output <string> (-o): Print the result as json, yaml, or dotenv instead of a table.
  • --path <string> (-p, default /): The folder to create the new folder in.
  • --projectId <string>: The project to create the folder in. 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.

Inherited flags

  • --env <string> (default dev): The environment to create the folder in.

Examples

Create a folder

sm secrets folders delete

Delete the folder named --name inside --path.

Flags

  • --name <string> (-n, required): The name of the folder to delete.
  • --output <string> (-o): Print the result as json, yaml, or dotenv instead of a table.
  • --path <string> (-p, default /): The folder that contains the folder to delete.
  • --projectId <string>: The project to delete the folder 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.

Inherited flags

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

Examples

Delete a folder

sm secrets folders get

List the folders inside --path.

Flags

  • --output <string> (-o): Print the folders as json, yaml, or dotenv instead of a table.
  • --path <string> (-p, default /): The folder to list folders from.
  • --projectId <string>: The project to list folders 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.

Inherited flags

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

Examples

List the folders at the root
List the folders under a path in production

sm secrets generate-example-env

Print an example .env file that lists every secret’s name without its value, for people who work on the project without Infisical. Each secret’s comment in Infisical appears as a comment above it. To give a secret an example value, add DEFAULT:<value> to the end of its comment.

Flags

  • --path <string> (default /): The folder to read secrets from. Defaults to INFISICAL_SECRET_PATH, then the default folder in .infisical.yaml, then /.
  • --projectId <string>: The project to read secrets 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.

Inherited flags

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

Examples

Write an example .env file

sm secrets get

Print the secrets you name. 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 (required, repeatable): The names of the secrets to print.

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

Show two secrets
Read a value into a variable
Print production secrets as JSON

sm secrets set

Create secrets, or update the value of secrets that already exist. The result table masks values unless you pass --show-values. You can set secrets without permission to read secret values. In that case, the CLI can’t compare values, so it writes every secret you pass that already exists and reports each one as SECRET VALUE MODIFIED, even when the value didn’t change. 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 or update. 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 result as json, yaml, or dotenv instead of a table.
  • --path <string> (default /): The folder to write to. Defaults to INFISICAL_SECRET_PATH, then the default folder in .infisical.yaml, then /.
  • --projectId <string>: The project to write to. Required when you authenticate with a machine identity. Can also be set with INFISICAL_PROJECT_ID.
  • --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. When you update a secret, these tags replace its existing ones.
  • --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 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 write to.
  • --tags <string> (-t): Has no effect on this command. Use --tag to attach tags.

Examples

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

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