#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-secretsis now#sm-dynamic-secrets#exportis now#sm-export#runis now#sm-run#secretsis now#sm-secrets#secrets-agent-proxyis now#sm-agent-proxy
Global flags
Every command accepts these flags.Flags
--domain <string>(defaulthttps://app.infisical.com): The Infisical instance to connect to, such ashttps://eu.infisical.comfor EU Cloud or your self-hosted URL. Check out Set the Infisical instance for more information.--log-destination <string>: Where to write logs:stderrorstdout. Defaults tostderr. Can also be set withLOG_DESTINATION.--log-format <string>: How to format logs:consolefor colored text,plainfor text without color, orjsonfor structured logs. Defaults toconsole. SetNO_COLOR=1to drop the colors fromconsole. Can also be set withLOG_FORMAT.--log-level <string>(-l): The lowest level of log message to print:trace,debug,info,warn,error, orfatal. Defaults toinfo. Can also be set withLOG_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 withINFISICAL_ORG.--profile <string>: The login profile to use for this command. Runinfisical profile listto see your profiles. Can also be set withINFISICAL_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(defaulttrue): Send usage telemetry to Infisical.
agent
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>(defaultagent-config.yaml): The path to the agent’s YAML configuration file. Ignored whenINFISICAL_AGENT_CONFIG_BASE64is set.
Examples
Start the agent with the default config fileagent service
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)
start, stop, and uninstall only act on services that install created.
agent service install
/etc/infisical/agents/<name>.service-config.yamlon Linux%ProgramFiles%\Infisical\Agent\<name>\service-config.yamlon Windows, next to the service’s own copy ofinfisical.exe(to upgrade the service, uninstall it and install it again)
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/tmpon Linux, because the service can’t read/homeand has its own private/tmpand/var/tmp(keep these files in a directory such as/etc/infisical/agents)
Arguments
name(optional): The service’s name. Defaults toinfisical-agent.
Flags
--config <string>(defaultagent-config.yaml): The path to the agent’s YAML configuration file. The service doesn’t useINFISICAL_AGENT_CONFIG_BASE64.
Examples
Install a service on Linuxagent service start
Arguments
name(optional): The service to start. Defaults toinfisical-agent.
Examples
Start a service on Linuxagent service stop
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 toinfisical-agent.
Examples
Stop a service on Linuxagent service uninstall
Arguments
name(optional): The service to remove. Defaults toinfisical-agent.
Examples
Remove a service on Linuxagent start
infisical agent, agent start ignores INFISICAL_AGENT_CONFIG_BASE64.
Flags
--config <string>(defaultagent-config.yaml): The path to the agent’s YAML configuration file. Can also be set withINFISICAL_AGENT_CONFIG_PATH.
Examples
Start the agent with a config set in the environmentagent-vault
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
--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 withINFISICAL_AGENT_VAULT_CA_CERT.--ca-key <string>: The ECDSA P-256 private key for--ca-cert, in the same formats. Can also be set withINFISICAL_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-vaultwhen run as root. Can also be set withINFISICAL_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>(defaultconsole): The format of the logs written to stderr:consoleorjson.--port <int>(default17323): The port to listen on, on all interfaces.0picks any free port, which the startup line reports. Can also be set withINFISICAL_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 withINFISICAL_AGENT_VAULT_PROXY_TOKEN, which keeps it off the command line.
Examples
Start a proxyagent-vault run
- Pass
--session-token(or setINFISICAL_AGENT_VAULT_SESSION_TOKEN), to use an existing session that already exists in Infisical - Pass
--access-bundle(or setINFISICAL_AGENT_VAULT_ACCESS_BUNDLE), to create a session with that access bundle
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.
--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 ascoding-agent. A session holds one access bundle, so pass the flag only once. Can’t be combined with--session-token. Can also be set withINFISICAL_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 toca-<proxy-id>.pemin~/.infisical/agent-vault, or/etc/infisical/agent-vaultwhen 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 theSHA256:prefix and colons.--client-id <string>: The client ID of the machine identity that creates the session, for--access-bundle. Can also be set withINFISICAL_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 withINFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET.--keep-session: Leave a session created with--access-bundleactive 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-bundleis for, shown on the Sessions page, such asnightly 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-fingerprintis still checked.--no-proxy <string>: More hosts for the agent to reach directly instead of through the proxy, separated by commas. Always merged withlocalhost,127.0.0.1and anyNO_PROXYin 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 ashost:port, such as10.0.1.5:17323. A leadinghttp://orhttps://is dropped. Required unlessINFISICAL_AGENT_VAULT_PROXY_ADDRESSis 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 withINFISICAL_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>(defaultnever): How long a session created with--access-bundlelasts: one number and one unit, such as30m,8h, or7d(not2h30m), ornever. Defaults toneverbecause 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-bundlenor--session-tokenis passed.INFISICAL_AGENT_VAULT_PROXY_ADDRESS: The Agent Vault proxy’s address ashost:port. Used if--proxyisn’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-tokennor--access-bundleis passed.INFISICAL_UNIVERSAL_AUTH_CLIENT_ID: The client ID of the machine identity that creates the session. Used if--client-idisn’t passed.INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET: The client secret of the machine identity that creates the session. Used if--client-secretisn’t passed.
Examples
Run an agent with a session tokenagent-vault skills
agent-vault skills push
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
unchangedand doesn’t create a version
.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, withSKILL.mdat its root.
Flags
--client-id <string>: The client ID of the machine identity to push as. Can also be set withINFISICAL_UNIVERSAL_AUTH_CLIENT_ID.--client-secret <string>: The client secret of the machine identity to push as. Can also be set withINFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET.
Environment variables
INFISICAL_UNIVERSAL_AUTH_CLIENT_ID: The client ID of the machine identity to push as. Used if--client-idisn’t passed.INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET: The client secret of the machine identity to push as. Used if--client-secretisn’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 andINFISICAL_UNIVERSAL_AUTH_ACCESS_TOKENisn’t set.
Examples
Push a skill as the logged-in userbootstrap
--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 withINFISICAL_DOMAIN, or the olderINFISICAL_API_URL.--email <string>(required): The email address of the admin user to create. Can also be set withINFISICAL_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’sdataandstringDataas JSON, for--output=k8-secret. It can read the response fields, such as.Identity.Credentials.Token,.Organization.ID, and.User.Email, and use theencodeBase64function.--organization <string>(required): The name of the organization to create. Can also be set withINFISICAL_ADMIN_ORGANIZATION.--output <string>: Where to send the result.k8-secretwrites 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 withINFISICAL_ADMIN_PASSWORD.
Examples
Bootstrap an instancecert-manager
cert-manager agent
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>(defaultcertificate-agent-config.yaml): The path to the agent’s YAML configuration file. Ignored whenINFISICAL_AGENT_CONFIG_BASE64is set.--verbose(-v): Log at debug level, for troubleshooting.
Examples
Start the certificate agentgateway
gateway start
--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 withINFISICAL_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, oroidc-auth. Can also be set withINFISICAL_AUTH_METHOD.--bind <string>: The localhost:portto listen on when Infisical connects to the gateway directly. Defaults to all interfaces on the configured direct port. Can also be set withINFISICAL_GATEWAY_BIND_ADDRESS.--client-id <string>: The machine identity’s client ID, for--auth-method=universal-auth. Can also be set withINFISICAL_UNIVERSAL_AUTH_CLIENT_ID.--client-secret <string>: The machine identity’s client secret, for--auth-method=universal-auth. Can also be set withINFISICAL_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:tokenfor a one-time enrollment token from Infisical,aws,gcp, orkubernetes. Can also be set withINFISICAL_GATEWAY_ENROLL_METHOD.--gateway-id <string>: The gateway’s ID from Infisical. Required with--enroll-method=aws,gcp, orkubernetes, unless the gateway saved it on an earlier start. Can also be set withINFISICAL_GATEWAY_ID.--gcp-auth-type <string>: How the gateway proves its GCP identity with--enroll-method=gcp:gcereads a token from the instance metadata server, covering Compute Engine VMs and GKE workload identity, andiamsigns a JWT through the IAM Credentials API. Defaults togce. Can also be set withINFISICAL_GATEWAY_GCP_AUTH_TYPE.--jwt <string>: The JWT to exchange for an access token, for--auth-method=oidc-auth.--listen-address <string>: The stablehost:portthe gateway advertises so Infisical can connect to it directly instead of through a relay. Can also be set withINFISICAL_GATEWAY_LISTEN_ADDRESS.--machine-identity-id <string>: The machine identity’s ID, for every--auth-methodexceptuniversal-auth.--name <string>(deprecated): Deprecated: pass the name as an argument instead, as ininfisical 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 withINFISICAL_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 withINFISICAL_PKCS11_MODULE.--relay <string>(deprecated): Deprecated: use--target-relay-nameinstead.--service-account-key-file-path <string>: The path to a GCP service account key file, for--auth-method=gcp-iam. Can also be set withINFISICAL_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 withINFISICAL_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 withINFISICAL_TOKEN.
Examples
Enroll and start a gatewaygateway systemd
gateway systemd install
/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 localhost:portto 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:tokenfor a one-time enrollment token, orawsorgcpto prove its cloud identity each time the service starts.kubernetesisn’t available, because in-cluster gateways aren’t managed by systemd.--gateway-id <string>: The gateway’s ID from Infisical. Required with--enroll-method=awsor--enroll-method=gcp.--gcp-auth-type <string>: How the gateway proves its GCP identity with--enroll-method=gcp:gceoriam. Defaults togce.--listen-address <string>: The stablehost:portthe 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 ininfisical 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-nameinstead.--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/homeand/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 servicegateway systemd uninstall
Arguments
name(optional): The gateway whose service to remove. Without it, the command removes the singleinfisical-gatewayservice that older CLI versions installed.
Examples
Remove a gateway serviceinit
.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.yamldirectly. Find the ID with infisical sm projects list.
Examples
Link the current directory to a projectkmip
kmip start
--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-nameorINFISICAL_KMIP_SERVER_NAME.
Flags
--certificate-ttl <string>: How long the server’s certificate is valid. Defaults to1y. Can also be set withINFISICAL_KMIP_CERTIFICATE_TTL.--domain <string>: The Infisical instance to connect to.--enroll-method <string>: How the server authenticates on its own:tokenfor a one-time enrollment token, oraws. 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 withINFISICAL_KMIP_HOSTNAMES_OR_IPS.--identity-auth-method <string>(defaultuniversal-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 withINFISICAL_UNIVERSAL_AUTH_CLIENT_ID.--identity-client-secret <string>: The machine identity’s client secret. Can also be set withINFISICAL_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 tolocalhost:5696. Can also be set withINFISICAL_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 serverkmip systemd
kmip systemd install
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:tokenoraws. 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 servicekmip systemd uninstall
Examples
Remove the KMIP server servicelogin
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 withINFISICAL_UNIVERSAL_AUTH_CLIENT_ID.--client-secret <string>: The client secret of a machine identity, for--method=universal-auth. Can also be set withINFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET.--email <string>: Your email address, for logging in without prompts along with--passwordand--organization-id. Can also be set withINFISICAL_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-authand--method=jwt-auth. Can also be set withINFISICAL_JWT.--machine-identity-id <string>: The ID of the machine identity to log in as. Required for every--methodexceptuseranduniversal-auth. Can also be set withINFISICAL_MACHINE_IDENTITY_ID.--method <string>(defaultuser): How to authenticate:userfor your own account, or a machine identity method:universal-auth,kubernetes,azure,gcp-id-token,gcp-iam,aws-iam,oidc-auth, orjwt-auth.--oidc-jwt <string>(deprecated): Deprecated: use--jwtinstead. 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 withINFISICAL_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 withINFISICAL_PASSWORD.--plain: Print only the access token, with no other output. Combine with--silentto 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--profileinstead.--service-account-key-file-path <string>: The path to a GCP service account key file, for--method=gcp-iam. Can also be set withINFISICAL_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 withINFISICAL_KUBERNETES_SERVICE_ACCOUNT_TOKEN_PATH.
Examples
Log in through the browserlogin status
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 sessionlogout
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 profilemigrate-config
.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 configorg
--org to any command to use a different organization for that command only.
org list
Examples
List your organizationsorg switch
--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 listpam
pam access
-- 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, asfolder/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>(default1h): How long the session lasts, in Go duration format such as30m,1h, or2h30m.--port <int>(default0): The port the local proxy listens on at127.0.0.1.0picks 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 hourspam agentic
pam agentic access
-- 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 asclaude, after--. Everything after--is passed to it unchanged.
Flags
--account <stringArray>: An account to expose, asfolder/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, orgeneric. 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, orldap-auth. The CLI renews the machine identity’s token for the whole run. Can also be set withINFISICAL_AUTH_METHOD.--client-id <string>: The machine identity’s client ID, for--auth-method=universal-auth. Can also be set withINFISICAL_UNIVERSAL_AUTH_CLIENT_ID.--client-secret <string>: The machine identity’s client secret, for--auth-method=universal-auth. Can also be set withINFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET.--duration <string>(default1h): How long each PAM session can last, in Go duration format such as30m,1h, or2h30m. It must be positive.--jwt <string>: The JWT to log in with, for--auth-method=oidc-authorjwt-auth. Can also be set withINFISICAL_JWT.--ldap-password <string>: The LDAP password, for--auth-method=ldap-auth. Can also be set withINFISICAL_LDAP_PASSWORD.--ldap-username <string>: The LDAP username, for--auth-method=ldap-auth. Can also be set withINFISICAL_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-methodexceptuniversal-auth. Can also be set withINFISICAL_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 withINFISICAL_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 withINFISICAL_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 withINFISICAL_KUBERNETES_SERVICE_ACCOUNT_TOKEN_PATH.--token <string>: A machine identity access token to run as. Service tokens aren’t accepted. Without it, the CLI readsINFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN, thenINFISICAL_TOKEN.
Examples
Run Claude Code with every account you can launchprofile
infisical login --save-as <name>.
A command uses the first of these that’s set:
--profileon the command- The
INFISICAL_PROFILEenvironment variable, set by infisical profile pin - A directory bound with infisical profile bind
- The machine’s default profile, set with infisical profile use
profile bind
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 effectprofile create
--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 throughevalfor the pin to take effect.--use: Also make the new profile the default for this machine.
Examples
Create a profile for another organizationprofile current
Flags
--plain: Print only the profile name, for use in shell prompts.
Examples
Show the profile in effectprofile delete
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 profileprofile list
Examples
List your profilesprofile pin
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 profileprofile rename
Arguments
name(required): The profile’s current name.new-name(required): The name to give it.
Examples
Rename a profileprofile set-org
--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 listprofile unbind
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 directoryprofile unpin
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 terminalprofile use
Arguments
name(required): The profile to make the default.
Examples
Make a profile the defaultproxy
proxy start
--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>(default5m): How often to check that cached access tokens are still valid, such as5mor1h.--client-id <string>: A universal auth machine identity’s client ID. Required with--enable-event-subscriptions. Can also be set withINFISICAL_UNIVERSAL_AUTH_CLIENT_ID.--client-secret <string>: The machine identity’s client secret. Required with--enable-event-subscriptions. Can also be set withINFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET.--domain <string>: The Infisical instance to forward requests to, such ashttps://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-idand--client-secret.--eviction-strategy <string>(defaultoptimistic): How to handle the cache when Infisical is unreachable.optimistic, the only strategy, keeps serving cached data.--listen-address <string>(defaultlocalhost:8081): The address to listen on.--polling-fallback-interval <string>(default10m): How often to poll for secret changes when event subscriptions are unavailable, such as1m. Used only with--enable-event-subscriptions.--static-secrets-refresh-interval <string>(default1h): How often to refresh cached secrets, such as30mor1h. Not used with--enable-event-subscriptions.--tls-cert-file <string>: The proxy’s TLS certificate file. Required while--tls-enabledis on.--tls-enabled(defaulttrue): Serve the proxy over TLS. Pass--tls-enabled=falseto serve plain HTTP.--tls-key-file <string>: The proxy’s TLS private key file. Required while--tls-enabledis on.
Examples
Start the proxy with TLSrelay
relay start
--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, oroidc-auth. Can also be set withINFISICAL_AUTH_METHOD.--client-id <string>: The machine identity’s client ID, for--auth-method=universal-auth. Can also be set withINFISICAL_UNIVERSAL_AUTH_CLIENT_ID.--client-secret <string>: The machine identity’s client secret, for--auth-method=universal-auth. Can also be set withINFISICAL_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:tokenfor a one-time enrollment token, oraws. Can also be set withINFISICAL_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 withINFISICAL_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-methodexceptuniversal-auth.--name <string>: The relay’s name. Can also be set withINFISICAL_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 withINFISICAL_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>:orgfor a relay that belongs to your organization, orinstancefor a relay that serves the whole Infisical instance, run by the instance’s admins. Defaults toorg. Can also be set withINFISICAL_RELAY_TYPE.
Examples
Enroll and start a relayrelay systemd
relay systemd install
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:tokenfor a one-time enrollment token, oraws.--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>(defaultorg):orgfor a relay that belongs to your organization, orinstancefor a relay that serves the whole Infisical instance, run by the instance’s admins.
Examples
Install an organization relayrelay systemd uninstall
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 servicereset
~/.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 CLIscan
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 earlierinfisical scanrun. 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>(defaultmedium): The lowest confidence a finding needs to be reported:low,medium, orhigh. 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.tomlin the--sourcedirectory, then the built-in rules. Can also be set withINFISICAL_SCAN_CONFIG.--exit-code <int>(default1): The exit code to use when the scan finds leaks. Pass0to exit successfully anyway.--follow-symlinks: Scan the files that symbolic links point to. Applies only with--no-git.--log-opts <string>: Options to pass togit log -pto choose the commits to scan, such as--all commitA..commitB. They replace the default--full-history --all. Has no effect with--no-gitor--pipe.--max-target-megabytes <int>(default0): Skip files larger than this many megabytes.0means no limit. Applies only with--no-git.--no-color: Turn off color in verbose output.--no-git: Scan the files in--sourceas a plain directory instead of reading Git history.--pipe: Scan standard input instead of--source, as incat 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, orgitea, ornonefor no links. Without it, the CLI detects the platform from the repository’s remote URL. Applies only to Git history scans.--redact: Replace secrets withREDACTEDin verbose output. Reports written with--report-pathstill contain the secrets.--report-format <string>(-f, defaultjson): The report’s format:json,csv,sarif, orjunit.--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 historyscan git-changes
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>(defaultmedium): The lowest confidence a finding needs to be reported:low,medium, orhigh. Findings from rules that don’t set a confidence are always reported.--staged: Scan the changes staged withgit addinstead of the unstaged changes.
Inherited flags
--config <string>(-c): The scan config file to use. Without it, the CLI uses.infisical-scan.tomlin the--sourcedirectory, then the built-in rules. Can also be set withINFISICAL_SCAN_CONFIG.--exit-code <int>(default1): The exit code to use when the scan finds leaks. Pass0to exit successfully anyway.--no-color: Turn off color in verbose output.--redact: Replace secrets withREDACTEDin verbose output. Reports written with--report-pathstill contain the secrets.--report-format <string>(-f, defaultjson): The report’s format:json,csv,sarif, orjunit.--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 changesscan install
--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 hookservice-token
service-token create
--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, default86400): How long the token lasts, in seconds from now. Pass0for a token that never expires.--name <string>(-n, defaultService 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 withINFISICAL_PROJECT_ID.--scope <stringSlice>(-s, required): An environment and folder the token can access, as<env-slug>:<folder-path>, such asdev:/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 folderssm
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
sm agent-proxy connect
--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 withINFISICAL_AGENT_PROXY_ALLOW_READABLE_BROKERED_SECRETS.--client-id <string>: The client ID of the agent’s machine identity. Can also be set withINFISICAL_UNIVERSAL_AUTH_CLIENT_ID.--client-secret <string>: The client secret of the agent’s machine identity. Can also be set withINFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET.--env <string>(-e, required): The environment to fetch proxied services and secrets from. Without it, the CLI readsINFISICAL_ENVIRONMENT, then the environment that.infisical.yamlmaps to your git branch, then itssecrets-management.environment.--no-proxy <string>: More hosts for the agent to reach directly instead of through the proxy, separated by commas. Always merged withlocalhost,127.0.0.1and anyNO_PROXYin your environment.--path <string>(default/): The folder to fetch proxied services and secrets from. Without it, the CLI readsINFISICAL_SECRET_PATH, thensecrets-management.secret-pathin.infisical.yaml.--projectId <string>(required): The project to fetch proxied services and secrets from. Can also be set withINFISICAL_PROJECT_ID, or read from.infisical.yaml.--proxy <string>(required): The agent proxy’s address ashost:port. Can also be set withINFISICAL_AGENT_PROXY_ADDRESS. It’s never read from.infisical.yaml.--token <string>: A machine identity access token to authenticate with, instead of--client-idand--client-secret. Without it, the CLI readsINFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN, thenINFISICAL_TOKEN.
Examples
Launch an agent behind a proxysm agent-proxy run
--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=blockis 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 readsINFISICAL_ENVIRONMENT, then the environment that.infisical.yamlmaps to your git branch, then itssecrets-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 readsINFISICAL_SECRET_PATH, thensecrets-management.secret-pathin.infisical.yaml.--poll-interval <int>(default60): The number of seconds between refreshes of permissions and credentials.--projectId <string>(required): The project to fetch proxied services from. Can also be set withINFISICAL_PROJECT_ID, or read from.infisical.yaml.--sandbox(defaulttrue): Run the agent inside the OS sandbox. Pass--sandbox=falseor--no-sandboxto turn it off. Can also be set withINFISICAL_AGENT_PROXY_SANDBOX, where0,false, oroffturns it off.--set-env <stringArray>: An environment variable to set in the agent, asKEY=VALUE. It overrides every other value. Repeatable.--token <string>: A token to broker with, instead of your login. Without it, the CLI readsINFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN, thenINFISICAL_TOKEN, then uses your login.--unmatched-host <string>(defaultallow): What to do with requests to a host that has no proxied service:allowforwards them with no credential, andblockrejects them.
Examples
Run an agent in the sandboxsm agent-proxy start
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 withINFISICAL_UNIVERSAL_AUTH_CLIENT_ID.--client-secret <string>(required): The client secret of the proxy’s machine identity. Can also be set withINFISICAL_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>(defaultconsole): The format of the logs written to stderr:consoleorjson.--poll-interval <int>(default60): The number of seconds between refreshes of permissions and credentials for active agents.--port <int>(default17322): The port to listen on, on all interfaces.--unmatched-host <string>(defaultallow): What to do with requests to a host that has no proxied service:allowforwards them with no credential, andblockrejects them.blockalso rejects requests to your Infisical instance.
Examples
Start the proxysm dynamic-secrets
Flags
--env <string>(defaultdev): The environment to work in. Everyinfisical sm dynamic-secretssubcommand accepts it. Defaults toINFISICAL_ENVIRONMENT, then the default environment in.infisical.yaml, thendev.--output <string>(-o): Print the dynamic secrets asjson,yaml, ordotenvinstead of a table.--path <string>(default/): The folder to list dynamic secrets from. Defaults toINFISICAL_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 withINFISICAL_PROJECT_ID.--token <string>: A machine identity access token to authenticate with, instead of your login. Without it, the CLI readsINFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN, thenINFISICAL_TOKEN.
Examples
List dynamic secrets in devsm dynamic-secrets lease
Inherited flags
--env <string>(defaultdev): The environment that holds the dynamic secret.
sm dynamic-secrets lease create
--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, asjson,yaml, ordotenv, instead of the lease details and a table.--path <string>(-p, default/): The folder that holds the dynamic secret. Defaults toINFISICAL_SECRET_PATH, then the default folder in.infisical.yaml, then/.--plain: Print each credential asKEY=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 withINFISICAL_PROJECT_ID.--token <string>: A machine identity access token to authenticate with, instead of your login. Without it, the CLI readsINFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN, thenINFISICAL_TOKEN.--ttl <string>: How long the lease lasts, such as30mor1h. Defaults to the dynamic secret’s default TTL, and can’t exceed its max TTL.
Inherited flags
--env <string>(defaultdev): The environment that holds the dynamic secret.
Examples
Lease database credentials for an hoursm dynamic-secrets lease delete
--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 asjson,yaml, ordotenvinstead of a table.--path <string>(-p, default/): The folder that holds the lease’s dynamic secret. Defaults toINFISICAL_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 withINFISICAL_PROJECT_ID.--token <string>: A machine identity access token to authenticate with, instead of your login. Without it, the CLI readsINFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN, thenINFISICAL_TOKEN.
Inherited flags
--env <string>(defaultdev): The environment that holds the lease’s dynamic secret.
Examples
Delete a leasesm dynamic-secrets lease list
Arguments
name(required): The name of the dynamic secret to list leases for.
Flags
--output <string>(-o): Print the leases asjson,yaml, ordotenvinstead of a table.--path <string>(-p, default/): The folder that holds the dynamic secret. Defaults toINFISICAL_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 withINFISICAL_PROJECT_ID.--token <string>: A machine identity access token to authenticate with, instead of your login. Without it, the CLI readsINFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN, thenINFISICAL_TOKEN.
Inherited flags
--env <string>(defaultdev): The environment that holds the dynamic secret.
Examples
List a dynamic secret’s leasessm dynamic-secrets lease renew
--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 asjson,yaml, ordotenvinstead of a table.--path <string>(-p, default/): The folder that holds the lease’s dynamic secret. Defaults toINFISICAL_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 withINFISICAL_PROJECT_ID.--token <string>: A machine identity access token to authenticate with, instead of your login. Without it, the CLI readsINFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN, thenINFISICAL_TOKEN.--ttl <string>: How long to extend the lease by, from its current expiry, such as30mor1h. Defaults to the dynamic secret’s default TTL.
Inherited flags
--env <string>(defaultdev): The environment that holds the lease’s dynamic secret.
Examples
Extend a lease by 30 minutessm export
.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, defaultdev): The environment to export secrets from, such asdev,staging, orprod. Defaults toINFISICAL_ENVIRONMENT, then the default environment in.infisical.yaml, thendev.--expand(defaulttrue): Resolve secret references and shell parameter expansions in secret values. Pass--expand=falseto export values exactly as stored.--format <string>(-f, defaultdotenv): The output format:dotenv,dotenv-export,dotenv-eval,csv,json, oryaml.--include-imports(defaulttrue): 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, orsecrets.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 toINFISICAL_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 withINFISICAL_PROJECT_ID.--secret-overriding(defaulttrue): Export your personal secrets in place of shared secrets with the same name. Pass--secret-overriding=falseto 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 otherexportflag except--tokenis ignored.--token <string>: A machine identity access token to authenticate with, instead of your login. Without it, the CLI readsINFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN, thenINFISICAL_TOKEN.
Examples
Write a .env filesm projects
--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
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 asjsonoryamlinstead 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 readsINFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN, thenINFISICAL_TOKEN.
Examples
Create a project and link this directory to itsm projects get
--env flag of other sm commands.
Flags
--output <string>(-o): Print the project asjsonoryamlinstead of a table.--projectId <string>: The ID of the project to show. Defaults toINFISICAL_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 readsINFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN, thenINFISICAL_TOKEN.
Examples
Show the project linked to this directorysm projects list
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 asjsonoryamlinstead of a table.--token <string>: A machine identity access token to authenticate with, instead of your login. Without it, the CLI readsINFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN, thenINFISICAL_TOKEN.
Examples
List your projectssm run
.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, defaultdev): The environment to fetch secrets from, such asdev,staging, orprod. Defaults toINFISICAL_ENVIRONMENT, then the default environment in.infisical.yaml, thendev.--expand(defaulttrue): Resolve secret references and shell parameter expansions in secret values before injecting them. Pass--expand=falseto inject values exactly as stored.--include-imports(defaulttrue): 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--pathwins. Defaults toINFISICAL_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 withINFISICAL_PROJECT_ID.--recursive: Also inject the secrets in every subfolder of each--path.--secret-overriding(defaulttrue): Use your personal secrets in place of shared secrets with the same name. Pass--secret-overriding=falseto 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 readsINFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN, thenINFISICAL_TOKEN.--watch: Restart the command whenever secrets change in Infisical. Intended for local development.--watch-interval <int>(default10): How often, in seconds,--watchchecks for changes. The minimum is5.
Examples
Start a dev server with secretssm secrets
--output to print them as JSON, YAML, or dotenv instead.
Flags
--env <string>(defaultdev): The environment to list secrets from. Everyinfisical sm secretssubcommand accepts it. Defaults toINFISICAL_ENVIRONMENT, then the default environment in.infisical.yaml, thendev.--expand(defaulttrue): Resolve secret references and shell parameter expansions in secret values.--include-imports(defaulttrue): Include secrets imported into the environment from other environments or folders.--output <string>(-o): Print the secrets asjson,yaml, ordotenvinstead of a table.--path <string>(default/): The folder to list secrets from. Defaults toINFISICAL_SECRET_PATH, then the default folder in.infisical.yaml, then/.--plain(deprecated): Deprecated: use--outputinstead. 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 withINFISICAL_PROJECT_ID.--recursive: Also list the secrets in every subfolder of--path.--secret-overriding(defaulttrue): Show your personal secrets in place of shared secrets with the same name. Pass--secret-overriding=falseto show only shared secrets.--tags <string>(-t): Only list secrets with these tag slugs, separated by commas.infisical sm secrets getandinfisical sm secrets generate-example-envaccept it too.--token <string>: A machine identity access token to fetch secrets with, instead of your login. Without it, the CLI readsINFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN, thenINFISICAL_TOKEN.
Examples
List secrets in devsm secrets delete
--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 asjson,yaml, ordotenvinstead of a table.--path <string>(default/): The folder to delete from. Defaults toINFISICAL_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 withINFISICAL_PROJECT_ID.--token <string>: A machine identity access token to authenticate with, instead of your login. Without it, the CLI readsINFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN, thenINFISICAL_TOKEN.--type <string>(defaultpersonal): Which secrets to delete:personalorshared.
Inherited flags
--env <string>(defaultdev): The environment to delete from.
Examples
Delete two shared secretssm secrets folders
/backend/api.
Flags
--env <string>(defaultdev): The environment to work in. Everyinfisical sm secrets folderssubcommand accepts it. Defaults toINFISICAL_ENVIRONMENT, then the default environment in.infisical.yaml, thendev.
Inherited flags
--tags <string>(-t): Has no effect on folder commands.
sm secrets folders create
--name inside --path.
Flags
--name <string>(-n, required): The name of the folder to create.--output <string>(-o): Print the result asjson,yaml, ordotenvinstead 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 withINFISICAL_PROJECT_ID.--token <string>: A machine identity access token to authenticate with, instead of your login. Without it, the CLI readsINFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN, thenINFISICAL_TOKEN.
Inherited flags
--env <string>(defaultdev): The environment to create the folder in.
Examples
Create a foldersm secrets folders delete
--name inside --path.
Flags
--name <string>(-n, required): The name of the folder to delete.--output <string>(-o): Print the result asjson,yaml, ordotenvinstead 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 withINFISICAL_PROJECT_ID.--token <string>: A machine identity access token to authenticate with, instead of your login. Without it, the CLI readsINFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN, thenINFISICAL_TOKEN.
Inherited flags
--env <string>(defaultdev): The environment to delete the folder from.
Examples
Delete a foldersm secrets folders get
--path.
Flags
--output <string>(-o): Print the folders asjson,yaml, ordotenvinstead 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 withINFISICAL_PROJECT_ID.--token <string>: A machine identity access token to authenticate with, instead of your login. Without it, the CLI readsINFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN, thenINFISICAL_TOKEN.
Inherited flags
--env <string>(defaultdev): The environment to list folders from.
Examples
List the folders at the rootsm secrets generate-example-env
.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 toINFISICAL_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 withINFISICAL_PROJECT_ID.--token <string>: A machine identity access token to authenticate with, instead of your login. Without it, the CLI readsINFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN, thenINFISICAL_TOKEN.
Inherited flags
--env <string>(defaultdev): The environment to read secrets from.--tags <string>(-t): Only include secrets with these tag slugs, separated by commas.
Examples
Write an example .env filesm secrets get
*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(defaulttrue): Resolve secret references and shell parameter expansions in secret values.--include-imports(defaulttrue): Also look for the names among secrets imported from other environments or folders.--output <string>(-o): Print the secrets asjson,yaml, ordotenvinstead of a table.--path <string>(default/): The folder to read from. Defaults toINFISICAL_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 withINFISICAL_PROJECT_ID.--recursive: Also look for the names in every subfolder of--path.--secret-overriding(defaulttrue): Return your personal secret in place of a shared secret with the same name. Pass--secret-overriding=falseto return only shared secrets.--token <string>: A machine identity access token to authenticate with, instead of your login. Without it, the CLI readsINFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN, thenINFISICAL_TOKEN.
Inherited flags
--env <string>(defaultdev): The environment to read from.--tags <string>(-t): Only return secrets with these tag slugs, separated by commas.
Examples
Show two secretssm secrets set
--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. Usename=@path/to/fileto read the value from a file, andname=\@valuefor a value that starts with@. Required unless you pass--file.
Flags
--file <string>: A.envor YAML file to read secrets from, instead of arguments. Lines starting with#or//are comments.--output <string>(-o): Print the result asjson,yaml, ordotenvinstead of a table.--path <string>(default/): The folder to write to. Defaults toINFISICAL_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 withINFISICAL_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 readsINFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN, thenINFISICAL_TOKEN.--type <string>(defaultshared):sharedfor secrets everyone on the project sees, orpersonalfor secrets that override them only for you.
Inherited flags
--env <string>(defaultdev): The environment to write to.--tags <string>(-t): Has no effect on this command. Use--tagto attach tags.
Examples
Set two secretsssh
ssh add-host
Flags
--alias <string>: A friendly name for the host, shown instead of the hostname wheninfisical ssh connectasks you to pick one.--configure-sshd: AddTrustedUserCAKeys,HostKey, andHostCertificateentries to/etc/ssh/sshd_config. Requires--write-user-ca-to-fileand--write-host-cert-to-file. The command doesn’t restartsshd.--force: Overwrite the user CA file, the host certificate, and existingsshd_configentries 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 withINFISICAL_PROJECT_ID.--token <string>: A machine identity access token to authenticate with, instead of your login. Without it, the CLI readsINFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN, thenINFISICAL_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, checkinged25519, thenecdsa, thenrsa.--write-user-ca-to-file: Write the public key of the CA that signs user certificates to--user-ca-out-file-path, sosshdcan trust certificates issued for this host.
ssh connect
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 themid_ed25519,id_ed25519.pub, andid_ed25519-cert.pub, or a path ending in-cert.pubto 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 readsINFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN, thenINFISICAL_TOKEN.--write-host-ca-to-file(defaulttrue): Add the host CA’s public key to~/.ssh/known_hostsas a@cert-authorityentry for the host, if it isn’t there yet. Pass--write-host-ca-to-file=falseto leaveknown_hostsunchanged.
ssh issue-credentials
Flags
--addToAgent: Add the issued key and certificate to your SSH agent. NeedsSSH_AUTH_SOCKto be set. Pass this,--outFilePath, or both.--certType <string>(defaultuser): The kind of certificate to issue:userorhost.--certificateTemplateId <string>(required): The ID of the SSH certificate template to issue against.--keyAlgorithm <string>(defaultRSA_2048): The algorithm of the key pair to generate:RSA_2048,RSA_4096,EC_prime256v1, orEC_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 asid_rsa_2048,id_rsa_2048.pub, andid_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 readsINFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN, thenINFISICAL_TOKEN.--ttl <string>: How long the certificate is valid for. Without it, the certificate template’s default applies.
ssh sign-key
Flags
--certType <string>(defaultuser): The kind of certificate to issue:userorhost.--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.pubreplaced 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 readsINFISICAL_UNIVERSAL_AUTH_ACCESS_TOKEN, thenINFISICAL_TOKEN.--ttl <string>: How long the certificate is valid for. Without it, the certificate template’s default applies.
token
token renew
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 tokenuser
user get
user get token
--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 expiryuser switch
Examples
Pick the default profile from a listuser update
user update domain
infisical login --profile <name> --domain <url>.
Examples
Move a profile to another instancevault
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 usevault set
Arguments
vault(required): The vault to store credentials in:autofor the system keyring, orfilefor an encrypted file.