Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
refactor(cli): update CLI commands to use 'sm' prefix for secrets management and restructure sidebar navigation
Victor Hugo dos Santos1989e195cc84
diff --git a/docs/.vale/styles/config/vocabularies/Infisical/any-case/accept.txt b/docs/.vale/styles/config/vocabularies/Infisical/any-case/accept.txtindex c28b3a7747..d823cfb502 100644--- a/docs/.vale/styles/config/vocabularies/Infisical/any-case/accept.txt+++ b/docs/.vale/styles/config/vocabularies/Infisical/any-case/accept.txt@@ -358,6 +358,9 @@ I# PAM is both the product and a lowercase CLI subcommand.(?i)PAM+# The CLI's Secrets Management command, which also appears on its own in anchors+# such as `sm-run`. Lowercase only, so a stray "SM" in prose is still reported.+sm# Case-insensitive because a canonical entry makes the converter capitalize the# verb "go" and rewrite the `git-changes` subcommand.(?i)Git\bdiff --git a/docs/changelog/overview.mdx b/docs/changelog/overview.mdxindex 496f436973..bd9fa40cfa 100644--- a/docs/changelog/overview.mdx+++ b/docs/changelog/overview.mdx@@ -144,7 +144,7 @@ The changelog below reflects new product developments and updates on a monthly b## August 2024- Added [Azure DevOps integration](https://infisical.com/docs/integrations/cloud/azure-devops).-- Released ability to hot-reload variables in CLI ([--watch flag](https://infisical.com/docs/cli/reference#run--flag-watch)).+- Released ability to hot-reload variables in CLI ([--watch flag](https://infisical.com/docs/cli/reference#sm-run--flag-watch)).- Added Dynamic Secrets for [Redis](https://infisical.com/docs/documentation/platform/dynamic-secrets/redis).- Added [Alerting](https://infisical.com/docs/documentation/platform/pki/alerting) for Certificate Management.- You can now specify roles and project memberships when adding new users.@@ -223,7 +223,7 @@ The changelog below reflects new product developments and updates on a monthly b- Released [(machine) identities](https://infisical.com/docs/documentation/platform/identities/overview) and [universal auth](https://infisical.com/docs/documentation/platform/identities/universal-auth) features.- Created new cross-language SDKs for [Python](https://infisical.com/docs/sdks/languages/python), [Node](https://infisical.com/docs/sdks/languages/node), and [Java](https://infisical.com/docs/sdks/languages/java).- Released first version of the [Infisical Agent](https://infisical.com/docs/infisical-agent/overview)-- Added ability to [manage folders via CLI](https://infisical.com/docs/cli/reference#secrets-folders).+- Added ability to [manage folders via CLI](https://infisical.com/docs/cli/reference#sm-secrets-folders).## Nov 2023diff --git a/docs/cli-reference-nav.js b/docs/cli-reference-nav.jsindex 71205ec73b..2773760f3c 100644--- a/docs/cli-reference-nav.js+++ b/docs/cli-reference-nav.js@@ -47,18 +47,41 @@var current = { id: null, path: null };- // The sidebar lists only root commands, so a subcommand in view lights up its root's entry.+ // The sidebar lists root commands and a few subcommands, so a subcommand in view lights up+ // the entry of its nearest listed parent, such as `sm secrets` for `sm secrets get`.function sidebarTarget(id, path) {var ids = {};document.querySelectorAll('#sidebar-content a[href*="/cli/reference#"]').forEach(function (link) {ids[targetOf(link)] = true;});if (ids[id]) return id;- var root = path ? path.split(" ")[0] : null;- return root && ids[root] ? root : id;+ var words = path ? path.split(" ") : [];+ for (var length = words.length - 1; length > 0; length--) {+ var parent = words.slice(0, length).join("-");+ if (ids[parent]) return parent;+ }+ return id;+ }++ // Mintlify doesn't render the entries of a collapsed group, such as `infisical sm`, so a+ // command in that group has no link to light up until the group is open.+ function expandGroupFor(path) {+ var words = path ? path.split(" ") : [];+ var buttons = document.querySelectorAll('#sidebar-content button[aria-expanded="false"]');+ for (var length = words.length; length > 0; length--) {+ var label = "infisical " + words.slice(0, length).join(" ");+ for (var i = 0; i < buttons.length; i++) {+ if (buttons[i].textContent.trim() === label) {+ buttons[i].click();+ return;+ }+ }+ }}- function highlight(id, path) {+ // Groups open only when the command in view changes, not on every re-render, so a reader+ // can still collapse a group while reading one of its commands.+ function highlight(id, path, openGroup) {current = { id: id, path: path || null };var root = document.documentElement;var target = id === null ? null : sidebarTarget(id, current.path);@@ -74,12 +97,13 @@keepVisible(active);} else {root.removeAttribute("data-cli-nav");+ if (openGroup && target !== null) expandGroupFor(current.path);}}window.addEventListener("cli-reference:active", function (event) {var detail = event.detail || {};- highlight(detail.id || null, detail.path);+ highlight(detail.id || null, detail.path, true);});// Sidebar links that render later, such as when Mintlify re-renders the sidebar, need the@@ -114,7 +138,7 @@// A sidebar click is navigation, so it lands at once like a page load would.section.scrollIntoView();window.history.replaceState(window.history.state, "", "#" + id);- highlight(id, section.dataset.command);+ highlight(id, section.dataset.command, true);},true);diff --git a/docs/cli/faq.mdx b/docs/cli/faq.mdxindex e20d6cbdf8..374fd144e2 100644--- a/docs/cli/faq.mdx+++ b/docs/cli/faq.mdx@@ -19,21 +19,21 @@ If you're still experiencing trouble, please seek support.</Accordion><Accordion title="How do I keep secret values out of my shell history?">-Your shell saves the commands you run to a history file, so a secret value you pass to `infisical secrets set` stays in that file. To avoid this, pass the values with `--file` or `name=@path`, or configure your shell to skip those commands.+Your shell saves the commands you run to a history file, so a secret value you pass to `infisical sm secrets set` stays in that file. To avoid this, pass the values with `--file` or `name=@path`, or configure your shell to skip those commands.<Tabs><Tab title="Bash">Add the pattern to `HISTIGNORE` in `~/.bashrc`:```bash- echo 'export HISTIGNORE="*infisical secrets set*:$HISTIGNORE"' >> ~/.bashrc && source ~/.bashrc+ echo 'export HISTIGNORE="*infisical*secrets set*:$HISTIGNORE"' >> ~/.bashrc && source ~/.bashrc```</Tab><Tab title="Zsh">Add the pattern to `HISTORY_IGNORE` in `~/.zshrc`:```bash- echo "HISTORY_IGNORE='(*infisical secrets set*)'" >> ~/.zshrc && source ~/.zshrc+ echo "HISTORY_IGNORE='(*infisical*secrets set*)'" >> ~/.zshrc && source ~/.zshrc```Zsh applies `HISTORY_IGNORE` when it writes the history file, so the command still appears when you press the up arrow in the current session.@@ -43,12 +43,12 @@ Your shell saves the commands you run to a history file, so a secret value you pIn PowerShell, the PSReadLine module saves your command history. To check its version, run `(Get-Module PSReadLine).Version`.- PSReadLine 2.2 and later, which ships with PowerShell 7.2 and later, doesn't save commands that contain words such as `secret`, `token`, or `password`, so `infisical secrets set` is already skipped.+ PSReadLine 2.2 and later, which ships with PowerShell 7.2 and later, doesn't save commands that contain words such as `secret`, `token`, or `password`, so `infisical sm secrets set` is already skipped.- Older versions, including the one that ships with Windows PowerShell 5.1, save every command. Add this line to your [PowerShell profile](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_profiles) to skip `infisical secrets set`:+ Older versions, including the one that ships with Windows PowerShell 5.1, save every command. Add this line to your [PowerShell profile](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_profiles) to skip `infisical sm secrets set`:```powershell- Set-PSReadLineOption -AddToHistoryHandler { param($line) $line -notlike '*infisical secrets set*' }+ Set-PSReadLineOption -AddToHistoryHandler { param($line) $line -notlike '*infisical*secrets set*' }```Don't add this line on PSReadLine 2.2 or later, because a custom handler replaces the built-in one that skips commands with sensitive words.diff --git a/docs/cli/project-config.mdx b/docs/cli/project-config.mdxindex 081aa7d6f5..87e636ff42 100644--- a/docs/cli/project-config.mdx+++ b/docs/cli/project-config.mdx@@ -3,9 +3,9 @@ title: "Project configuration"description: "Configure how the Infisical CLI interacts with your directory."----`.infisical.json` links a directory to an [Infisical project](/documentation/platform/project). When you run a command such as [`infisical run`](/cli/reference#run) or [`infisical secrets`](/cli/reference#secrets) in that directory, the CLI reads the project from the file, so you don't have to pass [`--projectId`](/cli/reference#run--flag-projectid).+`.infisical.json` links a directory to an [Infisical project](/documentation/platform/project). When you run a command such as [`infisical sm run`](/cli/reference#sm-run) or [`infisical sm secrets`](/cli/reference#sm-secrets) in that directory, the CLI reads the project from the file, so you don't have to pass [`--projectId`](/cli/reference#sm-run--flag-projectid).-The file can also [choose an environment for you](#set-the-environment) and [pin the Infisical instance](#set-the-infisical-instance) the project lives on.+The file can also [choose an environment](#set-the-environment) and [a folder](#set-the-folder) for you, and [pin the Infisical instance](#set-the-infisical-instance) the project lives on.<Info>The `.infisical.json` file doesn't include any sensitive values and is safe to commit to version control.@@ -32,12 +32,12 @@ Select the project when prompted. The CLI writes `.infisical.json` to the curren`workspaceId` is the project's ID. The other fields are empty until you set them, as described in the sections that follow. If you run [`infisical init`](/cli/reference#init) again, the CLI replaces the file with a new one that holds only the project ID, so you lose any settings you added.<Note>- If you authenticate as a [machine identity](/documentation/platform/identities/machine-identities), `infisical run`, [`infisical export`](/cli/reference#export), and `infisical secrets` don't read `workspaceId`. Pass the project with `--projectId` or the `INFISICAL_PROJECT_ID` environment variable instead.+ If you authenticate as a [machine identity](/documentation/platform/identities/machine-identities), `infisical sm run`, [`infisical sm export`](/cli/reference#sm-export), and `infisical sm secrets` don't read `workspaceId`. Pass the project with `--projectId` or the `INFISICAL_PROJECT_ID` environment variable instead.</Note>## Set the environment-Without an environment setting, commands read secrets from your project's [`dev` environment](/documentation/platform/secrets-mgmt/project#project-environments) unless you pass [`--env`](/cli/reference#run--flag-env). To use a different environment by default, set `defaultEnvironment` to the environment's slug:+Without an environment setting, commands read secrets from your project's [`dev` environment](/documentation/platform/secrets-mgmt/project#project-environments) unless you pass [`--env`](/cli/reference#sm-run--flag-env). To use a different environment by default, set `defaultEnvironment` to the environment's slug:```json .infisical.json{@@ -64,9 +64,30 @@ The CLI matches only the last part of a branch name, after the final `/`. For exThe CLI picks the environment in this order:1. The `--env` flag-2. The environment mapped to your current Git branch-3. `defaultEnvironment`-4. `dev`+2. The `INFISICAL_ENVIRONMENT` environment variable+3. The environment mapped to your current Git branch+4. `defaultEnvironment`+5. `dev`++## Set the folder++Without a folder setting, commands read secrets from the root of the environment (`/`) unless you pass [`--path`](/cli/reference#sm-run--flag-path). To read from a different [folder](/documentation/platform/folder) by default, set `defaultSecretPath` to the folder's path:++```json .infisical.json+{+ "workspaceId": "<project-id>",+ "defaultSecretPath": "/backend"+}+```++The CLI picks the folder in this order:++1. The `--path` flag+2. The `INFISICAL_SECRET_PATH` environment variable+3. `defaultSecretPath`+4. `/`++The [`infisical sm secrets folders`](/cli/reference#sm-secrets-folders) commands don't read either setting, so pass `--path` to work in a folder other than `/`.## Set the Infisical instance@@ -105,14 +126,14 @@ If you log in with your own account, [`infisical login`](/cli/reference#login) uThe CLI looks for `.infisical.json` in the current directory, then in each parent directory up to the root of the file system. This means that if you have an `.infisical.json` file in the root of your codebase, that configuration applies to every directory under it.-To read the project from a file somewhere else, such as one package's directory in a monorepo, pass the directory to `infisical run` with [`--project-config-dir`](/cli/reference#run--flag-project-config-dir):+To read the project from a file somewhere else, such as one package's directory in a monorepo, pass the directory to `infisical sm run` with [`--project-config-dir`](/cli/reference#sm-run--flag-project-config-dir):```bash-infisical run --project-config-dir ./services/api -- npm run dev+infisical sm run --project-config-dir ./services/api -- npm run dev```<Note>-`--project-config-dir` only sets the project. The environment and instance settings still come from the `.infisical.json` the CLI finds from your current directory.+`--project-config-dir` sets the project, environment, and folder. The instance setting still comes from the `.infisical.json` the CLI finds from your current directory.</Note>## Field reference@@ -122,7 +143,7 @@ The ID of the project to read secrets from. Not used when you authenticate as a</ResponseField><ResponseField name="defaultEnvironment" type="string">-The environment slug to use when `--env` isn't passed and no branch mapping matches.+The environment slug to use when `--env` and `INFISICAL_ENVIRONMENT` aren't set and no branch mapping matches.</ResponseField><ResponseField name="gitBranchToEnvironmentMapping" type="object">@@ -130,7 +151,7 @@ Maps branch names to environment slugs, such as `{ "main": "prod" }`. Keys match</ResponseField><ResponseField name="defaultSecretPath" type="string">-The folder to read secrets from when [`--path`](/cli/reference#secrets-agent-proxy-run--flag-path) and `INFISICAL_SECRET_PATH` aren't set. Only the [`infisical secrets agent-proxy`](/cli/reference#secrets-agent-proxy) commands read it.+The folder to read secrets from when `--path` and `INFISICAL_SECRET_PATH` aren't set. The `infisical sm` commands read it, except `infisical sm secrets folders`.</ResponseField><ResponseField name="domain" type="string">diff --git a/docs/cli/reference.mdx b/docs/cli/reference.mdxindex a402ca591a..b639a8e146 100644--- a/docs/cli/reference.mdx+++ b/docs/cli/reference.mdx@@ -10,6 +10,7 @@ import { CLIPage, CLICommand } from "/snippets/CLIPage.jsx";<CLIPagetitle="CLI reference"description="Every Infisical CLI command, with its arguments, flags, and examples. Select a command or flag in a heading to jump to its details."+ movedAnchors={{ "dynamic-secrets": "sm-dynamic-secrets", export: "sm-export", run: "sm-run", secrets: "sm-secrets", "secrets-agent-proxy": "sm-agent-proxy" }}><CLICommand@@ -61,7 +62,7 @@ For a daemon that only manages certificates, use [infisical cert-manager agent](Run [Agent Vault](/documentation/platform/agent-vault/overview), 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](/cli/reference#agent-vault-proxy), usually where agent traffic leaves your network, and launch agents through it with [infisical agent-vault run](/cli/reference#agent-vault-run).-`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 secrets agent-proxy](/cli/reference#secrets-agent-proxy) runs.+`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](/cli/reference#sm-agent-proxy) runs.</CLICommand>@@ -125,7 +126,7 @@ With `--session-token`, the agent uses a session created in Infisical, and no loThe 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. [Certificate trust](/documentation/platform/agent-vault/proxies#certificate-trust) lists those variables and explains the macOS keychain prompt.-The agent inherits the rest of your environment unchanged, and the command exits with the agent's exit code. Unlike [infisical secrets agent-proxy run](/cli/reference#secrets-agent-proxy-run), this command doesn't sandbox the agent.+The agent inherits the rest of your environment unchanged, and the command exits with the agent's exit code. Unlike [infisical sm agent-proxy run](/cli/reference#sm-agent-proxy-run), this command doesn't sandbox the agent.</CLICommand>@@ -190,187 +191,6 @@ The configuration can't include secret templates. To render secrets as well, use</CLICommand>-<CLICommand- id="dynamic-secrets"- command="dynamic-secrets"- usage="[flags]"- flags={[- { name: "--env", value: "<string>", type: "string", default: "dev", description: "The environment to work in. Every `infisical dynamic-secrets` subcommand accepts it. Defaults to the [environment set in `.infisical.json`](/cli/project-config#set-the-environment), then `dev`." },- { name: "--output", short: "-o", value: "<string>", type: "string", description: "Print the dynamic secrets as `json`, `yaml`, or `dotenv` instead of a table." },- { name: "--path", value: "<string>", type: "string", default: "/", description: "The folder to list dynamic secrets from." },- { name: "--project-slug", value: "<string>", type: "string", description: "The slug of the project to list dynamic secrets from. Takes precedence over `--projectId`." },- { name: "--projectId", value: "<string>", type: "string", description: "The ID of the project to list dynamic secrets from. Without it or `--project-slug`, the CLI uses the project in `.infisical.json`. Can also be set with `INFISICAL_PROJECT_ID`." },- { name: "--token", value: "<string>", type: "string", description: "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={[- { title: "List dynamic secrets in dev", code: "infisical dynamic-secrets" },- { title: "List dynamic secrets in a production folder", code: "infisical dynamic-secrets --env=prod --path=/databases" },- { title: "Print dynamic secrets as JSON", code: "infisical dynamic-secrets --projectId=<project-id> --output=json" },- ]}->--List the [dynamic secrets](/documentation/platform/dynamic-secrets/overview) 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 dynamic-secrets lease](/cli/reference#dynamic-secrets-lease).--</CLICommand>--<CLICommand- id="dynamic-secrets-lease"- command="dynamic-secrets lease"- inheritedFlags={[- { name: "--env", value: "<string>", type: "string", default: "dev", description: "The environment that holds the dynamic secret." },- ]}->--Create, list, renew, and delete the leases of a dynamic secret.--</CLICommand>--<CLICommand- id="dynamic-secrets-lease-create"- command="dynamic-secrets lease create"- usage="<name> [flags]"- args={[- { name: "name", usage: "<name>", required: true, description: "The name of the dynamic secret to lease." },- ]}- flags={[- { name: "--kubernetes-namespace", value: "<string>", type: "string", description: "The namespace to create the lease in. Used only by Kubernetes dynamic secrets." },- { name: "--output", short: "-o", value: "<string>", type: "string", description: "Print only the credentials, as `json`, `yaml`, or `dotenv`, instead of the lease details and a table." },- { name: "--path", short: "-p", value: "<string>", type: "string", default: "/", description: "The folder that holds the dynamic secret." },- { name: "--plain", type: "bool", description: "Print each credential as `KEY=value`, one per line, with no other output. Ignored when you pass `--output`." },- { name: "--principals", value: "<string>", type: "string", description: "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." },- { name: "--project-slug", value: "<string>", type: "string", description: "The slug of the project that holds the dynamic secret. Takes precedence over `--projectId`." },- { name: "--projectId", value: "<string>", type: "string", description: "The ID of the project that holds the dynamic secret. Without it or `--project-slug`, the CLI uses the project in `.infisical.json`. Can also be set with `INFISICAL_PROJECT_ID`." },- { name: "--token", value: "<string>", type: "string", description: "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`." },- { name: "--ttl", value: "<string>", type: "string", description: "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." },- ]}- inheritedFlags={[- { name: "--env", value: "<string>", type: "string", default: "dev", description: "The environment that holds the dynamic secret." },- ]}- examples={[- { title: "Lease database credentials for an hour", code: "infisical dynamic-secrets lease create postgres-app --env=prod --ttl=1h" },- { title: "Lease credentials as JSON", code: "infisical dynamic-secrets lease create postgres-app --output=json" },- { title: "Lease an SSH certificate", code: "infisical dynamic-secrets lease create ssh-prod \\\n --projectId=<project-id> \\\n --env=prod \\\n --principals=root,deploy" },- ]}->--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 dynamic-secrets lease list](/cli/reference#dynamic-secrets-lease-list).--The table and `--plain` show only credentials whose values are strings. Pass `--output` to get every credential the provider returns.--</CLICommand>--<CLICommand- id="dynamic-secrets-lease-delete"- command="dynamic-secrets lease delete"- usage="<lease-id> [flags]"- args={[- { name: "lease-id", usage: "<lease-id>", required: true, description: "The ID of the lease to delete." },- ]}- flags={[- { name: "--output", short: "-o", value: "<string>", type: "string", description: "Print the deleted lease as `json`, `yaml`, or `dotenv` instead of a table." },- { name: "--path", short: "-p", value: "<string>", type: "string", default: "/", description: "The folder that holds the lease's dynamic secret." },- { name: "--project-slug", value: "<string>", type: "string", description: "The slug of the project that holds the lease. Takes precedence over `--projectId`." },- { name: "--projectId", value: "<string>", type: "string", description: "The ID of the project that holds the lease. Without it or `--project-slug`, the CLI uses the project in `.infisical.json`. Can also be set with `INFISICAL_PROJECT_ID`." },- { name: "--token", value: "<string>", type: "string", description: "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`." },- ]}- inheritedFlags={[- { name: "--env", value: "<string>", type: "string", default: "dev", description: "The environment that holds the lease's dynamic secret." },- ]}- examples={[- { title: "Delete a lease", code: "infisical dynamic-secrets lease delete <lease-id> --env=prod" },- ]}->--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.--</CLICommand>--<CLICommand- id="dynamic-secrets-lease-list"- command="dynamic-secrets lease list"- usage="<name> [flags]"- args={[- { name: "name", usage: "<name>", required: true, description: "The name of the dynamic secret to list leases for." },- ]}- flags={[- { name: "--output", short: "-o", value: "<string>", type: "string", description: "Print the leases as `json`, `yaml`, or `dotenv` instead of a table." },- { name: "--path", short: "-p", value: "<string>", type: "string", default: "/", description: "The folder that holds the dynamic secret." },- { name: "--project-slug", value: "<string>", type: "string", description: "The slug of the project that holds the dynamic secret. Takes precedence over `--projectId`." },- { name: "--projectId", value: "<string>", type: "string", description: "The ID of the project that holds the dynamic secret. Without it or `--project-slug`, the CLI uses the project in `.infisical.json`. Can also be set with `INFISICAL_PROJECT_ID`." },- { name: "--token", value: "<string>", type: "string", description: "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`." },- ]}- inheritedFlags={[- { name: "--env", value: "<string>", type: "string", default: "dev", description: "The environment that holds the dynamic secret." },- ]}- examples={[- { title: "List a dynamic secret's leases", code: "infisical dynamic-secrets lease list postgres-app --env=prod" },- ]}->--List the active leases of a dynamic secret, with each lease's ID, expiry time, and creation time.--</CLICommand>--<CLICommand- id="dynamic-secrets-lease-renew"- command="dynamic-secrets lease renew"- usage="<lease-id> [flags]"- args={[- { name: "lease-id", usage: "<lease-id>", required: true, description: "The ID of the lease to renew." },- ]}- flags={[- { name: "--output", short: "-o", value: "<string>", type: "string", description: "Print the renewed lease as `json`, `yaml`, or `dotenv` instead of a table." },- { name: "--path", short: "-p", value: "<string>", type: "string", default: "/", description: "The folder that holds the lease's dynamic secret." },- { name: "--project-slug", value: "<string>", type: "string", description: "The slug of the project that holds the lease. Takes precedence over `--projectId`." },- { name: "--projectId", value: "<string>", type: "string", description: "The ID of the project that holds the lease. Without it or `--project-slug`, the CLI uses the project in `.infisical.json`. Can also be set with `INFISICAL_PROJECT_ID`." },- { name: "--token", value: "<string>", type: "string", description: "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`." },- { name: "--ttl", value: "<string>", type: "string", description: "How long to extend the lease by, from its current expiry, such as `30m` or `1h`. Defaults to the dynamic secret's default TTL." },- ]}- inheritedFlags={[- { name: "--env", value: "<string>", type: "string", default: "dev", description: "The environment that holds the lease's dynamic secret." },- ]}- examples={[- { title: "Extend a lease by 30 minutes", code: "infisical dynamic-secrets lease renew <lease-id> --env=prod --ttl=30m" },- ]}->--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.--</CLICommand>--<CLICommand- id="export"- command="export"- usage="[flags]"- flags={[- { name: "--env", short: "-e", value: "<string>", type: "string", default: "dev", description: "The environment to export secrets from, such as `dev`, `staging`, or `prod`. Defaults to the [environment set in `.infisical.json`](/cli/project-config#set-the-environment), then `dev`." },- { name: "--expand", type: "bool", default: "true", description: "Resolve secret references and shell parameter expansions in secret values. Pass `--expand=false` to export values exactly as stored. It takes effect only when you authenticate with a token; with your login, the CLI always resolves them." },- { name: "--format", short: "-f", value: "<string>", type: "string", default: "dotenv", description: "The output format: `dotenv`, `dotenv-export`, `dotenv-eval`, `csv`, `json`, or `yaml`." },- { name: "--include-imports", type: "bool", default: "true", description: "Include secrets imported into the environment from other environments or folders." },- { name: "--output-file", short: "-o", value: "<string>", type: "string", description: "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." },- { name: "--path", value: "<string>", type: "string", default: "/", description: "The folder to export secrets from." },- { name: "--projectId", value: "<string>", type: "string", description: "The project to export secrets from. Required when you authenticate with a machine identity. Can also be set with `INFISICAL_PROJECT_ID`." },- { name: "--secret-overriding", type: "bool", default: "true", description: "Export your personal secrets in place of shared secrets with the same name. Pass `--secret-overriding=false` to export only shared secrets." },- { name: "--tags", short: "-t", value: "<string>", type: "string", description: "Only export secrets with these tag slugs, separated by commas." },- { name: "--template", value: "<string>", type: "string", description: "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." },- { name: "--token", value: "<string>", type: "string", description: "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={[- { title: "Write a .env file", code: "infisical export --output-file=./.env" },- { title: "Export production secrets as JSON", code: "infisical export --env=prod --format=json > secrets.json" },- { title: "Load secrets into the current shell", code: "eval \"$(infisical export --format=dotenv-eval)\"" },- { title: "Render secrets through a template", code: "infisical export --template=./secrets.tmpl" },- ]}->--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](/integrations/platforms/infisical-agent#available-secret-template-functions) provides, such as `listSecrets` and `getSecretByName`.--</CLICommand>-<CLICommandid="gateway"command="gateway"@@ -1186,43 +1006,6 @@ Log in again with [infisical login](/cli/reference#login) afterwards. Directory</CLICommand>-<CLICommand- id="run"- command="run"- usage="[flags] -- [command]"- args={[- { name: "command", usage: "[command]", description: "The command to run, after `--`. Everything after `--` is passed to it unchanged. Required unless you pass `--command`." },- ]}- flags={[- { name: "--command", short: "-c", value: "<string>", type: "string", description: "A shell command to run instead of the arguments after `--`, such as `\"npm run build && npm start\"`. Use it to chain several commands." },- { name: "--env", short: "-e", value: "<string>", type: "string", default: "dev", description: "The environment to fetch secrets from, such as `dev`, `staging`, or `prod`. Defaults to the [environment set in `.infisical.json`](/cli/project-config#set-the-environment), then `dev`." },- { name: "--expand", type: "bool", default: "true", description: "Resolve secret references and shell parameter expansions in secret values before injecting them. Pass `--expand=false` to inject values exactly as stored." },- { name: "--include-imports", type: "bool", default: "true", description: "Include secrets imported into the environment from other environments or folders." },- { name: "--path", value: "<stringArray>", type: "stringArray", default: "/", description: "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." },- { name: "--project-config-dir", value: "<string>", type: "string", description: "The directory that contains `.infisical.json`. Use it when the file isn't in the directory you run the command from, such as in a monorepo." },- { name: "--projectId", value: "<string>", type: "string", description: "The project to fetch secrets from. Required when you authenticate with a machine identity. Can also be set with `INFISICAL_PROJECT_ID`." },- { name: "--recursive", type: "bool", description: "Also inject the secrets in every subfolder of each `--path`." },- { name: "--secret-overriding", type: "bool", default: "true", description: "Use your personal secrets in place of shared secrets with the same name. Pass `--secret-overriding=false` to use only shared secrets." },- { name: "--tags", short: "-t", value: "<string>", type: "string", description: "Only inject secrets with these tag slugs, separated by commas." },- { name: "--token", value: "<string>", type: "string", description: "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`." },- { name: "--watch", type: "bool", description: "Restart the command whenever secrets change in Infisical. Intended for local development." },- { name: "--watch-interval", value: "<int>", type: "int", default: "10", description: "How often, in seconds, `--watch` checks for changes. The minimum is `5`." },- ]}- examples={[- { title: "Start a dev server with secrets", code: `infisical run -- npm run dev` },- { title: "Use another environment and two folders", code: `infisical run --env=prod --path=/shared --path=/backend -- node server.js` },- { title: "Run in CI with a machine identity", code: `export INFISICAL_TOKEN=<access-token>-infisical run --projectId=<project-id> --env=prod -- npm start` },- { title: "Restart when secrets change", code: `infisical run --watch -- npm run dev` },- ]}->--Inject secrets from Infisical into a process as environment variables. The CLI fetches the secrets for the project linked in [`.infisical.json`](/cli/project-config), 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.--</CLICommand>-<CLICommandid="scan"command="scan"@@ -1312,51 +1095,62 @@ The hook runs `infisical scan git-changes -v --staged` before each commit and bl</CLICommand><CLICommand- id="secrets"- command="secrets"+ id="service-token"+ command="service-token"+>++Manage service tokens. Service tokens are deprecated and will be removed in a future release. Use a [machine identity](/documentation/platform/identities/machine-identities) instead, and log in as it with [infisical login](/cli/reference#login).++</CLICommand>++<CLICommand+ id="service-token-create"+ command="service-token create"usage="[flags]"flags={[- { name: "--env", value: "<string>", type: "string", default: "dev", description: "The environment to list secrets from. Every `infisical secrets` subcommand accepts it. Defaults to the [environment set in `.infisical.json`](/cli/project-config#set-the-environment), then `dev`." },- { name: "--expand", type: "bool", default: "true", description: "Resolve secret references and shell parameter expansions in secret values." },- { name: "--include-imports", type: "bool", default: "true", description: "Include secrets imported into the environment from other environments or folders." },- { name: "--output", short: "-o", value: "<string>", type: "string", description: "Print the secrets as `json`, `yaml`, or `dotenv` instead of a table." },- { name: "--path", value: "<string>", type: "string", default: "/", description: "The folder to list secrets from." },- { name: "--plain", type: "bool", deprecated: true, description: "Deprecated: use `--output` instead. Print only secret values, one per line." },- { name: "--projectId", value: "<string>", type: "string", description: "The project to list secrets from. Required when you authenticate with a machine identity. Can also be set with `INFISICAL_PROJECT_ID`." },- { name: "--recursive", type: "bool", description: "Also list the secrets in every subfolder of `--path`." },- { name: "--secret-overriding", type: "bool", default: "true", description: "Show your personal secrets in place of shared secrets with the same name. Pass `--secret-overriding=false` to show only shared secrets." },- { name: "--tags", short: "-t", value: "<string>", type: "string", description: "Only list secrets with these tag slugs, separated by commas. `infisical secrets get` and `infisical secrets generate-example-env` accept it too." },- { name: "--token", value: "<string>", type: "string", description: "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`." },+ { name: "--access-level", short: "-a", value: "<stringSlice>", type: "stringSlice", required: true, description: "What the token can do: `read`, `write`, or both. Repeat the flag or separate the values with commas." },+ { name: "--expiry-seconds", short: "-e", value: "<int>", type: "int", default: "86400", description: "How long the token lasts, in seconds from now. Pass `0` for a token that never expires." },+ { name: "--name", short: "-n", value: "<string>", type: "string", default: "Service token generated via CLI", description: "The token's name." },+ { name: "--projectId", value: "<string>", type: "string", description: "The project to create the token for. Without it, the CLI uses the project in `.infisical.json`. Can also be set with `INFISICAL_PROJECT_ID`." },+ { name: "--scope", short: "-s", value: "<stringSlice>", type: "stringSlice", required: true, description: "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." },+ { name: "--token-only", type: "bool", description: "Print only the token, to standard output, with no other details." },]}examples={[- { title: "List secrets in dev", code: `infisical secrets` },- { title: "List every secret in a folder tree", code: `infisical secrets --env=staging --path=/ --recursive` },- { title: "Print production secrets as JSON", code: `infisical secrets --env=prod --output=json` },+ { title: "Create a read-only token for two folders", code: "infisical service-token create --scope=dev:/global --scope=dev:/backend --access-level=read" },+ { title: "Create a read and write token that never expires", code: "infisical service-token create --scope='prod:/**' --access-level=read,write --expiry-seconds=0" },+ { title: "Capture the token in a variable", code: "TOKEN=$(infisical service-token create --scope=dev:/ --access-level=read --token-only)" },]}>-Print the secrets in an environment and folder as a table. Pass `--output` to print them as JSON, YAML, or dotenv instead.+Create a service token for a project with your user login. Service tokens are deprecated; create a [machine identity](/documentation/platform/identities/machine-identities) 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.</CLICommand><CLICommand- id="secrets-agent-proxy"- command="secrets agent-proxy"- inheritedFlags={[- { name: "--env", value: "<string>", type: "string", default: "dev", description: "Has no effect on `agent-proxy` commands. `connect` and `run` take their own `--env`." },- { name: "--tags", short: "-t", value: "<string>", type: "string", description: "Has no effect on `agent-proxy` commands." },- ]}+ id="sm"+ command="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](/documentation/platform/dynamic-secrets/overview), and run the [Agent Proxy](/documentation/platform/agent-proxy/overview).++</CLICommand>++<CLICommand+ id="sm-agent-proxy"+ command="sm agent-proxy">Run the [Infisical Agent Proxy](/documentation/platform/agent-proxy/overview), 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 secrets agent-proxy run](/cli/reference#secrets-agent-proxy-run) starts a proxy and a sandboxed agent together. For a proxy shared across your network, run [infisical secrets agent-proxy start](/cli/reference#secrets-agent-proxy-start) on its own host, and launch agents behind it with [infisical secrets agent-proxy connect](/cli/reference#secrets-agent-proxy-connect).+For an agent on your own computer, [infisical sm agent-proxy run](/cli/reference#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](/cli/reference#sm-agent-proxy-start) on its own host, and launch agents behind it with [infisical sm agent-proxy connect](/cli/reference#sm-agent-proxy-connect).</CLICommand><CLICommand- id="secrets-agent-proxy-connect"- command="secrets agent-proxy connect"+ id="sm-agent-proxy-connect"+ command="sm agent-proxy connect"usage="[flags] -- <command>"args={[{ name: "command", usage: "<command>", required: true, description: "The agent's command, after `--`. Everything after `--` is passed to it unchanged." },@@ -1373,13 +1167,13 @@ For an agent on your own computer, [infisical secrets agent-proxy run](/cli/refe{ name: "--token", value: "<string>", type: "string", description: "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={[- { title: "Launch an agent behind a proxy", code: "infisical secrets agent-proxy connect --proxy=<proxy-host>:17322 --projectId=<project-id> --env=prod --path=/ai-agents -- claude" },- { title: "Read the settings from environment variables", code: "export INFISICAL_AGENT_PROXY_ADDRESS=<proxy-host>:17322\nexport INFISICAL_PROJECT_ID=<project-id>\nexport INFISICAL_ENVIRONMENT=prod\ninfisical secrets agent-proxy connect -- claude" },- { title: "Authenticate as a machine identity", code: "infisical secrets agent-proxy connect \\\n --proxy=<proxy-host>:17322 \\\n --env=prod \\\n --client-id=<client-id> \\\n --client-secret=<client-secret> \\\n -- codex" },+ { title: "Launch an agent behind a proxy", code: "infisical sm agent-proxy connect --proxy=<proxy-host>:17322 --projectId=<project-id> --env=prod --path=/ai-agents -- claude" },+ { title: "Read the settings from environment variables", code: "export INFISICAL_AGENT_PROXY_ADDRESS=<proxy-host>:17322\nexport INFISICAL_PROJECT_ID=<project-id>\nexport INFISICAL_ENVIRONMENT=prod\ninfisical sm agent-proxy connect -- claude" },+ { title: "Authenticate as a machine identity", code: "infisical sm agent-proxy connect \\\n --proxy=<proxy-host>:17322 \\\n --env=prod \\\n --client-id=<client-id> \\\n --client-secret=<client-secret> \\\n -- codex" },]}>-Launch an agent that sends its requests through an agent proxy on another host, started with [infisical secrets agent-proxy start](/cli/reference#secrets-agent-proxy-start). See [Standalone Agent Proxy](/documentation/platform/agent-proxy/standalone-agent-proxy).+Launch an agent that sends its requests through an agent proxy on another host, started with [infisical sm agent-proxy start](/cli/reference#sm-agent-proxy-start). See [Standalone Agent Proxy](/documentation/platform/agent-proxy/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](/documentation/platform/agent-proxy/standalone-agent-proxy#what-connect-puts-in-the-agents-environment).@@ -1390,8 +1184,8 @@ The command exits with the agent's exit code.</CLICommand><CLICommand- id="secrets-agent-proxy-run"- command="secrets agent-proxy run"+ id="sm-agent-proxy-run"+ command="sm agent-proxy run"usage="[flags] -- <command>"args={[{ name: "command", usage: "<command>", required: true, description: "The agent's command, after `--`. Everything after `--` is passed to it unchanged." },@@ -1413,10 +1207,10 @@ The command exits with the agent's exit code.{ name: "--unmatched-host", value: "<string>", type: "string", default: "allow", description: "What to do with requests to a host that has no proxied service: `allow` forwards them with no credential, and `block` rejects them." },]}examples={[- { title: "Run an agent in the sandbox", code: "infisical secrets agent-proxy run --projectId=<project-id> --env=dev --path=/coding-agent -- claude" },- { title: "Read the project and environment from .infisical.json", code: "infisical secrets agent-proxy run -- claude" },- { title: "Allow only proxied services and one registry", code: "infisical secrets agent-proxy run --env=dev --unmatched-host=block --allow-host=registry.npmjs.org -- claude" },- { title: "Keep a log of proxied requests", code: "infisical secrets agent-proxy run --env=dev --log-file=/tmp/agent-proxy.log -- claude" },+ { title: "Run an agent in the sandbox", code: "infisical sm agent-proxy run --projectId=<project-id> --env=dev --path=/coding-agent -- claude" },+ { title: "Read the project and environment from .infisical.json", code: "infisical sm agent-proxy run -- claude" },+ { title: "Allow only proxied services and one registry", code: "infisical sm agent-proxy run --env=dev --unmatched-host=block --allow-host=registry.npmjs.org -- claude" },+ { title: "Keep a log of proxied requests", code: "infisical sm agent-proxy run --env=dev --log-file=/tmp/agent-proxy.log -- claude" },]}>@@ -1426,13 +1220,13 @@ The [sandbox](/documentation/platform/agent-proxy/local-agent-proxy#the-sandbox)The agent never gets real secret values or an Infisical token. It gets placeholder values for [proxied services](/documentation/platform/agent-proxy/proxied-services) that substitute credentials into requests. The command [removes variables that look like credentials](/documentation/platform/agent-proxy/local-agent-proxy#environment-scrubbed) 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 secrets agent-proxy connect](/cli/reference#secrets-agent-proxy-connect).+The command always starts its own proxy. To use a proxy on another host, run [infisical sm agent-proxy connect](/cli/reference#sm-agent-proxy-connect).</CLICommand><CLICommand- id="secrets-agent-proxy-start"- command="secrets agent-proxy start"+ id="sm-agent-proxy-start"+ command="sm agent-proxy start"usage="[flags]"flags={[{ name: "--client-id", value: "<string>", type: "string", required: true, description: "The client ID of the proxy's machine identity. Can also be set with `INFISICAL_UNIVERSAL_AUTH_CLIENT_ID`." },@@ -1444,28 +1238,274 @@ The command always starts its own proxy. To use a proxy on another host, run [in{ name: "--unmatched-host", value: "<string>", type: "string", default: "allow", description: "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={[- { title: "Start the proxy", code: "infisical secrets agent-proxy start --client-id=<client-id> --client-secret=<client-secret>" },- { title: "Block hosts with no proxied service", code: "infisical secrets agent-proxy start --port=17322 --unmatched-host=block" },- { title: "Log JSON to a file", code: "infisical secrets agent-proxy start --log-format=json --log-file=/var/log/infisical/agent-proxy.log" },+ { title: "Start the proxy", code: "infisical sm agent-proxy start --client-id=<client-id> --client-secret=<client-secret>" },+ { title: "Block hosts with no proxied service", code: "infisical sm agent-proxy start --port=17322 --unmatched-host=block" },+ { title: "Log JSON to a file", code: "infisical sm agent-proxy start --log-format=json --log-file=/var/log/infisical/agent-proxy.log" },]}>-Start an agent proxy in the foreground, for agents on other hosts to connect to with [infisical secrets agent-proxy connect](/cli/reference#secrets-agent-proxy-connect). See [Standalone Agent Proxy](/documentation/platform/agent-proxy/standalone-agent-proxy).+Start an agent proxy in the foreground, for agents on other hosts to connect to with [infisical sm agent-proxy connect](/cli/reference#sm-agent-proxy-connect). See [Standalone Agent Proxy](/documentation/platform/agent-proxy/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`.</CLICommand><CLICommand- id="secrets-delete"- command="secrets delete"+ id="sm-dynamic-secrets"+ command="sm dynamic-secrets"+ usage="[flags]"+ flags={[+ { name: "--env", value: "<string>", type: "string", default: "dev", description: "The environment to work in. Every `infisical sm dynamic-secrets` subcommand accepts it. Defaults to `INFISICAL_ENVIRONMENT`, then the [default environment](/cli/project-config#set-the-environment) in `.infisical.json`, then `dev`." },+ { name: "--output", short: "-o", value: "<string>", type: "string", description: "Print the dynamic secrets as `json`, `yaml`, or `dotenv` instead of a table." },+ { name: "--path", value: "<string>", type: "string", default: "/", description: "The folder to list dynamic secrets from. Defaults to `INFISICAL_SECRET_PATH`, then the [default folder](/cli/project-config#set-the-folder) in `.infisical.json`, then `/`." },+ { name: "--project-slug", value: "<string>", type: "string", description: "The slug of the project to list dynamic secrets from. Takes precedence over `--projectId`." },+ { name: "--projectId", value: "<string>", type: "string", description: "The ID of the project to list dynamic secrets from. Without it or `--project-slug`, the CLI uses the project in `.infisical.json`. Can also be set with `INFISICAL_PROJECT_ID`." },+ { name: "--token", value: "<string>", type: "string", description: "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={[+ { title: "List dynamic secrets in dev", code: "infisical sm dynamic-secrets" },+ { title: "List dynamic secrets in a production folder", code: "infisical sm dynamic-secrets --env=prod --path=/databases" },+ { title: "Print dynamic secrets as JSON", code: "infisical sm dynamic-secrets --projectId=<project-id> --output=json" },+ ]}+>++List the [dynamic secrets](/documentation/platform/dynamic-secrets/overview) 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](/cli/reference#sm-dynamic-secrets-lease).++</CLICommand>++<CLICommand+ id="sm-dynamic-secrets-lease"+ command="sm dynamic-secrets lease"+ inheritedFlags={[+ { name: "--env", value: "<string>", type: "string", default: "dev", description: "The environment that holds the dynamic secret." },+ ]}+>++Create, list, renew, and delete the leases of a dynamic secret.++</CLICommand>++<CLICommand+ id="sm-dynamic-secrets-lease-create"+ command="sm dynamic-secrets lease create"+ usage="<name> [flags]"+ args={[+ { name: "name", usage: "<name>", required: true, description: "The name of the dynamic secret to lease." },+ ]}+ flags={[+ { name: "--kubernetes-namespace", value: "<string>", type: "string", description: "The namespace to create the lease in. Used only by Kubernetes dynamic secrets." },+ { name: "--output", short: "-o", value: "<string>", type: "string", description: "Print only the credentials, as `json`, `yaml`, or `dotenv`, instead of the lease details and a table." },+ { name: "--path", short: "-p", value: "<string>", type: "string", default: "/", description: "The folder that holds the dynamic secret. Defaults to `INFISICAL_SECRET_PATH`, then the [default folder](/cli/project-config#set-the-folder) in `.infisical.json`, then `/`." },+ { name: "--plain", type: "bool", description: "Print each credential as `KEY=value`, one per line, with no other output. Ignored when you pass `--output`." },+ { name: "--principals", value: "<string>", type: "string", description: "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." },+ { name: "--project-slug", value: "<string>", type: "string", description: "The slug of the project that holds the dynamic secret. Takes precedence over `--projectId`." },+ { name: "--projectId", value: "<string>", type: "string", description: "The ID of the project that holds the dynamic secret. Without it or `--project-slug`, the CLI uses the project in `.infisical.json`. Can also be set with `INFISICAL_PROJECT_ID`." },+ { name: "--token", value: "<string>", type: "string", description: "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`." },+ { name: "--ttl", value: "<string>", type: "string", description: "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." },+ ]}+ inheritedFlags={[+ { name: "--env", value: "<string>", type: "string", default: "dev", description: "The environment that holds the dynamic secret." },+ ]}+ examples={[+ { title: "Lease database credentials for an hour", code: "infisical sm dynamic-secrets lease create postgres-app --env=prod --ttl=1h" },+ { title: "Lease credentials as JSON", code: "infisical sm dynamic-secrets lease create postgres-app --output=json" },+ { title: "Lease an SSH certificate", code: "infisical sm dynamic-secrets lease create ssh-prod \\\n --projectId=<project-id> \\\n --env=prod \\\n --principals=root,deploy" },+ ]}+>++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](/cli/reference#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.++</CLICommand>++<CLICommand+ id="sm-dynamic-secrets-lease-delete"+ command="sm dynamic-secrets lease delete"+ usage="<lease-id> [flags]"+ args={[+ { name: "lease-id", usage: "<lease-id>", required: true, description: "The ID of the lease to delete." },+ ]}+ flags={[+ { name: "--output", short: "-o", value: "<string>", type: "string", description: "Print the deleted lease as `json`, `yaml`, or `dotenv` instead of a table." },+ { name: "--path", short: "-p", value: "<string>", type: "string", default: "/", description: "The folder that holds the lease's dynamic secret. Defaults to `INFISICAL_SECRET_PATH`, then the [default folder](/cli/project-config#set-the-folder) in `.infisical.json`, then `/`." },+ { name: "--project-slug", value: "<string>", type: "string", description: "The slug of the project that holds the lease. Takes precedence over `--projectId`." },+ { name: "--projectId", value: "<string>", type: "string", description: "The ID of the project that holds the lease. Without it or `--project-slug`, the CLI uses the project in `.infisical.json`. Can also be set with `INFISICAL_PROJECT_ID`." },+ { name: "--token", value: "<string>", type: "string", description: "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`." },+ ]}+ inheritedFlags={[+ { name: "--env", value: "<string>", type: "string", default: "dev", description: "The environment that holds the lease's dynamic secret." },+ ]}+ examples={[+ { title: "Delete a lease", code: "infisical sm dynamic-secrets lease delete <lease-id> --env=prod" },+ ]}+>++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.++</CLICommand>++<CLICommand+ id="sm-dynamic-secrets-lease-list"+ command="sm dynamic-secrets lease list"+ usage="<name> [flags]"+ args={[+ { name: "name", usage: "<name>", required: true, description: "The name of the dynamic secret to list leases for." },+ ]}+ flags={[+ { name: "--output", short: "-o", value: "<string>", type: "string", description: "Print the leases as `json`, `yaml`, or `dotenv` instead of a table." },+ { name: "--path", short: "-p", value: "<string>", type: "string", default: "/", description: "The folder that holds the dynamic secret. Defaults to `INFISICAL_SECRET_PATH`, then the [default folder](/cli/project-config#set-the-folder) in `.infisical.json`, then `/`." },+ { name: "--project-slug", value: "<string>", type: "string", description: "The slug of the project that holds the dynamic secret. Takes precedence over `--projectId`." },+ { name: "--projectId", value: "<string>", type: "string", description: "The ID of the project that holds the dynamic secret. Without it or `--project-slug`, the CLI uses the project in `.infisical.json`. Can also be set with `INFISICAL_PROJECT_ID`." },+ { name: "--token", value: "<string>", type: "string", description: "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`." },+ ]}+ inheritedFlags={[+ { name: "--env", value: "<string>", type: "string", default: "dev", description: "The environment that holds the dynamic secret." },+ ]}+ examples={[+ { title: "List a dynamic secret's leases", code: "infisical sm dynamic-secrets lease list postgres-app --env=prod" },+ ]}+>++List the active leases of a dynamic secret, with each lease's ID, expiry time, and creation time.++</CLICommand>++<CLICommand+ id="sm-dynamic-secrets-lease-renew"+ command="sm dynamic-secrets lease renew"+ usage="<lease-id> [flags]"+ args={[+ { name: "lease-id", usage: "<lease-id>", required: true, description: "The ID of the lease to renew." },+ ]}+ flags={[+ { name: "--output", short: "-o", value: "<string>", type: "string", description: "Print the renewed lease as `json`, `yaml`, or `dotenv` instead of a table." },+ { name: "--path", short: "-p", value: "<string>", type: "string", default: "/", description: "The folder that holds the lease's dynamic secret. Defaults to `INFISICAL_SECRET_PATH`, then the [default folder](/cli/project-config#set-the-folder) in `.infisical.json`, then `/`." },+ { name: "--project-slug", value: "<string>", type: "string", description: "The slug of the project that holds the lease. Takes precedence over `--projectId`." },+ { name: "--projectId", value: "<string>", type: "string", description: "The ID of the project that holds the lease. Without it or `--project-slug`, the CLI uses the project in `.infisical.json`. Can also be set with `INFISICAL_PROJECT_ID`." },+ { name: "--token", value: "<string>", type: "string", description: "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`." },+ { name: "--ttl", value: "<string>", type: "string", description: "How long to extend the lease by, from its current expiry, such as `30m` or `1h`. Defaults to the dynamic secret's default TTL." },+ ]}+ inheritedFlags={[+ { name: "--env", value: "<string>", type: "string", default: "dev", description: "The environment that holds the lease's dynamic secret." },+ ]}+ examples={[+ { title: "Extend a lease by 30 minutes", code: "infisical sm dynamic-secrets lease renew <lease-id> --env=prod --ttl=30m" },+ ]}+>++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.++</CLICommand>++<CLICommand+ id="sm-export"+ command="sm export"+ usage="[flags]"+ flags={[+ { name: "--env", short: "-e", value: "<string>", type: "string", default: "dev", description: "The environment to export secrets from, such as `dev`, `staging`, or `prod`. Defaults to `INFISICAL_ENVIRONMENT`, then the [default environment](/cli/project-config#set-the-environment) in `.infisical.json`, then `dev`." },+ { name: "--expand", type: "bool", default: "true", description: "Resolve secret references and shell parameter expansions in secret values. Pass `--expand=false` to export values exactly as stored." },+ { name: "--format", short: "-f", value: "<string>", type: "string", default: "dotenv", description: "The output format: `dotenv`, `dotenv-export`, `dotenv-eval`, `csv`, `json`, or `yaml`." },+ { name: "--include-imports", type: "bool", default: "true", description: "Include secrets imported into the environment from other environments or folders." },+ { name: "--output-file", short: "-o", value: "<string>", type: "string", description: "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." },+ { name: "--path", value: "<string>", type: "string", default: "/", description: "The folder to export secrets from. Defaults to `INFISICAL_SECRET_PATH`, then the [default folder](/cli/project-config#set-the-folder) in `.infisical.json`, then `/`." },+ { name: "--projectId", value: "<string>", type: "string", description: "The project to export secrets from. Required when you authenticate with a machine identity. Can also be set with `INFISICAL_PROJECT_ID`." },+ { name: "--secret-overriding", type: "bool", default: "true", description: "Export your personal secrets in place of shared secrets with the same name. Pass `--secret-overriding=false` to export only shared secrets." },+ { name: "--tags", short: "-t", value: "<string>", type: "string", description: "Only export secrets with these tag slugs, separated by commas." },+ { name: "--template", value: "<string>", type: "string", description: "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." },+ { name: "--token", value: "<string>", type: "string", description: "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={[+ { title: "Write a .env file", code: "infisical sm export --output-file=./.env" },+ { title: "Export production secrets as JSON", code: "infisical sm export --env=prod --format=json > secrets.json" },+ { title: "Load secrets into the current shell", code: "eval \"$(infisical sm export --format=dotenv-eval)\"" },+ { title: "Render secrets through a template", code: "infisical sm export --template=./secrets.tmpl" },+ ]}+>++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](/integrations/platforms/infisical-agent#available-secret-template-functions) provides, such as `listSecrets` and `getSecretByName`.++</CLICommand>++<CLICommand+ id="sm-run"+ command="sm run"+ usage="[flags] -- [command]"+ args={[+ { name: "command", usage: "[command]", description: "The command to run, after `--`. Everything after `--` is passed to it unchanged. Required unless you pass `--command`." },+ ]}+ flags={[+ { name: "--command", short: "-c", value: "<string>", type: "string", description: "A shell command to run instead of the arguments after `--`, such as `\"npm run build && npm start\"`. Use it to chain several commands." },+ { name: "--env", short: "-e", value: "<string>", type: "string", default: "dev", description: "The environment to fetch secrets from, such as `dev`, `staging`, or `prod`. Defaults to `INFISICAL_ENVIRONMENT`, then the [default environment](/cli/project-config#set-the-environment) in `.infisical.json`, then `dev`." },+ { name: "--expand", type: "bool", default: "true", description: "Resolve secret references and shell parameter expansions in secret values before injecting them. Pass `--expand=false` to inject values exactly as stored." },+ { name: "--include-imports", type: "bool", default: "true", description: "Include secrets imported into the environment from other environments or folders." },+ { name: "--path", value: "<stringArray>", type: "stringArray", default: "/", description: "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](/cli/project-config#set-the-folder) in `.infisical.json`, then `/`." },+ { name: "--project-config-dir", value: "<string>", type: "string", description: "The directory that contains `.infisical.json`. Use it when the file isn't in the directory you run the command from, such as in a monorepo." },+ { name: "--projectId", value: "<string>", type: "string", description: "The project to fetch secrets from. Required when you authenticate with a machine identity. Can also be set with `INFISICAL_PROJECT_ID`." },+ { name: "--recursive", type: "bool", description: "Also inject the secrets in every subfolder of each `--path`." },+ { name: "--secret-overriding", type: "bool", default: "true", description: "Use your personal secrets in place of shared secrets with the same name. Pass `--secret-overriding=false` to use only shared secrets." },+ { name: "--tags", short: "-t", value: "<string>", type: "string", description: "Only inject secrets with these tag slugs, separated by commas." },+ { name: "--token", value: "<string>", type: "string", description: "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`." },+ { name: "--watch", type: "bool", description: "Restart the command whenever secrets change in Infisical. Intended for local development." },+ { name: "--watch-interval", value: "<int>", type: "int", default: "10", description: "How often, in seconds, `--watch` checks for changes. The minimum is `5`." },+ ]}+ examples={[+ { title: "Start a dev server with secrets", code: `infisical sm run -- npm run dev` },+ { title: "Use another environment and two folders", code: `infisical sm run --env=prod --path=/shared --path=/backend -- node server.js` },+ { title: "Run in CI with a machine identity", code: `export INFISICAL_TOKEN=<access-token>+infisical sm run --projectId=<project-id> --env=prod -- npm start` },+ { title: "Restart when secrets change", code: `infisical sm run --watch -- npm run dev` },+ ]}+>++Inject secrets from Infisical into a process as environment variables. The CLI fetches the secrets for the project linked in [`.infisical.json`](/cli/project-config), 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.++</CLICommand>++<CLICommand+ id="sm-secrets"+ command="sm secrets"+ usage="[flags]"+ flags={[+ { name: "--env", value: "<string>", type: "string", default: "dev", description: "The environment to list secrets from. Every `infisical sm secrets` subcommand accepts it. Defaults to `INFISICAL_ENVIRONMENT`, then the [default environment](/cli/project-config#set-the-environment) in `.infisical.json`, then `dev`." },+ { name: "--expand", type: "bool", default: "true", description: "Resolve secret references and shell parameter expansions in secret values." },+ { name: "--include-imports", type: "bool", default: "true", description: "Include secrets imported into the environment from other environments or folders." },+ { name: "--output", short: "-o", value: "<string>", type: "string", description: "Print the secrets as `json`, `yaml`, or `dotenv` instead of a table." },+ { name: "--path", value: "<string>", type: "string", default: "/", description: "The folder to list secrets from. Defaults to `INFISICAL_SECRET_PATH`, then the [default folder](/cli/project-config#set-the-folder) in `.infisical.json`, then `/`." },+ { name: "--plain", type: "bool", deprecated: true, description: "Deprecated: use `--output` instead. Print only secret values, one per line." },+ { name: "--projectId", value: "<string>", type: "string", description: "The project to list secrets from. Required when you authenticate with a machine identity. Can also be set with `INFISICAL_PROJECT_ID`." },+ { name: "--recursive", type: "bool", description: "Also list the secrets in every subfolder of `--path`." },+ { name: "--secret-overriding", type: "bool", default: "true", description: "Show your personal secrets in place of shared secrets with the same name. Pass `--secret-overriding=false` to show only shared secrets." },+ { name: "--tags", short: "-t", value: "<string>", type: "string", description: "Only list secrets with these tag slugs, separated by commas. `infisical sm secrets get` and `infisical sm secrets generate-example-env` accept it too." },+ { name: "--token", value: "<string>", type: "string", description: "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={[+ { title: "List secrets in dev", code: `infisical sm secrets` },+ { title: "List every secret in a folder tree", code: `infisical sm secrets --env=staging --path=/ --recursive` },+ { title: "Print production secrets as JSON", code: `infisical sm secrets --env=prod --output=json` },+ ]}+>++Print the secrets in an environment and folder as a table. Pass `--output` to print them as JSON, YAML, or dotenv instead.++</CLICommand>++<CLICommand+ id="sm-secrets-delete"+ command="sm secrets delete"usage="<name>... [flags]"args={[{ name: "name", usage: "<name>...", required: true, repeatable: true, description: "The names of the secrets to delete." },]}flags={[{ name: "--output", short: "-o", value: "<string>", type: "string", description: "Print the result as `json`, `yaml`, or `dotenv` instead of a table." },- { name: "--path", value: "<string>", type: "string", default: "/", description: "The folder to delete from." },+ { name: "--path", value: "<string>", type: "string", default: "/", description: "The folder to delete from. Defaults to `INFISICAL_SECRET_PATH`, then the [default folder](/cli/project-config#set-the-folder) in `.infisical.json`, then `/`." },{ name: "--projectId", value: "<string>", type: "string", description: "The project to delete from. Required when you authenticate with a machine identity. Can also be set with `INFISICAL_PROJECT_ID`." },{ name: "--token", value: "<string>", type: "string", description: "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`." },{ name: "--type", value: "<string>", type: "string", default: "personal", description: "Which secrets to delete: `personal` or `shared`." },@@ -1474,8 +1514,8 @@ The proxy authenticates as its own machine identity, which needs read access to{ name: "--env", value: "<string>", type: "string", default: "dev", description: "The environment to delete from." },]}examples={[- { title: "Delete two shared secrets", code: `infisical secrets delete STRIPE_API_KEY DOMAIN --type=shared` },- { title: "Remove your personal override of a secret", code: `infisical secrets delete API_URL` },+ { title: "Delete two shared secrets", code: `infisical sm secrets delete STRIPE_API_KEY DOMAIN --type=shared` },+ { title: "Remove your personal override of a secret", code: `infisical sm secrets delete API_URL` },]}>@@ -1486,10 +1526,10 @@ Without `--type`, the command deletes your personal secrets with those names. Pa</CLICommand><CLICommand- id="secrets-folders"- command="secrets folders"+ id="sm-secrets-folders"+ command="sm secrets folders"flags={[- { name: "--env", value: "<string>", type: "string", default: "dev", description: "The environment to work in. Every `infisical secrets folders` subcommand accepts it." },+ { name: "--env", value: "<string>", type: "string", default: "dev", description: "The environment to work in. Every `infisical sm secrets folders` subcommand accepts it. Defaults to `INFISICAL_ENVIRONMENT`, then the [default environment](/cli/project-config#set-the-environment) in `.infisical.json`, then `dev`." },]}inheritedFlags={[{ name: "--tags", short: "-t", value: "<string>", type: "string", description: "Has no effect on folder commands." },@@ -1501,8 +1541,8 @@ Create, delete, and list the folders in an environment. Folders organize an envi</CLICommand><CLICommand- id="secrets-folders-create"- command="secrets folders create"+ id="sm-secrets-folders-create"+ command="sm secrets folders create"usage="[flags]"flags={[{ name: "--name", short: "-n", value: "<string>", type: "string", required: true, description: "The name of the folder to create." },@@ -1515,7 +1555,7 @@ Create, delete, and list the folders in an environment. Folders organize an envi{ name: "--env", value: "<string>", type: "string", default: "dev", description: "The environment to create the folder in." },]}examples={[- { title: "Create a folder", code: `infisical secrets folders create --path=/backend --name=api` },+ { title: "Create a folder", code: `infisical sm secrets folders create --path=/backend --name=api` },]}>@@ -1524,8 +1564,8 @@ Create a folder named `--name` inside `--path`.</CLICommand><CLICommand- id="secrets-folders-delete"- command="secrets folders delete"+ id="sm-secrets-folders-delete"+ command="sm secrets folders delete"usage="[flags]"flags={[{ name: "--name", short: "-n", value: "<string>", type: "string", required: true, description: "The name of the folder to delete." },@@ -1538,7 +1578,7 @@ Create a folder named `--name` inside `--path`.{ name: "--env", value: "<string>", type: "string", default: "dev", description: "The environment to delete the folder from." },]}examples={[- { title: "Delete a folder", code: `infisical secrets folders delete --path=/backend --name=api` },+ { title: "Delete a folder", code: `infisical sm secrets folders delete --path=/backend --name=api` },]}>@@ -1547,8 +1587,8 @@ Delete the folder named `--name` inside `--path`.</CLICommand><CLICommand- id="secrets-folders-get"- command="secrets folders get"+ id="sm-secrets-folders-get"+ command="sm secrets folders get"usage="[flags]"flags={[{ name: "--output", short: "-o", value: "<string>", type: "string", description: "Print the folders as `json`, `yaml`, or `dotenv` instead of a table." },@@ -1560,8 +1600,8 @@ Delete the folder named `--name` inside `--path`.{ name: "--env", value: "<string>", type: "string", default: "dev", description: "The environment to list folders from." },]}examples={[- { title: "List the folders at the root", code: `infisical secrets folders get` },- { title: "List the folders under a path in production", code: `infisical secrets folders get --env=prod --path=/backend` },+ { title: "List the folders at the root", code: `infisical sm secrets folders get` },+ { title: "List the folders under a path in production", code: `infisical sm secrets folders get --env=prod --path=/backend` },]}>@@ -1570,11 +1610,11 @@ List the folders inside `--path`.</CLICommand><CLICommand- id="secrets-generate-example-env"- command="secrets generate-example-env"+ id="sm-secrets-generate-example-env"+ command="sm secrets generate-example-env"usage="[flags]"flags={[- { name: "--path", value: "<string>", type: "string", default: "/", description: "The folder to read secrets from." },+ { name: "--path", value: "<string>", type: "string", default: "/", description: "The folder to read secrets from. Defaults to `INFISICAL_SECRET_PATH`, then the [default folder](/cli/project-config#set-the-folder) in `.infisical.json`, then `/`." },{ name: "--projectId", value: "<string>", type: "string", description: "The project to read secrets from. Required when you authenticate with a machine identity. Can also be set with `INFISICAL_PROJECT_ID`." },{ name: "--token", value: "<string>", type: "string", description: "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`." },]}@@ -1583,7 +1623,7 @@ List the folders inside `--path`.{ name: "--tags", short: "-t", value: "<string>", type: "string", description: "Only include secrets with these tag slugs, separated by commas." },]}examples={[- { title: "Write an example .env file", code: `infisical secrets generate-example-env > .env.example` },+ { title: "Write an example .env file", code: `infisical sm secrets generate-example-env > .env.example` },]}>@@ -1594,8 +1634,8 @@ Each secret's comment in Infisical appears as a comment above it. To give a secr</CLICommand><CLICommand- id="secrets-get"- command="secrets get"+ id="sm-secrets-get"+ command="sm secrets get"usage="<name>... [flags]"args={[{ name: "name", usage: "<name>...", required: true, repeatable: true, description: "The names of the secrets to print." },@@ -1604,7 +1644,7 @@ Each secret's comment in Infisical appears as a comment above it. To give a secr{ name: "--expand", type: "bool", default: "true", description: "Resolve secret references and shell parameter expansions in secret values." },{ name: "--include-imports", type: "bool", default: "true", description: "Also look for the names among secrets imported from other environments or folders." },{ name: "--output", short: "-o", value: "<string>", type: "string", description: "Print the secrets as `json`, `yaml`, or `dotenv` instead of a table." },- { name: "--path", value: "<string>", type: "string", default: "/", description: "The folder to read from." },+ { name: "--path", value: "<string>", type: "string", default: "/", description: "The folder to read from. Defaults to `INFISICAL_SECRET_PATH`, then the [default folder](/cli/project-config#set-the-folder) in `.infisical.json`, then `/`." },{ name: "--plain", type: "bool", description: "Print only the values, one per line." },{ name: "--projectId", value: "<string>", type: "string", description: "The project to read from. Required when you authenticate with a machine identity. Can also be set with `INFISICAL_PROJECT_ID`." },{ name: "--recursive", type: "bool", description: "Also look for the names in every subfolder of `--path`." },@@ -1616,9 +1656,9 @@ Each secret's comment in Infisical appears as a comment above it. To give a secr{ name: "--tags", short: "-t", value: "<string>", type: "string", description: "Only return secrets with these tag slugs, separated by commas." },]}examples={[- { title: "Show two secrets", code: `infisical secrets get DOMAIN PORT` },- { title: "Read a value into a variable", code: `API_KEY=$(infisical secrets get API_KEY --plain --silent)` },- { title: "Print production secrets as JSON", code: `infisical secrets get DB_HOST DB_PASSWORD --env=prod --output=json` },+ { title: "Show two secrets", code: `infisical sm secrets get DOMAIN PORT` },+ { title: "Read a value into a variable", code: `API_KEY=$(infisical sm secrets get API_KEY --plain --silent)` },+ { title: "Print production secrets as JSON", code: `infisical sm secrets get DB_HOST DB_PASSWORD --env=prod --output=json` },]}>@@ -1629,8 +1669,8 @@ In scripts, pass `--plain --silent` to print only the values, with no other outp</CLICommand><CLICommand- id="secrets-set"- command="secrets set"+ id="sm-secrets-set"+ command="sm secrets set"usage="[name=value]... [flags]"args={[{ name: "name=value", usage: "[name=value]...", repeatable: true, description: "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`." },@@ -1638,7 +1678,7 @@ In scripts, pass `--plain --silent` to print only the values, with no other outpflags={[{ name: "--file", value: "<string>", type: "string", description: "A `.env` or YAML file to read secrets from, instead of arguments. Lines starting with `#` or `//` are comments." },{ name: "--output", short: "-o", value: "<string>", type: "string", description: "Print the result as `json`, `yaml`, or `dotenv` instead of a table." },- { name: "--path", value: "<string>", type: "string", default: "/", description: "The folder to write to." },+ { name: "--path", value: "<string>", type: "string", default: "/", description: "The folder to write to. Defaults to `INFISICAL_SECRET_PATH`, then the [default folder](/cli/project-config#set-the-folder) in `.infisical.json`, then `/`." },{ name: "--projectId", value: "<string>", type: "string", description: "The project to write to. Required when you authenticate with a machine identity. Can also be set with `INFISICAL_PROJECT_ID`." },{ name: "--show-values", type: "bool", description: "Show secret values in the result table instead of masking them." },{ name: "--tag", value: "<stringArray>", type: "stringArray", description: "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." },@@ -1650,10 +1690,10 @@ In scripts, pass `--plain --silent` to print only the values, with no other outp{ name: "--tags", short: "-t", value: "<string>", type: "string", description: "Has no effect on this command. Use `--tag` to attach tags." },]}examples={[- { title: "Set two secrets", code: `infisical secrets set DOMAIN=example.com PORT=443` },- { title: "Load a value from a file", code: `infisical secrets set TLS_CERT=@./cert.pem --env=prod` },- { title: "Import a .env file", code: `infisical secrets set --file=./.env` },- { title: "Override a secret only for yourself", code: `infisical secrets set API_URL=http://localhost:3000 --type=personal` },+ { title: "Set two secrets", code: `infisical sm secrets set DOMAIN=example.com PORT=443` },+ { title: "Load a value from a file", code: `infisical sm secrets set TLS_CERT=@./cert.pem --env=prod` },+ { title: "Import a .env file", code: `infisical sm secrets set --file=./.env` },+ { title: "Override a secret only for yourself", code: `infisical sm secrets set API_URL=http://localhost:3000 --type=personal` },]}>@@ -1663,40 +1703,6 @@ Your shell saves the values you pass on the command line in its history file. To</CLICommand>-<CLICommand- id="service-token"- command="service-token"->--Manage service tokens. Service tokens are deprecated and will be removed in a future release. Use a [machine identity](/documentation/platform/identities/machine-identities) instead, and log in as it with [infisical login](/cli/reference#login).--</CLICommand>--<CLICommand- id="service-token-create"- command="service-token create"- usage="[flags]"- flags={[- { name: "--access-level", short: "-a", value: "<stringSlice>", type: "stringSlice", required: true, description: "What the token can do: `read`, `write`, or both. Repeat the flag or separate the values with commas." },- { name: "--expiry-seconds", short: "-e", value: "<int>", type: "int", default: "86400", description: "How long the token lasts, in seconds from now. Pass `0` for a token that never expires." },- { name: "--name", short: "-n", value: "<string>", type: "string", default: "Service token generated via CLI", description: "The token's name." },- { name: "--projectId", value: "<string>", type: "string", description: "The project to create the token for. Without it, the CLI uses the project in `.infisical.json`. Can also be set with `INFISICAL_PROJECT_ID`." },- { name: "--scope", short: "-s", value: "<stringSlice>", type: "stringSlice", required: true, description: "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." },- { name: "--token-only", type: "bool", description: "Print only the token, to standard output, with no other details." },- ]}- examples={[- { title: "Create a read-only token for two folders", code: "infisical service-token create --scope=dev:/global --scope=dev:/backend --access-level=read" },- { title: "Create a read and write token that never expires", code: "infisical service-token create --scope='prod:/**' --access-level=read,write --expiry-seconds=0" },- { title: "Capture the token in a variable", code: "TOKEN=$(infisical service-token create --scope=dev:/ --access-level=read --token-only)" },- ]}->--Create a service token for a project with your user login. Service tokens are deprecated; create a [machine identity](/documentation/platform/identities/machine-identities) 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.--</CLICommand>-<CLICommandid="ssh"command="ssh"diff --git a/docs/cli/reference/dynamic-secrets.mdx b/docs/cli/reference/dynamic-secrets.mdxdeleted file mode 100644index b883b885b7..0000000000--- a/docs/cli/reference/dynamic-secrets.mdx+++ /dev/null@@ -1,4 +0,0 @@-----title: "infisical dynamic-secrets"-url: "/cli/reference#dynamic-secrets"----diff --git a/docs/cli/reference/export.mdx b/docs/cli/reference/export.mdxdeleted file mode 100644index 8bbe7a63de..0000000000--- a/docs/cli/reference/export.mdx+++ /dev/null@@ -1,4 +0,0 @@-----title: "infisical export"-url: "/cli/reference#export"----diff --git a/docs/cli/reference/run.mdx b/docs/cli/reference/run.mdxdeleted file mode 100644index 1c29bfb319..0000000000--- a/docs/cli/reference/run.mdx+++ /dev/null@@ -1,4 +0,0 @@-----title: "infisical run"-url: "/cli/reference#run"----diff --git a/docs/cli/reference/secrets.mdx b/docs/cli/reference/secrets.mdxdeleted file mode 100644index 3b7874f2ef..0000000000--- a/docs/cli/reference/secrets.mdx+++ /dev/null@@ -1,4 +0,0 @@-----title: "infisical secrets"-url: "/cli/reference#secrets"----diff --git a/docs/cli/reference/sm.mdx b/docs/cli/reference/sm.mdxnew file mode 100644index 0000000000..169f6a38bf--- /dev/null+++ b/docs/cli/reference/sm.mdx@@ -0,0 +1,5 @@+---+title: "infisical sm"+sidebarTitle: "Overview"+url: "/cli/reference#sm"+---diff --git a/docs/cli/reference/sm/agent-proxy.mdx b/docs/cli/reference/sm/agent-proxy.mdxnew file mode 100644index 0000000000..fd4acad488--- /dev/null+++ b/docs/cli/reference/sm/agent-proxy.mdx@@ -0,0 +1,5 @@+---+title: "infisical sm agent-proxy"+sidebarTitle: "agent-proxy"+url: "/cli/reference#sm-agent-proxy"+---diff --git a/docs/cli/reference/sm/dynamic-secrets.mdx b/docs/cli/reference/sm/dynamic-secrets.mdxnew file mode 100644index 0000000000..0dbad49fb4--- /dev/null+++ b/docs/cli/reference/sm/dynamic-secrets.mdx@@ -0,0 +1,5 @@+---+title: "infisical sm dynamic-secrets"+sidebarTitle: "dynamic-secrets"+url: "/cli/reference#sm-dynamic-secrets"+---diff --git a/docs/cli/reference/sm/export.mdx b/docs/cli/reference/sm/export.mdxnew file mode 100644index 0000000000..532cb804ed--- /dev/null+++ b/docs/cli/reference/sm/export.mdx@@ -0,0 +1,5 @@+---+title: "infisical sm export"+sidebarTitle: "export"+url: "/cli/reference#sm-export"+---diff --git a/docs/cli/reference/sm/run.mdx b/docs/cli/reference/sm/run.mdxnew file mode 100644index 0000000000..3b2dbd30d6--- /dev/null+++ b/docs/cli/reference/sm/run.mdx@@ -0,0 +1,5 @@+---+title: "infisical sm run"+sidebarTitle: "run"+url: "/cli/reference#sm-run"+---diff --git a/docs/cli/reference/sm/secrets.mdx b/docs/cli/reference/sm/secrets.mdxnew file mode 100644index 0000000000..96e8bde3a8--- /dev/null+++ b/docs/cli/reference/sm/secrets.mdx@@ -0,0 +1,5 @@+---+title: "infisical sm secrets"+sidebarTitle: "secrets"+url: "/cli/reference#sm-secrets"+---diff --git a/docs/docs.json b/docs/docs.jsonindex 32f1751064..1dfbeecf7f 100644--- a/docs/docs.json+++ b/docs/docs.json@@ -1302,8 +1302,6 @@"cli/reference/agent-vault","cli/reference/bootstrap","cli/reference/cert-manager",- "cli/reference/dynamic-secrets",- "cli/reference/export","cli/reference/gateway","cli/reference/init","cli/reference/kmip",@@ -1315,10 +1313,20 @@"cli/reference/proxy","cli/reference/relay","cli/reference/reset",- "cli/reference/run","cli/reference/scan",- "cli/reference/secrets","cli/reference/service-token",+ {+ "group": "infisical sm",+ "expanded": true,+ "pages": [+ "cli/reference/sm",+ "cli/reference/sm/agent-proxy",+ "cli/reference/sm/dynamic-secrets",+ "cli/reference/sm/export",+ "cli/reference/sm/run",+ "cli/reference/sm/secrets"+ ]+ },"cli/reference/ssh","cli/reference/token","cli/reference/user",@@ -4869,9 +4877,25 @@"source": "/cli/commands/commands","destination": "/cli/reference"},+ {+ "source": "/cli/reference/dynamic-secrets",+ "destination": "/cli/reference#sm-dynamic-secrets"+ },+ {+ "source": "/cli/reference/export",+ "destination": "/cli/reference#sm-export"+ },+ {+ "source": "/cli/reference/run",+ "destination": "/cli/reference#sm-run"+ },+ {+ "source": "/cli/reference/secrets",+ "destination": "/cli/reference#sm-secrets"+ },{"source": "/cli/commands/agent-proxy",- "destination": "/cli/reference#secrets-agent-proxy"+ "destination": "/cli/reference#sm-agent-proxy"},{"source": "/cli/commands/agent-vault",@@ -4883,11 +4907,11 @@},{"source": "/cli/commands/dynamic-secrets",- "destination": "/cli/reference#dynamic-secrets"+ "destination": "/cli/reference#sm-dynamic-secrets"},{"source": "/cli/commands/export",- "destination": "/cli/reference#export"+ "destination": "/cli/reference#sm-export"},{"source": "/cli/commands/gateway",@@ -4935,7 +4959,7 @@},{"source": "/cli/commands/run",- "destination": "/cli/reference#run"+ "destination": "/cli/reference#sm-run"},{"source": "/cli/commands/scan-git-changes",@@ -4951,7 +4975,7 @@},{"source": "/cli/commands/secrets",- "destination": "/cli/reference#secrets"+ "destination": "/cli/reference#sm-secrets"},{"source": "/cli/commands/service-token",diff --git a/docs/documentation/getting-started/cli.mdx b/docs/documentation/getting-started/cli.mdxindex 4a56b02067..76a39c5349 100644--- a/docs/documentation/getting-started/cli.mdx+++ b/docs/documentation/getting-started/cli.mdx@@ -109,15 +109,15 @@ infisical init## Start your app with environment variables injected```console-infisical run -- <your_application_start_command>+infisical sm run -- <your_application_start_command>```## Example start commands```console-infisical run -- npm run dev-infisical run -- flask run-infisical run -- ./your_bash_script.sh+infisical sm run -- npm run dev+infisical sm run -- flask run+infisical sm run -- ./your_bash_script.sh```Your app should now be running with the secrets from Infisical injected as environment variables.diff --git a/docs/documentation/getting-started/docker.mdx b/docs/documentation/getting-started/docker.mdxindex 9a366ac4fd..480f612248 100644--- a/docs/documentation/getting-started/docker.mdx+++ b/docs/documentation/getting-started/docker.mdx@@ -46,7 +46,7 @@ Prerequisites:Next, modify the start command of your Dockerfile:```dockerfile- CMD ["infisical", "run", "--", "[your service start command]"]+ CMD ["infisical", "sm", "run", "--", "[your service start command]"]```## Launch@@ -80,7 +80,7 @@ Prerequisites:WORKDIR /app# Modify the start command of your Dockerfile- CMD ["infisical", "run", "--", "npm run start"]+ CMD ["infisical", "sm", "run", "--", "npm run start"]```</Tab>@@ -118,7 +118,7 @@ Prerequisites:Next, modify the start commands of your Dockerfiles:```dockerfile- CMD ["infisical", "run", "--", "[your service start command]"]+ CMD ["infisical", "sm", "run", "--", "[your service start command]"]```## Example Dockerfile@@ -142,7 +142,7 @@ Prerequisites:WORKDIR /app# Modify the start command of your Dockerfile- CMD ["infisical", "run", "--", "[your service start command]"]+ CMD ["infisical", "sm", "run", "--", "[your service start command]"]```## Docker Compose file modificationdiff --git a/docs/documentation/getting-started/overview.mdx b/docs/documentation/getting-started/overview.mdxindex 6743111f89..e1bb38a4d6 100644--- a/docs/documentation/getting-started/overview.mdx+++ b/docs/documentation/getting-started/overview.mdx@@ -73,7 +73,7 @@ Configuration and infrastructure shared across every product. You'll end up here<CardGroup cols={3}><Card title="CLI" icon="terminal" href="/cli/overview">- Every command, from `infisical run` to gateway and scanning operations.+ Every command, from `infisical sm run` to gateway and scanning operations.</Card><Card title="API" icon="code" href="/api-reference/overview/introduction">The full REST API for every resource Infisical manages.diff --git a/docs/documentation/guides/local-development.mdx b/docs/documentation/guides/local-development.mdxindex b363faab5e..d55cec34f4 100644--- a/docs/documentation/guides/local-development.mdx+++ b/docs/documentation/guides/local-development.mdx@@ -9,10 +9,10 @@ import LogIn from "/snippets/cli/local-development/log-in.mdx";import LinkProject from "/snippets/cli/local-development/link-project.mdx";import StartApplication from "/snippets/cli/local-development/start-application.mdx";-This guide shows you how to inject secrets from Infisical into your local application without using a `.env` file. You'll install the [Infisical CLI](/cli/install), link your codebase to your Infisical project, and start your application through `infisical run`.+This guide shows you how to inject secrets from Infisical into your local application without using a `.env` file. You'll install the [Infisical CLI](/cli/install), link your codebase to your Infisical project, and start your application through `infisical sm run`.<Note>- `infisical run` injects secrets as environment variables, so it works with any language or framework. To read secrets from inside your application code instead, use a [framework integration](/integrations/overview?type=Framework).+ `infisical sm run` injects secrets as environment variables, so it works with any language or framework. To read secrets from inside your application code instead, use a [framework integration](/integrations/overview?type=Framework).</Note>## Prerequisites@@ -56,15 +56,15 @@ If your application starts but behaves as though a value is missing, check what<CodeGroup>```bash macOS/Linux-infisical run --env=dev -- printenv <YOUR_SECRET_KEY>+infisical sm run --env=dev -- printenv <YOUR_SECRET_KEY>``````powershell Windows (PowerShell)-infisical run --env=dev -- powershell -Command 'echo $env:<YOUR_SECRET_KEY>'+infisical sm run --env=dev -- powershell -Command 'echo $env:<YOUR_SECRET_KEY>'``````batch Windows (Command Prompt)-infisical run --env=dev -- cmd /c echo %<YOUR_SECRET_KEY>%+infisical sm run --env=dev -- cmd /c echo %<YOUR_SECRET_KEY>%```</CodeGroup>@@ -72,7 +72,7 @@ infisical run --env=dev -- cmd /c echo %<YOUR_SECRET_KEY>%To see every key available in an environment, list the secrets directly:```bash-infisical secrets --env=dev --path=/+infisical sm secrets --env=dev --path=/```## Override secrets locally@@ -80,21 +80,21 @@ infisical secrets --env=dev --path=/Everyone working in a project shares the same values for a given environment, which is what keeps a team in sync. When you need a different value on your machine alone, such as pointing a database URL at a database running on your laptop, create a [personal override](/documentation/platform/secrets-mgmt/project#personal-overrides) instead of editing the shared secret:```bash-infisical secrets set <YOUR_SECRET_KEY>=<your-local-value> --type=personal+infisical sm secrets set <YOUR_SECRET_KEY>=<your-local-value> --type=personal```-Your next `infisical run` uses the override, and your teammates keep receiving the shared value. You can also create an override from the secret's row in the dashboard.+Your next `infisical sm run` uses the override, and your teammates keep receiving the shared value. You can also create an override from the secret's row in the dashboard.## Export secrets to a file-Some tools read secrets from a file and offer no way to accept them from the environment. For those cases, write the secrets to a file with [`infisical export`](/cli/reference#export):+Some tools read secrets from a file and offer no way to accept them from the environment. For those cases, write the secrets to a file with [`infisical sm export`](/cli/reference#sm-export):```bash-infisical export --env=dev --format=dotenv --output-file=./.env+infisical sm export --env=dev --format=dotenv --output-file=./.env```<Warning>- An exported file is plain text, and it goes out of date as soon as someone changes a value in Infisical. Add it to your `.gitignore`, and regenerate it rather than treating it as the source of truth. We recommend using `infisical run` wherever possible.+ An exported file is plain text, and it goes out of date as soon as someone changes a value in Infisical. Add it to your `.gitignore`, and regenerate it rather than treating it as the source of truth. We recommend using `infisical sm run` wherever possible.</Warning>## Scan commits for secrets@@ -114,20 +114,20 @@ The hook stops the commit when it finds something that looks like a secret. ChecYour shell reports `infisical: command not found`, or `infisical is not recognized` on Windows. The CLI isn't on your `PATH`. Run the install command for your platform again, then open a new terminal window so that it picks up the updated `PATH`.</Accordion><Accordion title="Your application starts, but a secret is missing">- The CLI is probably reading from a different environment or folder than the one holding your secret. Run `infisical secrets --env=dev --path=/` to see what it resolves to, confirm the environment slug in your project settings, and add `--path` if the secret lives in a folder rather than at the root.+ The CLI is probably reading from a different environment or folder than the one holding your secret. Run `infisical sm secrets --env=dev --path=/` to see what it resolves to, confirm the environment slug in your project settings, and add `--path` if the secret lives in a folder rather than at the root.</Accordion><Accordion title="The CLI can't find your project, or asks you to log in again">The CLI is pointed at the wrong instance. It uses Infisical Cloud US by default, so an EU or self-hosted account needs the address set through the `INFISICAL_DOMAIN` environment variable, the `--domain` flag, or the `domain` field in [`.infisical.json`](/cli/project-config).</Accordion><Accordion title="It works in your terminal but not in your editor">- Your editor's run configuration starts your application on its own, outside the `infisical run` process, and the injected variables exist only inside that process and the commands it starts. Change the run configuration to call `infisical run --env=dev -- <your-start-command>`. Avoid launching the editor itself through `infisical run`, because its extensions, language servers, and other child processes would also inherit the secrets.+ Your editor's run configuration starts your application on its own, outside the `infisical sm run` process, and the injected variables exist only inside that process and the commands it starts. Change the run configuration to call `infisical sm run --env=dev -- <your-start-command>`. Avoid launching the editor itself through `infisical sm run`, because its extensions, language servers, and other child processes would also inherit the secrets.</Accordion></AccordionGroup>## Next steps<CardGroup cols={2}>- <Card title="CLI reference" icon="terminal" href="/cli/reference#run">+ <Card title="CLI reference" icon="terminal" href="/cli/reference#sm-run">All available flags for `run`, `export`, `secrets`, and the rest of the CLI.</Card><Card title="Docker" icon="docker" iconType="brands" href="/integrations/platforms/docker">diff --git a/docs/documentation/guides/nextjs-vercel.mdx b/docs/documentation/guides/nextjs-vercel.mdxindex 3d95f995b2..a0be2d2121 100644--- a/docs/documentation/guides/nextjs-vercel.mdx+++ b/docs/documentation/guides/nextjs-vercel.mdx@@ -170,14 +170,14 @@ infisical init### Start the Next.js app with secrets injected as environment variables```console-infisical run -- npm run dev+infisical sm run -- npm run dev```If you open your browser console, **Hello, YOUR_NAME** should be printed out.Here, the CLI fetched the secret from Infisical and injected it into the Next.js app upon starting up. By default,the CLI fetches secrets from the development environment which has the slug `dev`; you can inject secrets from different-environments by modifying the `env` flag as per the [CLI documentation](/cli/reference#run--flag-env).+environments by modifying the `env` flag as per the [CLI documentation](/cli/reference#sm-run--flag-env).At this stage, you know how to use the Infisical CLI to inject secrets into your Next.js app for local development.diff --git a/docs/documentation/platform/agent-proxy/activity-logs.mdx b/docs/documentation/platform/agent-proxy/activity-logs.mdxindex 3148f536f5..1b770604cb 100644--- a/docs/documentation/platform/agent-proxy/activity-logs.mdx+++ b/docs/documentation/platform/agent-proxy/activity-logs.mdx@@ -57,7 +57,7 @@ Each decision is logged at a level, so `--log-level` controls how much you see:Nothing is written unless you pass `--log-file`, since the agent owns the terminal and a file you didn't ask for is one you can't find. With it, records go to that path and you can `tail -f` them:```bash-infisical secrets agent-proxy run -e dev --log-file=/tmp/broker.log -- claude+infisical sm agent-proxy run -e dev --log-file=/tmp/broker.log -- claude```The file is written in the human-readable format shown above, and is appended to on every run without being rotated for you, so use `logrotate` (`copytruncate`) if you keep one around. Without the flag, warnings and errors still print to your terminal; only the per-request trail is dropped.@@ -68,13 +68,13 @@ Records go to **stderr**, so whatever supervises the proxy collects them. `--log```bash# Watch live, readable (default)-infisical secrets agent-proxy start+infisical sm agent-proxy start# Watch the console and also persist json (e.g. for a SIEM)-infisical secrets agent-proxy start --log-file /var/log/infisical/agent-proxy.log+infisical sm agent-proxy start --log-file /var/log/infisical/agent-proxy.log# Container: json on stderr for your platform to collect-infisical secrets agent-proxy start --log-format json+infisical sm agent-proxy start --log-format json```In `json`, the same record looks like this:@@ -88,7 +88,7 @@ To keep records long-term, forward that output with a collector such as Fluent B## Next steps<CardGroup cols={2}>- <Card title="agent-proxy CLI reference" icon="terminal" href="/cli/reference#secrets-agent-proxy">+ <Card title="agent-proxy CLI reference" icon="terminal" href="/cli/reference#sm-agent-proxy">Every flag for `start` and `connect`, including the logging options.</Card><Card title="Audit Logs" icon="scroll" href="/documentation/platform/audit-logs">diff --git a/docs/documentation/platform/agent-proxy/local-agent-proxy.mdx b/docs/documentation/platform/agent-proxy/local-agent-proxy.mdxindex 910496c0d7..95c9282d7b 100644--- a/docs/documentation/platform/agent-proxy/local-agent-proxy.mdx+++ b/docs/documentation/platform/agent-proxy/local-agent-proxy.mdx@@ -7,7 +7,7 @@ description: "Run an agent on your own computer, sandboxed, with a proxy that stA local proxy runs an agent on your own computer. `agent-proxy run` starts a proxy alongside your agent and stops it when the agent exits. It all happens on the one machine, with the agent sandboxed away from your credentials:```bash-infisical secrets agent-proxy run --projectId=<project-id> --env=dev --path=/coding-agent -- claude+infisical sm agent-proxy run --projectId=<project-id> --env=dev --path=/coding-agent -- claude```This page is the reference for that setup: what the sandbox allows and denies, how certificates work, how permissions are decided, and every flag `run` takes.@@ -110,11 +110,11 @@ Every option resolves the same way: **the flag → an environment variable → `Everything after `--` is your agent's own command, run as-is. From a project directory:```bash-infisical secrets agent-proxy run -e dev -- claude-infisical secrets agent-proxy run -e dev -- codex+infisical sm agent-proxy run -e dev -- claude+infisical sm agent-proxy run -e dev -- codex# any command works: this one sends only the placeholder, and GitHub still answers as you-infisical secrets agent-proxy run -e dev -- \+infisical sm agent-proxy run -e dev -- \sh -c 'curl -sS https://api.github.com/user -H "Authorization: Bearer $GITHUB_TOKEN"'```@@ -230,7 +230,7 @@ Credential paths deny **writes** as well as reads. That matters when you launchIf your agent genuinely needs a denied path, re-open exactly that path instead of disabling the sandbox:```bash-infisical secrets agent-proxy run -e dev --allow-read ~/.aws/config -- claude+infisical sm agent-proxy run -e dev --allow-read ~/.aws/config -- claude```That is precise: `~/.aws/config` becomes readable, read-only, while everything else under `~/.aws` (`credentials`, `sso/`) stays denied. `run` prints what it re-opened. `--allow-write <path>` adds a writable path, and both flags can be repeated.@@ -296,7 +296,7 @@ That is deliberate. You're running an agent as yourself, on your own machine, agNothing is logged unless you ask for it. Pass `--log-file` and the proxy writes a record per request to that path, which you can follow in another terminal:```bash-infisical secrets agent-proxy run -e dev --log-file=/tmp/broker.log -- claude+infisical sm agent-proxy run -e dev --log-file=/tmp/broker.log -- claude# in another terminaltail -f /tmp/broker.log@@ -327,7 +327,7 @@ Without `--log-file` you still see problems: warnings and errors print to your tPoint the tool at a throwaway config location so it never touches the denied path and picks up the placeholder from the environment instead:```bash- infisical secrets agent-proxy run -e dev --set-env GH_CONFIG_DIR=/tmp/gh-cfg -- claude+ infisical sm agent-proxy run -e dev --set-env GH_CONFIG_DIR=/tmp/gh-cfg -- claude```The same pattern applies to any tool with a config-directory override.@@ -356,7 +356,7 @@ Without `--log-file` you still see problems: warnings and errors print to your t## Turning the sandbox off```bash-infisical secrets agent-proxy run -e dev --no-sandbox -- claude+infisical sm agent-proxy run -e dev --no-sandbox -- claude```Brokering still works and the environment is still scrubbed, but the agent is uncontained: it can read your keyring and credential files and reach the network directly, bypassing the proxy. `run` prints a warning saying so. This is a debugging tool, and the only option on Windows.@@ -366,7 +366,7 @@ Brokering still works and the environment is still scrubbed, but the agent is un## Next steps<CardGroup cols={2}>- <Card title="agent-proxy CLI reference" icon="terminal" href="/cli/reference#secrets-agent-proxy-run">+ <Card title="agent-proxy CLI reference" icon="terminal" href="/cli/reference#sm-agent-proxy-run">Every flag for `run`, `start`, and `connect`, with examples.</Card><Card title="Proxied Services" icon="arrow-right-left" href="/documentation/platform/agent-proxy/proxied-services">diff --git a/docs/documentation/platform/agent-proxy/quickstart/local-proxy.mdx b/docs/documentation/platform/agent-proxy/quickstart/local-proxy.mdxindex 156bf76891..738ea924fc 100644--- a/docs/documentation/platform/agent-proxy/quickstart/local-proxy.mdx+++ b/docs/documentation/platform/agent-proxy/quickstart/local-proxy.mdx@@ -74,7 +74,7 @@ infisical loginEverything after `--` is your agent's own command. Run it from the directory you want the agent to work in:```bash-infisical secrets agent-proxy run --projectId=<project-id> --env=dev --path=/coding-agent -- claude+infisical sm agent-proxy run --projectId=<project-id> --env=dev --path=/coding-agent -- claude```This one command starts the proxy and your agent together, and shuts the proxy down when the agent exits. The agent behaves exactly as if you had launched it directly. In its environment it finds `GITHUB_TOKEN`, set to the fake `ghp_…` placeholder, and uses it like a normal token. Calls to `api.github.com` get the real token swapped in as they pass through; everything else goes out untouched. Meanwhile the agent is sandboxed: it can't read your keyring, your `~/.aws` or `~/.ssh`, or your Infisical token.@@ -103,7 +103,7 @@ Each check below makes the same `GET /user` call to `api.github.com`, and the clNot driving an interactive agent? Run the check in place of the agent command:```bash- infisical secrets agent-proxy run --projectId=<project-id> --env=dev --path=/coding-agent -- gh api user+ infisical sm agent-proxy run --projectId=<project-id> --env=dev --path=/coding-agent -- gh api user````gh` reads `GITHUB_TOKEN` automatically, so there is nothing else to pass.@@ -112,7 +112,7 @@ Each check below makes the same `GET /user` call to `api.github.com`, and the clNo `gh`? Any HTTP client works the same way. `curl` sends the placeholder in the header and the proxy swaps it:```bash- infisical secrets agent-proxy run --projectId=<project-id> --env=dev --path=/coding-agent -- \+ infisical sm agent-proxy run --projectId=<project-id> --env=dev --path=/coding-agent -- \sh -c 'curl -sS https://api.github.com/user -H "Authorization: Bearer $GITHUB_TOKEN"'```</Tab>diff --git a/docs/documentation/platform/agent-proxy/quickstart/standalone-proxy.mdx b/docs/documentation/platform/agent-proxy/quickstart/standalone-proxy.mdxindex 2bc83b931c..d47bac5af1 100644--- a/docs/documentation/platform/agent-proxy/quickstart/standalone-proxy.mdx+++ b/docs/documentation/platform/agent-proxy/quickstart/standalone-proxy.mdx@@ -69,7 +69,7 @@ export INFISICAL_UNIVERSAL_AUTH_CLIENT_ID=<agent-proxy-client-id>export INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET=<agent-proxy-client-secret># export INFISICAL_DOMAIN=https://eu.infisical.com # EU Cloud, or your self-hosted URL-infisical secrets agent-proxy start+infisical sm agent-proxy start```Leave it running and note this host's address; the next step points the agent at it.@@ -92,7 +92,7 @@ export INFISICAL_ENVIRONMENT=devexport INFISICAL_SECRET_PATH=/coding-agentexport INFISICAL_AGENT_PROXY_ADDRESS=<proxy-host>:17322-infisical secrets agent-proxy connect -- claude+infisical sm agent-proxy connect -- claude```Everything after `--` is the agent's own command. It starts as if you had launched it directly, finds `GITHUB_TOKEN` set to the fake `ghp_…` placeholder, and uses it like a normal token; the proxy swaps in the real value on calls to `api.github.com`.@@ -113,7 +113,7 @@ Each check below makes the same `GET /user` call to `api.github.com`, and the clNot driving an interactive agent? Run the check directly, in the shell where you set the variables above:```bash- infisical secrets agent-proxy connect -- gh api user+ infisical sm agent-proxy connect -- gh api user```The proxy logs the request as `brokered`.@@ -122,7 +122,7 @@ Each check below makes the same `GET /user` call to `api.github.com`, and the clNo `gh`? Any HTTP client works the same way:```bash- infisical secrets agent-proxy connect -- \+ infisical sm agent-proxy connect -- \sh -c 'curl -sS https://api.github.com/user -H "Authorization: Bearer $GITHUB_TOKEN"'```</Tab>diff --git a/docs/documentation/platform/agent-proxy/standalone-agent-proxy.mdx b/docs/documentation/platform/agent-proxy/standalone-agent-proxy.mdxindex cde933fddd..5060e0dab5 100644--- a/docs/documentation/platform/agent-proxy/standalone-agent-proxy.mdx+++ b/docs/documentation/platform/agent-proxy/standalone-agent-proxy.mdx@@ -43,10 +43,10 @@ The Agent Proxy's security boundary is machine **identity**: what an agent can r```bash# On the proxy host-infisical secrets agent-proxy start+infisical sm agent-proxy start# On each agent host; everything after -- is the agent's own command-infisical secrets agent-proxy connect --proxy=<proxy-host>:17322 --projectId=<project-id> --env=dev --path=/coding-agent -- claude+infisical sm agent-proxy connect --proxy=<proxy-host>:17322 --projectId=<project-id> --env=dev --path=/coding-agent -- claude```Each authenticates as its own [machine identity](/documentation/platform/identities/machine-identities) via [Universal Auth](/documentation/platform/identities/universal-auth), and the proxy's is always separate from the agents'. The proxy needs read access to the secrets its services reference; an agent needs only **Proxy** on the services it uses. [Permissions](#permissions) covers both in full.@@ -62,7 +62,7 @@ Each authenticates as its own [machine identity](/documentation/platform/identit## Configuration-Every option resolves from the same sources, in order: **the flag → an environment variable → `.infisical.json` → the built-in default.** An explicitly-passed flag always wins. Where the environment variables are already set on the host, the flags fall away and only your agent command remains: `infisical secrets agent-proxy connect -- claude`.+Every option resolves from the same sources, in order: **the flag → an environment variable → `.infisical.json` → the built-in default.** An explicitly-passed flag always wins. Where the environment variables are already set on the host, the flags fall away and only your agent command remains: `infisical sm agent-proxy connect -- claude`.| Option | Flag | Environment variable | `.infisical.json` || --- | --- | --- | --- |@@ -77,7 +77,7 @@ Every option resolves from the same sources, in order: **the flag → an environThe proxy address is the one setting that can't come from `.infisical.json`. That file is usually committed to your repository, so a wrong or malicious value would silently route every agent's traffic through the wrong host. Pass it with `--proxy` or `INFISICAL_AGENT_PROXY_ADDRESS` instead.</Note>-See the [CLI reference](/cli/reference#secrets-agent-proxy) for every flag on both subcommands.+See the [CLI reference](/cli/reference#sm-agent-proxy) for every flag on both subcommands.## Deployment@@ -92,7 +92,7 @@ Starting the proxy in a shell is fine while you're trying it out, but it dies wiexport INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET=<agent-proxy-client-secret># export INFISICAL_DOMAIN=https://eu.infisical.com # EU Cloud or self-hosted- infisical secrets agent-proxy start+ infisical sm agent-proxy start```</Tab><Tab title="Docker">@@ -102,7 +102,7 @@ Starting the proxy in a shell is fine while you're trying it out, but it dies widocker run -p 17322:17322 \-e INFISICAL_UNIVERSAL_AUTH_CLIENT_ID=<agent-proxy-client-id> \-e INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET=<agent-proxy-client-secret> \- infisical/cli:latest secrets agent-proxy start+ infisical/cli:latest sm agent-proxy start```Add `-e INFISICAL_DOMAIN=https://eu.infisical.com` for EU Cloud or a self-hosted instance.@@ -111,7 +111,7 @@ Starting the proxy in a shell is fine while you're trying it out, but it dies wiDeploy the `infisical/cli` image as a service:- **Image:** `infisical/cli:latest`- - **Start command:** `secrets agent-proxy start`+ - **Start command:** `sm agent-proxy start`- **Environment:** `INFISICAL_UNIVERSAL_AUTH_CLIENT_ID`, `INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET`, and `INFISICAL_DOMAIN` if not on US Cloud- **Port:** `17322`, exposed on a private network your agents can reach, not the public internet@@ -234,7 +234,7 @@ Records go to **stderr**, so whatever supervises the proxy collects them, and `-<Card title="Proxied Services" icon="arrow-right-left" href="/documentation/platform/agent-proxy/proxied-services">Host patterns, header rewrites, and secret substitution in depth.</Card>- <Card title="agent-proxy CLI reference" icon="terminal" href="/cli/reference#secrets-agent-proxy">+ <Card title="agent-proxy CLI reference" icon="terminal" href="/cli/reference#sm-agent-proxy">Every flag for `start` and `connect`, with examples.</Card></CardGroup>diff --git a/docs/documentation/platform/audit-logs.mdx b/docs/documentation/platform/audit-logs.mdxindex 694a8de3c1..c5fc01c2b6 100644--- a/docs/documentation/platform/audit-logs.mdx+++ b/docs/documentation/platform/audit-logs.mdx@@ -451,7 +451,7 @@ Here are a few common patterns for filtering audit logs, grouped by product.</Tabs></Accordion><Accordion title="Who opened a folder">- Find every time someone loaded the secrets in the `/db` folder — for example, by opening it in the web UI, running `infisical secrets`, or having an app fetch it at startup. Each event records the folder, the actor, and how many secrets came back.+ Find every time someone loaded the secrets in the `/db` folder — for example, by opening it in the web UI, running `infisical sm secrets`, or having an app fetch it at startup. Each event records the folder, the actor, and how many secrets came back.<Tabs><Tab title="Infisical UI">diff --git a/docs/documentation/platform/dynamic-secrets/ssh.mdx b/docs/documentation/platform/dynamic-secrets/ssh.mdxindex f70c1366b9..4193dc0eeb 100644--- a/docs/documentation/platform/dynamic-secrets/ssh.mdx+++ b/docs/documentation/platform/dynamic-secrets/ssh.mdx@@ -150,7 +150,7 @@ When you create an SSH dynamic secret, Infisical generates an internal CA key paYou can also create SSH dynamic secret leases using the CLI:```bash-infisical dynamic-secrets lease create <secret-name> \+infisical sm dynamic-secrets lease create <secret-name> \--projectId=<project-id> \--env=dev \--principals=root,deploy@@ -158,7 +158,7 @@ infisical dynamic-secrets lease create <secret-name> \The `--principals` flag is required for SSH dynamic secrets and accepts a comma-separated list. The requested principals must be a subset of the allowed principals configured on the dynamic secret.-For more details, see the [CLI dynamic secrets documentation](/cli/reference#dynamic-secrets).+For more details, see the [CLI dynamic secrets documentation](/cli/reference#sm-dynamic-secrets).## Audit or revoke leasesdiff --git a/docs/documentation/platform/identities/oidc-auth/gitlab.mdx b/docs/documentation/platform/identities/oidc-auth/gitlab.mdxindex 2c8b6a74f9..e017baa341 100644--- a/docs/documentation/platform/identities/oidc-auth/gitlab.mdx+++ b/docs/documentation/platform/identities/oidc-auth/gitlab.mdx@@ -130,7 +130,7 @@ In the following steps, we explore how to create and use identities to access th- curl -1sLf 'https://artifacts-cli.infisical.com/setup.deb.sh' | bash- apt-get update && apt-get install -y infisical- export INFISICAL_TOKEN=$(infisical login --method=oidc-auth --machine-identity-id=4e807a78-1b1c-4bd6-9609-ef2b0cf4fd54 --oidc-jwt=$INFISICAL_ID_TOKEN --silent --plain)- - infisical run --projectId=1d0443c1-cd43-4b3a-91a3-9d5f81254a89 --env=dev -- npm run build+ - infisical sm run --projectId=1d0443c1-cd43-4b3a-91a3-9d5f81254a89 --env=dev -- npm run build```The `id_tokens` keyword is used to request an ID token for the job. In this example, an ID token named `INFISICAL_ID_TOKEN` is requested with the audience (`aud`) claim set to "infisical-aud-test". This ID token will be used to authenticate with Infisical.diff --git a/docs/documentation/platform/identities/overview.mdx b/docs/documentation/platform/identities/overview.mdxindex 204e1148c1..a4a379b6db 100644--- a/docs/documentation/platform/identities/overview.mdx+++ b/docs/documentation/platform/identities/overview.mdx@@ -148,7 +148,7 @@ For agents that authenticate as themselves, scope identities by purpose and perm</Info><Accordion title="Example 6: Local coding agents">- **Scenario**: 40 engineers each run a coding agent on their laptop with `infisical secrets agent-proxy run`.+ **Scenario**: 40 engineers each run a coding agent on their laptop with `infisical sm agent-proxy run`.**Machine identities needed**: **0**diff --git a/docs/documentation/platform/oauth-applications/authorization-code.mdx b/docs/documentation/platform/oauth-applications/authorization-code.mdxindex 372b189747..fd853e3ebb 100644--- a/docs/documentation/platform/oauth-applications/authorization-code.mdx+++ b/docs/documentation/platform/oauth-applications/authorization-code.mdx@@ -5,7 +5,7 @@ description: "Let external platforms request delegated access to Infisical on aThe **authorization code** flow lets an [OAuth application](/documentation/platform/oauth-applications/overview) request **delegated access** to Infisical on behalf of one of your users. The platform never sees the user's password or session; instead it runs a standard authorization code flow, the user reviews and approves the request on an Infisical consent screen, and the platform receives short-lived access and refresh tokens scoped to that user.-A common use case is wiring Infisical into a developer platform as an External Auth provider, so that `infisical run` can fetch secrets at runtime inside a remote development environment using the developer's own permissions.+A common use case is wiring Infisical into a developer platform as an External Auth provider, so that `infisical sm run` can fetch secrets at runtime inside a remote development environment using the developer's own permissions.<Info>This page covers the browser-based flow, where each user approves the application on a consent screen. If you're registering trusted middleware that acts on behalf of many users and has no browser to redirect through, see [token exchange](/documentation/platform/oauth-applications/token-exchange).@@ -54,7 +54,7 @@ Scopes are a coarse, named contract for what a delegated token is allowed to do.| `secrets:read` | Read secrets, folders, and imports |<Note>- `secrets:read` is the only scope available today, supporting the read-only `infisical run` use case. Requesting an unrecognized scope rejects the authorization request rather than silently dropping it.+ `secrets:read` is the only scope available today, supporting the read-only `infisical sm run` use case. Requesting an unrecognized scope rejects the authorization request rather than silently dropping it.</Note>## Creating an OAuth applicationdiff --git a/docs/documentation/platform/oauth-applications/overview.mdx b/docs/documentation/platform/oauth-applications/overview.mdxindex 01e283f337..0d2f8a5ffe 100644--- a/docs/documentation/platform/oauth-applications/overview.mdx+++ b/docs/documentation/platform/oauth-applications/overview.mdx@@ -14,7 +14,7 @@ An OAuth application obtains its tokens through one of two flows, chosen when yoicon="app-window"href="/documentation/platform/oauth-applications/authorization-code">- The user approves the application on an Infisical consent screen in their browser. Best for a platform integrating with Infisical as an external auth provider, such as one where `infisical run` fetches secrets with the developer's own permissions.+ The user approves the application on an Infisical consent screen in their browser. Best for a platform integrating with Infisical as an external auth provider, such as one where `infisical sm run` fetches secrets with the developer's own permissions.</Card><Cardtitle="Token exchange"diff --git a/docs/documentation/platform/secrets-mgmt/concepts/secrets-delivery.mdx b/docs/documentation/platform/secrets-mgmt/concepts/secrets-delivery.mdxindex 62576e8465..7186c03526 100644--- a/docs/documentation/platform/secrets-mgmt/concepts/secrets-delivery.mdx+++ b/docs/documentation/platform/secrets-mgmt/concepts/secrets-delivery.mdx@@ -32,7 +32,7 @@ From here, you can explore the delivery method that best matches your environmenFor local development, one-off scripts, or basic automation, the [Infisical CLI](/cli/overview) is a quick and flexible option.-Instead of using a `.env` file, you can use [`infisical run`](/cli/reference#run) to inject secrets as environment variables directly into your development process. This provides a cleaner and more secure workflow. Because the CLI reads the current values each time your application starts, a developer joining the team never needs a copy of a teammate's `.env` file, and no one is left running a stale value after a credential changes. You can also use [`infisical secrets`](/cli/reference#secrets) to perform CRUD operations on secrets from the command line, which works well for debugging, local tooling, and lightweight scripting.+Instead of using a `.env` file, you can use [`infisical sm run`](/cli/reference#sm-run) to inject secrets as environment variables directly into your development process. This provides a cleaner and more secure workflow. Because the CLI reads the current values each time your application starts, a developer joining the team never needs a copy of a teammate's `.env` file, and no one is left running a stale value after a credential changes. You can also use [`infisical sm secrets`](/cli/reference#sm-secrets) to perform CRUD operations on secrets from the command line, which works well for debugging, local tooling, and lightweight scripting.To set this up on your own machine, see the [local development guide](/documentation/guides/local-development).diff --git a/docs/integrations/build-tools/gradle.mdx b/docs/integrations/build-tools/gradle.mdxindex 2045ccb260..90fdc0169a 100644--- a/docs/integrations/build-tools/gradle.mdx+++ b/docs/integrations/build-tools/gradle.mdx@@ -14,7 +14,7 @@ This documentation provides an overview of how to use Infisical with [Gradle](htTo run a Gradle task with Infisical, you can use the `run` command. The basic structure is:```-infisical run -- [Your command here]+infisical sm run -- [Your command here]```For example, to run the `generateFile` task in Gradle:@@ -30,7 +30,7 @@ task generateFile {``````-infisical run -- gradle generateFile+infisical sm run -- gradle generateFile```With this command, Infisical will automatically inject the environment variables associated with the current Infisical project into the Gradle process.@@ -43,7 +43,7 @@ Your Gradle script can then access these variables using `System.getenv('VARIABLAssuming you have different build profiles (e.g., 'development', 'production'), you can use Infisical to switch between them:```-infisical run -- gradle build+infisical sm run -- gradle build```Inside your `build.gradle`, you might have:@@ -59,7 +59,7 @@ if (System.getenv('PROFILE') == 'production') {If you want to run tests against different database configurations:```-infisical run -- gradle test+infisical sm run -- gradle test```Your test configuration in `build.gradle` can then adjust the database URL accordingly:@@ -75,7 +75,7 @@ test {For automated CI/CD pipelines, you might want to inject a build number or version:```-infisical run -- gradle assemble+infisical sm run -- gradle assemble```And in `build.gradle`:diff --git a/docs/integrations/cicd/aws-amplify.mdx b/docs/integrations/cicd/aws-amplify.mdxindex 716709b46c..afdc178e57 100644--- a/docs/integrations/cicd/aws-amplify.mdx+++ b/docs/integrations/cicd/aws-amplify.mdx@@ -53,7 +53,7 @@ This approach enables you to fetch secrets from Infisical during Amplify build tbuild:commands:- INFISICAL_TOKEN=$(infisical login --method=universal-auth --client-id=${INFISICAL_MACHINE_IDENTITY_CLIENT_ID} --client-secret=${INFISICAL_MACHINE_IDENTITY_CLIENT_SECRET} --silent --plain)- - infisical export --format=dotenv > .env+ - infisical sm export --format=dotenv > .env- <rest of the commands>```</Step>@@ -95,7 +95,7 @@ This approach enables you to fetch secrets from Infisical during Amplify build tbuild:commands:- INFISICAL_TOKEN=${INFISICAL_TOKEN}- - infisical export --format=dotenv > .env+ - infisical sm export --format=dotenv > .env- <rest of the commands>```</Step>diff --git a/docs/integrations/cicd/bitbucket.mdx b/docs/integrations/cicd/bitbucket.mdxindex fa3d5895be..8f62162256 100644--- a/docs/integrations/cicd/bitbucket.mdx+++ b/docs/integrations/cicd/bitbucket.mdx@@ -41,11 +41,11 @@ Prerequisites:- curl -1sLf 'https://artifacts-cli.infisical.com/setup.deb.sh' | bash- apt-get update && apt-get install -y infisical- export INFISICAL_TOKEN=$(infisical login --method=universal-auth --client-id=$INFISICAL_CLIENT_ID --client-secret=$INFISICAL_CLIENT_SECRET --silent --plain)- - infisical run --projectId=1d0443c1-cd43-4b3a-91a3-9d5f81254a89 --env=dev -- npm run build+ - infisical sm run --projectId=1d0443c1-cd43-4b3a-91a3-9d5f81254a89 --env=dev -- npm run build```<Tip>- Set the values of `projectId` and `env` flags in the `infisical run` command to your intended source path. For more options, refer to the CLI command reference [here](/cli/reference#run).+ Set the values of `projectId` and `env` flags in the `infisical sm run` command to your intended source path. For more options, refer to the CLI command reference [here](/cli/reference#sm-run).</Tip></Step></Steps>diff --git a/docs/integrations/cicd/gitlab.mdx b/docs/integrations/cicd/gitlab.mdxindex b76e51d87f..931c7dd40d 100644--- a/docs/integrations/cicd/gitlab.mdx+++ b/docs/integrations/cicd/gitlab.mdx@@ -37,7 +37,7 @@ description: "How to sync secrets from Infisical to GitLab"- apt update && apt install -y curl- curl -1sLf 'https://artifacts-cli.infisical.com/setup.deb.sh' | bash- apt-get update && apt-get install -y infisical- - infisical run -- npm run build+ - infisical sm run -- npm run build```</Step></Steps>diff --git a/docs/integrations/cicd/jenkins.mdx b/docs/integrations/cicd/jenkins.mdxindex 679545cb19..02243089ff 100644--- a/docs/integrations/cicd/jenkins.mdx+++ b/docs/integrations/cicd/jenkins.mdx@@ -201,7 +201,7 @@ Prerequisites:The example command below will print the secrets using the service token passed as a credential. When done, click **Save**.```- infisical secrets --env=dev --path=/+ infisical sm secrets --env=dev --path=/```@@ -238,13 +238,13 @@ Prerequisites:stages {stage('Run Infisical') {steps {- sh("infisical secrets --env=dev --path=/")+ sh("infisical sm secrets --env=dev --path=/")// doesn't work- // sh("docker run --rm test-container infisical secrets")+ // sh("docker run --rm test-container infisical sm secrets")// works- // sh("docker run -e INFISICAL_TOKEN=${INFISICAL_TOKEN} --rm test-container infisical secrets --env=dev --path=/")+ // sh("docker run -e INFISICAL_TOKEN=${INFISICAL_TOKEN} --rm test-container infisical sm secrets --env=dev --path=/")// doesn't work// sh("docker-compose up -d")diff --git a/docs/integrations/frameworks/ab-initio.mdx b/docs/integrations/frameworks/ab-initio.mdxindex 224279f1a0..349a73d297 100644--- a/docs/integrations/frameworks/ab-initio.mdx+++ b/docs/integrations/frameworks/ab-initio.mdx@@ -22,7 +22,7 @@ description: "How to use Infisical secrets in Ab Initio."export INFISICAL_TOKEN=$(infisical login --method=universal-auth --client-id=$INFISICAL_CLIENT_ID --client-secret=$INFISICAL_CLIENT_SECRET --silent --plain)# Fetch secrets from Infisical- infisical export --projectId="<>" --env="prod" > infisical.env+ infisical sm export --projectId="<>" --env="prod" > infisical.env# Inject secrets as environment variablessource infisical.envdiff --git a/docs/integrations/frameworks/bun.mdx b/docs/integrations/frameworks/bun.mdxindex e3356380c5..b25932314b 100644--- a/docs/integrations/frameworks/bun.mdx+++ b/docs/integrations/frameworks/bun.mdx@@ -21,10 +21,10 @@ infisical init## Start your application as usual but with Infisical```bash-infisical run -- <your application start command>+infisical sm run -- <your application start command># Example-infisical run -- bun run dev+infisical sm run -- bun run dev```<Info>diff --git a/docs/integrations/frameworks/django.mdx b/docs/integrations/frameworks/django.mdxindex ffac35b495..f7b56875e6 100644--- a/docs/integrations/frameworks/django.mdx+++ b/docs/integrations/frameworks/django.mdx@@ -21,8 +21,8 @@ infisical init## Start your application as usual but with Infisical```bash-infisical run -- <your application start command>+infisical sm run -- <your application start command># Example-infisical run -- python manage.py runserver+infisical sm run -- python manage.py runserver```diff --git a/docs/integrations/frameworks/dotnet.mdx b/docs/integrations/frameworks/dotnet.mdxindex 118f4fb51c..d07019d8a4 100644--- a/docs/integrations/frameworks/dotnet.mdx+++ b/docs/integrations/frameworks/dotnet.mdx@@ -21,8 +21,8 @@ infisical init## Start your application as usual but with Infisical```bash-infisical run -- <your application start command>+infisical sm run -- <your application start command># Example-infisical run -- dotnet run+infisical sm run -- dotnet run```diff --git a/docs/integrations/frameworks/express.mdx b/docs/integrations/frameworks/express.mdxindex 715134aeeb..9cdd3990b5 100644--- a/docs/integrations/frameworks/express.mdx+++ b/docs/integrations/frameworks/express.mdx@@ -27,8 +27,8 @@ infisical init## Start your application as usual but with Infisical```bash-infisical run -- <your application start command>+infisical sm run -- <your application start command># Example-infisical run -- npm run dev+infisical sm run -- npm run dev```diff --git a/docs/integrations/frameworks/fiber.mdx b/docs/integrations/frameworks/fiber.mdxindex 50ec99e508..4e11317bf3 100644--- a/docs/integrations/frameworks/fiber.mdx+++ b/docs/integrations/frameworks/fiber.mdx@@ -21,8 +21,8 @@ infisical init## Start your application as usual but with Infisical```bash-infisical run -- <your application start command>+infisical sm run -- <your application start command># Example-infisical run -- go run server.go+infisical sm run -- go run server.go```\ No newline at end of filediff --git a/docs/integrations/frameworks/flask.mdx b/docs/integrations/frameworks/flask.mdxindex d40d24df37..3357aa3995 100644--- a/docs/integrations/frameworks/flask.mdx+++ b/docs/integrations/frameworks/flask.mdx@@ -21,8 +21,8 @@ infisical init## Start your application as usual but with Infisical```bash-infisical run -- <your application start command>+infisical sm run -- <your application start command># Example-infisical run -- flask run+infisical sm run -- flask run```diff --git a/docs/integrations/frameworks/gatsby.mdx b/docs/integrations/frameworks/gatsby.mdxindex 67c7dedcde..50e5f5755a 100644--- a/docs/integrations/frameworks/gatsby.mdx+++ b/docs/integrations/frameworks/gatsby.mdx@@ -21,10 +21,10 @@ infisical init## Start your application as usual but with Infisical```bash-infisical run -- <your application start command>+infisical sm run -- <your application start command># Example-infisical run -- npm run develop+infisical sm run -- npm run develop```<Note>diff --git a/docs/integrations/frameworks/laravel.mdx b/docs/integrations/frameworks/laravel.mdxindex fe41e01b01..6b41a72d5b 100644--- a/docs/integrations/frameworks/laravel.mdx+++ b/docs/integrations/frameworks/laravel.mdx@@ -21,8 +21,8 @@ infisical init## Start your application as usual but with Infisical```bash-infisical run -- <your application start command>+infisical sm run -- <your application start command># Example-infisical run -- php artisan serve+infisical sm run -- php artisan serve```diff --git a/docs/integrations/frameworks/nestjs.mdx b/docs/integrations/frameworks/nestjs.mdxindex f9b7286ed9..16ab6e1d69 100644--- a/docs/integrations/frameworks/nestjs.mdx+++ b/docs/integrations/frameworks/nestjs.mdx@@ -21,8 +21,8 @@ infisical init## Start your application as usual but with Infisical```bash-infisical run -- <your application start command>+infisical sm run -- <your application start command># Example-infisical run -- npm run start:dev+infisical sm run -- npm run start:dev```diff --git a/docs/integrations/frameworks/nextjs.mdx b/docs/integrations/frameworks/nextjs.mdxindex 40b171c4d4..fd14753b73 100644--- a/docs/integrations/frameworks/nextjs.mdx+++ b/docs/integrations/frameworks/nextjs.mdx@@ -21,10 +21,10 @@ infisical init## Start your application as usual but with Infisical```bash-infisical run -- <your application start command>+infisical sm run -- <your application start command># Example-infisical run -- npm run dev+infisical sm run -- npm run dev```<Note>diff --git a/docs/integrations/frameworks/nuxt.mdx b/docs/integrations/frameworks/nuxt.mdxindex d651b51876..bf8741c7c5 100644--- a/docs/integrations/frameworks/nuxt.mdx+++ b/docs/integrations/frameworks/nuxt.mdx@@ -21,8 +21,8 @@ infisical init## Start your application as usual but with Infisical```bash-infisical run -- <your application start command>+infisical sm run -- <your application start command># Example-infisical run -- npm run dev+infisical sm run -- npm run dev```diff --git a/docs/integrations/frameworks/rails.mdx b/docs/integrations/frameworks/rails.mdxindex bd9d9fa7d6..36c917ca3d 100644--- a/docs/integrations/frameworks/rails.mdx+++ b/docs/integrations/frameworks/rails.mdx@@ -21,8 +21,8 @@ infisical init## Start your application as usual but with Infisical```bash-infisical run -- <your application start command>+infisical sm run -- <your application start command># Example-infisical run -- bin/rails server+infisical sm run -- bin/rails server```diff --git a/docs/integrations/frameworks/react.mdx b/docs/integrations/frameworks/react.mdxindex dfa7f48495..3b73860aa2 100644--- a/docs/integrations/frameworks/react.mdx+++ b/docs/integrations/frameworks/react.mdx@@ -21,10 +21,10 @@ infisical init## Start your application as usual but with Infisical```bash-infisical run -- <your application start command>+infisical sm run -- <your application start command># Example-infisical run -- npm run dev+infisical sm run -- npm run dev```<Info>diff --git a/docs/integrations/frameworks/remix.mdx b/docs/integrations/frameworks/remix.mdxindex 9058b819b5..5a731c4a53 100644--- a/docs/integrations/frameworks/remix.mdx+++ b/docs/integrations/frameworks/remix.mdx@@ -21,8 +21,8 @@ infisical init## Start your application as usual but with Infisical```bash-infisical run -- <your application start command>+infisical sm run -- <your application start command># Example-infisical run -- npm run dev+infisical sm run -- npm run dev```diff --git a/docs/integrations/frameworks/spring-boot-maven.mdx b/docs/integrations/frameworks/spring-boot-maven.mdxindex bfc05603d6..78b7fd8f1e 100644--- a/docs/integrations/frameworks/spring-boot-maven.mdx+++ b/docs/integrations/frameworks/spring-boot-maven.mdx@@ -25,7 +25,7 @@ To pass in Infisical secrets into your application, we will utilize the InfisicaThe Maven wrapper executable should already be present in the root directory of your project.```bash-infisical run -- ./mvnw spring-boot:run --quiet+infisical sm run -- ./mvnw spring-boot:run --quiet```#### Accessing injected secrets@@ -67,7 +67,7 @@ Note that these instructions are currently only available for IntelliJ.<img height="200" src="../../images/spring-maven-debug-4.png" />```-infisical run -- ./mvnw spring-boot:run -Dspring-boot.run.jvmArguments="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=*:5005"+infisical sm run -- ./mvnw spring-boot:run -Dspring-boot.run.jvmArguments="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=*:5005"```**Step 5:** When you need to run a block of code in debug mode, select the Infisical scriptdiff --git a/docs/integrations/frameworks/sveltekit.mdx b/docs/integrations/frameworks/sveltekit.mdxindex ec24e05e6e..2fe73b4102 100644--- a/docs/integrations/frameworks/sveltekit.mdx+++ b/docs/integrations/frameworks/sveltekit.mdx@@ -21,10 +21,10 @@ infisical init## Start your application as usual but with Infisical```bash-infisical run -- <your application start command>+infisical sm run -- <your application start command># Example-infisical run -- npm run dev+infisical sm run -- npm run dev```<Note>diff --git a/docs/integrations/frameworks/vite.mdx b/docs/integrations/frameworks/vite.mdxindex 5e80dbf896..2a4048336c 100644--- a/docs/integrations/frameworks/vite.mdx+++ b/docs/integrations/frameworks/vite.mdx@@ -21,10 +21,10 @@ infisical init## Start your application as usual but with Infisical```bash-infisical run -- <your application start command>+infisical sm run -- <your application start command># Example-infisical run -- npm run dev+infisical sm run -- npm run dev```<Note>diff --git a/docs/integrations/frameworks/vue.mdx b/docs/integrations/frameworks/vue.mdxindex d8dc2d28dd..c0dd795988 100644--- a/docs/integrations/frameworks/vue.mdx+++ b/docs/integrations/frameworks/vue.mdx@@ -21,10 +21,10 @@ infisical init## Start your application as usual but with Infisical```bash-infisical run -- <your application start command>+infisical sm run -- <your application start command># Example-infisical run -- npm run dev+infisical sm run -- npm run dev```<Note>diff --git a/docs/integrations/platforms/aws/lambda.mdx b/docs/integrations/platforms/aws/lambda.mdxindex 2923242393..9ca51ce846 100644--- a/docs/integrations/platforms/aws/lambda.mdx+++ b/docs/integrations/platforms/aws/lambda.mdx@@ -63,7 +63,7 @@ Attach a policy like the one below to the IAM user or role responsible for updatUse the Infisical CLI to export secrets as JSON and pass them to the AWS CLI.The example below targets a project by ID, but you can also use the `--project` and `--env` flags.-Learn more about `infisical export` [here](/cli/reference#export).+Learn more about `infisical sm export` [here](/cli/reference#sm-export).```bashFUNCTION_NAME=infisical-env-test@@ -74,7 +74,7 @@ aws lambda update-function-configuration \--function-name "$FUNCTION_NAME" \--region "$REGION" \--environment "$(- infisical export \+ infisical sm export \--format=json \--projectId="$PROJECT_ID" \| jq 'map({(.key): .value}) | add | {Variables: .}'@@ -85,10 +85,10 @@ On success, the updated `Environment.Variables` block will be returned.Verify the values in the Lambda console or by invoking the function.<Tip>- Automate this step in CI/CD. Run `infisical export` using an Infisical Token+ Automate this step in CI/CD. Run `infisical sm export` using an Infisical Tokenscoped to your project and environment, and trigger the sync as part of yourdeployment workflow. Learn more about the [Infisical- Token](/cli/reference#export--flag-token).+ Token](/cli/reference#sm-export--flag-token).</Tip><Note>diff --git a/docs/integrations/platforms/docker.mdx b/docs/integrations/platforms/docker.mdxindex 3b4b418c5c..a157e70fa2 100644--- a/docs/integrations/platforms/docker.mdx+++ b/docs/integrations/platforms/docker.mdx@@ -72,7 +72,7 @@ Choose how Docker should receive your application secrets:</Warning><Note>- Machine identity access tokens are short-lived. Token expiration doesn't affect an application after `infisical run` has fetched its secrets, but the container needs a valid token every time it starts.+ Machine identity access tokens are short-lived. Token expiration doesn't affect an application after `infisical sm run` has fetched its secrets, but the container needs a valid token every time it starts.In automated deployments, store the Client ID and Client Secret in your deployment platform's secret store and run `infisical login` immediately before each `docker run` or `docker compose up`.</Note>@@ -106,27 +106,27 @@ Choose how Docker should receive your application secrets:Pin the [Infisical CLI version](https://github.com/Infisical/cli/releases) in production images to keep builds reproducible.</Tip>- Next, wrap your application's start command with [`infisical run`](/cli/reference#run). Replace `<project-id>` with the project ID you copied earlier:+ Next, wrap your application's start command with [`infisical sm run`](/cli/reference#sm-run). Replace `<project-id>` with the project ID you copied earlier:<CodeGroup>```dockerfile Node.js- CMD ["infisical", "run", "--projectId=<project-id>", "--env=dev", "--", "npm", "start"]+ CMD ["infisical", "sm", "run", "--projectId=<project-id>", "--env=dev", "--", "npm", "start"]``````dockerfile Flask- CMD ["infisical", "run", "--projectId=<project-id>", "--env=dev", "--", "flask", "run", "--host=0.0.0.0"]+ CMD ["infisical", "sm", "run", "--projectId=<project-id>", "--env=dev", "--", "flask", "run", "--host=0.0.0.0"]``````dockerfile Go- CMD ["infisical", "run", "--projectId=<project-id>", "--env=dev", "--", "./app"]+ CMD ["infisical", "sm", "run", "--projectId=<project-id>", "--env=dev", "--", "./app"]```</CodeGroup><Accordion title="Run multiple startup commands">- Use the [`--command` option](/cli/reference#run--flag-command) when your application needs to run multiple shell commands in sequence:+ Use the [`--command` option](/cli/reference#sm-run--flag-command) when your application needs to run multiple shell commands in sequence:```dockerfile- CMD ["infisical", "run", "--projectId=<project-id>", "--env=dev", "--command", "npm run migrate && npm start"]+ CMD ["infisical", "sm", "run", "--projectId=<project-id>", "--env=dev", "--command", "npm run migrate && npm start"]```</Accordion>@@ -213,7 +213,7 @@ Choose how Docker should receive your application secrets:```bashdocker run --rm \- --env-file <(infisical export --env=dev --format=dotenv) \+ --env-file <(infisical sm export --env=dev --format=dotenv) \orders-service```@@ -274,7 +274,7 @@ Choose how Docker should receive your application secrets:```bashdocker run --rm \- --env-file <(infisical export --projectId=<project-id> --env=dev --format=dotenv) \+ --env-file <(infisical sm export --projectId=<project-id> --env=dev --format=dotenv) \orders-service```@@ -294,7 +294,7 @@ Choose how Docker should receive your application secrets:If you [fetch secrets at startup](#fetch-at-startup), you can use [Docker Compose](https://docs.docker.com/compose/) to build and run one or more configured service images.-[Configure each image](/integrations/platforms/docker#step-4-update-your-dockerfile) to start through `infisical run`, then configure your Compose file for your Infisical deployment:+[Configure each image](/integrations/platforms/docker#step-4-update-your-dockerfile) to start through `infisical sm run`, then configure your Compose file for your Infisical deployment:<CodeGroup>```yaml Infisical Cloud USdiff --git a/docs/integrations/platforms/pm2.mdx b/docs/integrations/platforms/pm2.mdxindex 7cb147f637..0fcbfd119c 100644--- a/docs/integrations/platforms/pm2.mdx+++ b/docs/integrations/platforms/pm2.mdx@@ -23,7 +23,7 @@ infisical init<CodeGroup>```bash infisical-run.sh-infisical run -- npm start+infisical sm run -- npm start``````js infisical-run.jsdiff --git a/docs/snippets/CLIPage.jsx b/docs/snippets/CLIPage.jsxindex 012831906e..19c21088d9 100644--- a/docs/snippets/CLIPage.jsx+++ b/docs/snippets/CLIPage.jsx@@ -1,4 +1,4 @@-export const CLIPage = ({ title, description, children }) => {+export const CLIPage = ({ title, description, movedAnchors = {}, children }) => {const rootRef = useRef(null);useEffect(() => {@@ -15,7 +15,17 @@ export const CLIPage = ({ title, description, children }) => {// fonts and sticky headings settle), which pushes the target down. Keep realigning while the// page resizes, until the reader scrolls on their own or the layout has had time to settle.let stopAligning = () => {};- const hash = decodeURIComponent(window.location.hash.slice(1));+ let hash = decodeURIComponent(window.location.hash.slice(1));+ // Links to a command's old anchor are already published, so when a command moves under+ // another one, `movedAnchors` maps the old id prefix to the new one. The longest prefix wins,+ // so a subcommand that moved somewhere other than its parent can have its own entry.+ const movedFrom = Object.keys(movedAnchors)+ .filter((old) => hash === old || hash.startsWith(`${old}-`))+ .sort((a, b) => b.length - a.length)[0];+ if (movedFrom && !document.getElementById(hash)) {+ hash = movedAnchors[movedFrom] + hash.slice(movedFrom.length);+ window.history.replaceState(window.history.state, "", `#${hash}`);+ }const target = hash ? document.getElementById(hash) : null;let pinned = target ? target.closest("[data-cli-command]") : null;diff --git a/docs/snippets/cli/local-development/start-application.mdx b/docs/snippets/cli/local-development/start-application.mdxindex bdc613c0e9..1473118c84 100644--- a/docs/snippets/cli/local-development/start-application.mdx+++ b/docs/snippets/cli/local-development/start-application.mdx@@ -1,29 +1,29 @@-Run your usual start command through `infisical run`, placing it after the `--` separator.+Run your usual start command through `infisical sm run`, placing it after the `--` separator.<CodeGroup>```bash Node.js-infisical run --env=dev -- npm run dev+infisical sm run --env=dev -- npm run dev``````bash Python-infisical run --env=dev -- flask run+infisical sm run --env=dev -- flask run``````bash Go-infisical run --env=dev -- go run main.go+infisical sm run --env=dev -- go run main.go``````bash Ruby-infisical run --env=dev -- bundle exec rails server+infisical sm run --env=dev -- bundle exec rails server``````bash Java-infisical run --env=dev -- ./mvnw spring-boot:run+infisical sm run --env=dev -- ./mvnw spring-boot:run``````bash .NET-infisical run --env=dev -- dotnet run+infisical sm run --env=dev -- dotnet run```</CodeGroup>@@ -31,15 +31,15 @@ infisical run --env=dev -- dotnet runThe CLI fetches the secrets you have access to and passes them to your application as environment variables. Your application reads them the same way it always has, through `process.env` in Node.js or `os.environ` in Python, so you don't need to change any application code.<Note>- By default, `infisical run` only injects the secrets sitting at the root of the environment, so anything inside a folder is skipped. If your secrets live in [folders](/documentation/platform/folder), you can specify a folder to include using `--path`:+ By default, `infisical sm run` only injects the secrets sitting at the root of the environment, so anything inside a folder is skipped. If your secrets live in [folders](/documentation/platform/folder), you can specify a folder to include using `--path`:```bash- infisical run --env=dev --path="/backend" -- npm run dev+ infisical sm run --env=dev --path="/backend" -- npm run dev```If you also need the secrets in that folder's subfolders, add `--recursive`:```bash- infisical run --env=dev --path="/backend" --recursive -- npm run dev+ infisical sm run --env=dev --path="/backend" --recursive -- npm run dev```</Note>@@ -63,10 +63,10 @@ The CLI fetches the secrets you have access to and passes them to your applicatiSource the file and call the function in a single command:```bash- infisical run --env=dev --command="source custom.sh && yd"+ infisical sm run --env=dev --command="source custom.sh && yd"```The `--command` flag is also how you chain commands together, as in `--command="npm run migrate && npm run dev"`.</Accordion>-For every available option, see the [`infisical run`](/cli/reference#run) reference.+For every available option, see the [`infisical sm run`](/cli/reference#sm-run) reference.