You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Every fixed command of the rancher CLI, by group. For the live catalog -
which also lists the generated get/patch/delete commands for every
kind - run rancher schema; rancher schema <command> shows one command
in detail.
Log in with a token (interactive prompt or --token-stdin, secrets never on the command line); --url adds the entry first when <name> is new, and refuses when <name> is already registered at a different URL. Omitting <name> with --url derives it from the URL's hostname, with the same refuse-on-collision rule. Verifies a pasted/piped token against the server before storing it, with one SelfSubjectReview that also names the token's owner, which the login records (--no-verify skips this and records no owner; not available with the provider sign-in flow, which is already authenticated). Never sets the default profile: only --default does, and only after the credential is stored. --credential-store changes where the directory keeps its credentials, after the new credential is stored: a change takes only this entry's credential, and refuses before the sign-in while another entry still has one in the store being left.
auth set-default-profile [<name>] [--clear]
Set the default profile (for now, the server entry a run uses when it names none with --profile or RANCHER_CLI_PROFILE) or remove it with --clear; it changes the default for every process on the config directory; when the directory has entries and no default, a command that names no profile fails NO_DEFAULT_PROFILE (exit 2)
auth logout [<name>]
Clear the stored login token for the current server, <name>, or every server with --all; keeps server config; deletes the exec-credential cache entries its login made, then revokes on the server the tokens the CLI created and recorded (revoked, notRevoked); records the logout on the entry
auth status
Connectivity + credential preflight (calls the cluster's Kubernetes API); an unfinished credential store change and what it has left
auth get-token
exec-credential plugin (invoked by kubeconfigs, not by hand); with --user-id it hands kubectl only tokens Rancher reports as that user's
auth list-tokens
List cached exec-credential entries (name, server, cluster, token, expiry); the TOKEN column names the token the entry holds
auth delete-token [<name>]
Clear cached exec-credential token(s), then revoke on the server the cluster tokens the CLI created and recorded; idempotent (no match = success)
Servers & configuration
Command
Purpose
config list-servers
List configured servers
config add-server <name> --url <url>
Add a server entry (establishes trust); never sets the default profile and never an upsert (a different URL/CA under an existing name is a conflict); a credential still stored under a name no entry had is removed first, with a warning
config update-server <name>
Change a server's URL or CA without the credential purge delete-server forces; a URL change clears the stored token and exec-credential cache and sends nothing to the old address (the tokens left there are listed under notRevoked: on the moved entry otherServer, manual, never retired by its logins; on another entry still naming the old server, retired by that entry's next login), a CA-only change keeps them
config delete-server <name>
Remove a server and its stored credentials, after revoking on the server the tokens the CLI created and recorded; revoked and notRevoked report each token, with a recovery for one left on the removed entry
config path
Print the resolved config file path (whether or not the file exists yet)
config status
Print config diagnostics: file path, current server, effective credential store and its source, completion settings; token reuse and every entry whose CLI-created tokens are still live, with the commands that revoke them; every entry whose exec-credential cache writes are paused while a change of its credential finishes, with the reason; an unfinished credential store change and what it has left; first stop when tab completion shows no candidates
config edit
Edit the config in $VISUAL/$EDITOR on a validated temp copy - never in place; a change to credentialStore is refused (a login with --credential-store changes it)
config set-completion
Persist live-completion preferences: enable/disable network completion and set the per-TAB HTTP budget (max 2s)
config set-token-reuse
Let the kubectl exec plugin (auth get-token) reuse one login credential per server: on, the first cache miss runs one login and stores an unscoped credential under exec-login-<host>; off (default) restores the per-cluster login and lists the dormant plugin-created logins and how to remove them
The default profile is the config's only session state - cluster and project
scope are explicit flags per invocation. auth set-default-profile is the
migrating target for the legacy server switch command; --profile or
RANCHER_CLI_PROFILE picks a server entry for one run and writes nothing.
Create
Command
Purpose
create project [id]
Create a project with an id you give, or with an id Rancher generates when you pass --display-name and no id; optionally with a resource quota and default container resource limits; Rancher gives the creator the project's creator default roles - dry-run/apply
create namespace <name>
Create a namespace, optionally inside a project from birth - dry-run/apply
create secret <name>
Create a secret: bare namespaced, or project-scoped into the project's backing namespace - dry-run/apply
create resource -f <file|->
Create/apply a resource from a YAML manifest (file or stdin; every byte order mark at the start of the file or stdin is dropped); dry-run/apply
create token
Create a server-side derived token (ext.Token), shown once - sensitive; dry-run/apply --yes
create kubeconfig
Create a server-side, embedded, revocable kubeconfig (ext.Kubeconfig) to stdout, shown once - sensitive; dry-run/apply --yes
create oidc-client <name>
Create an OIDC client for Rancher's embedded OIDC provider; waits for provisioning, prints the initial client secret once with live discovery endpoints - sensitive; dry-run/apply --yes. A Rancher Prime feature; the connected server decides whether it is available.
create user <username> --password-stdin [--global-role <id>]
Create a local user (v3 User), its password secret (cattle-local-user-passwords) and a v3 GlobalRoleBinding for each global role Rancher gives new users by default (newUserDefault), or for each --global-role; password never on the command line - sensitive; a newline inside the password is refused; dry-run/apply --yes. Requires a server that supports local user passwords.
Change a local user's password (ext.cattle.io PasswordChangeRequest); completes synchronously; password never on the command line - sensitive; with --current-password-stdin, stdin holds two lines: line 1 the current password (currentPassword), line 2 the new password; Rancher requires the current password when you change your own password without permission to change every user's password; a newline inside the password is refused; exit 2 when Rancher refuses the current password, exit 6 when you change another user's password without permission to change every user's password; in PowerShell 7.1 or later, pipe the current password and then the new password, $current, $new | rancher create password-change-request <user> --current-password-stdin --password-stdin; you can pipe an ASCII password from Windows PowerShell 5.1 (rancher drops the byte order mark it sends before piped text), and a non-ASCII password after $OutputEncoding = [System.Text.Encoding]::UTF8; by default Windows PowerShell 5.1 sends ? for a non-ASCII character; dry-run/apply --yes. Requires a server that supports local user passwords.
create cluster <name>
Create a provisioning cluster: imported, custom, or node-driver with one machine pool; the settings the Rancher UI form fills in are left unset unless a full manifest sets them, see REFERENCE.md - dry-run/apply
create cloud-credential <driver> <display-name>
Create a cloud credential through Rancher's Norman API, which runs Rancher's credential checks; secret values come only from --from-file, never the command line; waits until the credential is readable; dry-run/apply; details in REFERENCE.md
patch cloud-credential <credential>
Change a cloud credential's fields, display name or description through Rancher's Norman API; secret values come only from --from-file; reads the credential again before the write; dry-run/apply (--yes when it replaces a secret value); details in REFERENCE.md
delete cloud-credential <credential>
Delete a cloud credential through Rancher's Norman API; refused while a provisioning cluster uses it, with a warning for each hosted cluster that uses it and each provisioning cluster that uses it only for etcd snapshots in S3; dry-run/apply --yes; details in REFERENCE.md
create machine-config <kind> <name>
Create a standalone machine config for create cluster --machine-config - dry-run/apply; flag details in REFERENCE.md
Projects & access
Command
Purpose
project add-namespace <ns>
Add a namespace to a project - dry-run/apply
project remove-namespace <ns>
Remove a namespace from its project and remove its project label - dry-run/apply
grant <subject>
Grant a role at project, cluster, or global scope - dry-run/apply --yes
revoke <subject>
Revoke role binding(s) at a scope; omitting --role revokes every role there - destructive; dry-run/apply --yes
OIDC client
Command
Purpose
oidc-client add-secret <client>
Add a new client secret; waits for the controller, shown once - sensitive; dry-run/apply --yes. A Rancher Prime feature; the connected server decides whether it is available.
oidc-client rotate-secret <client> [secret-name]
Regenerate a client secret (name required with more than one secret); shown once - sensitive; dry-run/apply --yes. A Rancher Prime feature; the connected server decides whether it is available.
oidc-client remove-secret <client> <secret-name>
Remove a client secret - destructive; dry-run/apply --yes. A Rancher Prime feature; the connected server decides whether it is available.
See also create oidc-client in Create, which creates the client itself.
Cluster scaling & autoscaling
Command
Purpose
cluster scale <cluster> --pool <name> --nodes <n>
Change the number of nodes in a machine pool; refuses when the machine pool has autoscaling turned on and autoscaling is not paused, or when the cluster has no machine pools - destructive; dry-run/apply --yes
Turn on autoscaling for a machine pool - destructive; dry-run/apply --yes. A Rancher Prime feature; the connected server decides whether it is available.
cluster clear-autoscaling <cluster> --pool <name>
Turn off autoscaling for a machine pool; succeeds and changes nothing when the machine pool has no autoscaling - destructive; dry-run/apply --yes. A Rancher Prime feature; the connected server decides whether it is available.
cluster pause-autoscaling <cluster>
Pause the cluster autoscaler cluster-wide - destructive; dry-run/apply --yes. A Rancher Prime feature; the connected server decides whether it is available.
cluster resume-autoscaling <cluster>
Resume the cluster autoscaler cluster-wide - destructive; dry-run/apply --yes. A Rancher Prime feature; the connected server decides whether it is available.
cluster upgrade <cluster> --k8s-version <version>
Upgrade the Kubernetes version of a provisioned or imported RKE2 or K3s cluster with the version checks of the Rancher UI, and wait until Rancher reports the upgrade done; the preview names the newest etcd snapshot, because the upgrade cannot be reversed with this command - destructive; dry-run/apply --yes
cluster set-upgrade-strategy <cluster>
Set how Rancher upgrades the nodes of a provisioned or imported RKE2 or K3s cluster: the concurrency of control plane and worker nodes and whether Rancher drains them first, with the drain options for a provisioned cluster; the preview is a server dry-run, the command writes the Rancher UI's defaults for the drain options a cluster does not have when it turns drain on, and does not wait for an upgrade - destructive for a provisioned cluster; dry-run/apply --yes, an imported cluster needs --apply only
cluster save-etcd-snapshot <cluster>
Take an etcd snapshot of a provisioned RKE2 or K3s cluster as the Rancher UI does, wait until Rancher reports it taken and list the cluster's snapshots; the command refuses while another operation is in progress on the cluster and while the cluster is not ready - destructive; dry-run/apply --yes
Restore a provisioned RKE2 or K3s cluster from one of its etcd snapshots as the Rancher UI does: Rancher stops Kubernetes on every node and replaces the cluster's etcd data with the snapshot; the command checks the snapshot and --restore-mode (none, kubernetesVersion, all; default: the Rancher UI's default for the snapshot), refuses while another operation is in progress on the cluster and while the cluster is not ready, and waits until Rancher reports the restore finished - destructive; dry-run/apply --yes
See also create cluster in Create and delete provisioning-cluster
for lifecycle; get provisioning-cluster for reads.
Nodes
Command
Purpose
node drain <node> --cluster <cluster>
Ask Rancher to drain a node: Rancher cordons it and evicts its pods through the Eviction API; the preview lists the pods and what the drain does to each; waits until Rancher reports the drain done or failed (--wait=false returns once the server accepts the request) - destructive; dry-run/apply --yes
node stop-drain <node> --cluster <cluster>
Ask Rancher to stop a running drain of a node; the node stays cordoned and evicted pods are not put back; waits until Rancher reports the drain stopped - dry-run/apply
Read nodes with get node --cluster <cluster> and the drain state with
get management-node --cluster <cluster>; see
REFERENCE.md.
Read & inspect
Command
Purpose
get cloud-credential [name]
List cloud credentials or show one - secret values never shown
get kubernetes-versions
List available Kubernetes versions (rke2/k3s), merged with the server's default and supported-range settings
List the charts of a cluster's ClusterRepos from the Helm repository index Rancher serves for each: one line per chart with its newest version that is not a prerelease, or every version in the order Rancher serves them with --all-versions; deprecated versions are left out unless --include-deprecated; disabled ClusterRepos are skipped, and one whose index cannot be read is named in a warning
images
Active-pod container images, grouped by image or owning workload, fleet-wide
usage
Resource usage composite (grouped by --by, filtered by scope flags)
Ask Rancher to install a chart from a ClusterRepo as a Helm release; Rancher fetches the chart and runs Helm in its own pod, and the CLI runs no helm. The preview comes from server reads (previewSource: serverReads) and carries no resourceVersion precondition; values come only from files or stdin and show as paths, never values, except the values the CLI adds and the registry host (for a chart that declares a registry path), which show the value sent; --system-default-registry and --no-system-default-registry set or leave out the registry values. Returns once Rancher accepts the request, with the operation to follow, or with --wait when Helm's run finishes; dry-run/apply. Details in REFERENCE.md
Ask Rancher to upgrade, downgrade or change the values of an installed Helm release shown as an App, through the upgrade action of its ClusterRepo; Rancher runs Helm in its own pod, and there is no rollback. The preview comes from server reads (previewSource: serverReads) and carries no resourceVersion precondition; it lists the path of every value added, removed or changed, never the value (except the values the CLI adds and the registry host), and counts the release's values it sends unchanged; the release's values are read from the release Secret, which needs permission to get Secrets in the release's namespace, and --reset-values sends only your files. The chart is the release's chart; a request that changes nothing is refused. --wait returns when Helm's run finishes, with the revision and status - destructive; dry-run/apply --yes. Details in REFERENCE.md
Ask Rancher to uninstall a Helm release shown as an App, which removes the release's resources; the preview comes from server reads, with no resourceVersion precondition; --wait waits for Helm's run to finish - destructive; dry-run/apply --yes
Extensions
Command
Purpose
extension add-repository <name>
Add one of the two Rancher extension repositories as a ClusterRepo on the local cluster: partner-extensions on every server, rancher-ui-plugins on Rancher Prime. It sends the name, git URL and branch the Rancher UI's Extensions page sends, and nothing else; the command is refused with CONFLICT when a ClusterRepo already reads the same URL. Rancher downloads the repository from github.com after the command; dry-run/apply. Details in REFERENCE.md
extension list
List the extensions the Rancher UI's Extensions page shows: what the ClusterRepos offer and what is installed, with the version each can be upgraded to and, in -o json, why a version is not compatible with the server (--show all|installed|available). Read-only. Details in REFERENCE.md
Install a Rancher UI extension as the Rancher UI's Extensions page does: through the install action of the ClusterRepo that offers it, into the namespace cattle-ui-plugin-system with the chart's name as the release name. Only a version that passes the Rancher UI's checks is installed. The preview comes from server reads (previewSource: serverReads) and carries no resourceVersion precondition; --wait waits for Helm's run to finish; dry-run/apply. Details in REFERENCE.md
Upgrade an installed Rancher UI extension as the Rancher UI's Extensions page does: through the upgrade action of the ClusterRepo the App came from, for the release with the chart's name in the namespace cattle-ui-plugin-system. Only a version that passes the Rancher UI's checks is accepted, and the version that is already installed is refused. The preview comes from server reads (previewSource: serverReads) and carries no resourceVersion precondition; --wait waits for Helm's run to finish - destructive; dry-run/apply --yes. Details in REFERENCE.md
extension uninstall <chart>
Uninstall a Rancher UI extension as the Rancher UI's Extensions page does: through the uninstall action of the App with the chart's name in the namespace cattle-ui-plugin-system, with the empty request the Rancher UI sends. An extension loaded from a URL, which has a UIPlugin and no App, is refused: the Rancher UI uninstalls it. The preview comes from server reads (previewSource: serverReads) and carries no resourceVersion precondition; --wait waits for Helm's run to finish - destructive; dry-run/apply --yes. Details in REFERENCE.md
Access
Command
Purpose
access can <verb> [<resource>[/<name>]]
Ask the cluster's authorizer whether you (or --as a subject) can perform a verb on a resource; exit 0 allowed, 12 denied, 13 unknown
access list
List the rules you (or --as a subject) hold in a namespace as the authorizer reports them; exit 13 when any namespace is incomplete
access who-can <verb> [<resource>[/<name>]]
List the subjects the cluster's bindings name that the authorizer allows to perform a verb on a resource, one SubjectAccessReview each; denied rows with --show-denied; exit 13 when a row has a request issue or is unknown because the authorizer returned an evaluation error
access explain <verb> [<resource>[/<name>]]
Explain the authorizer's decision for one subject, verb, and resource in one namespace: the binding and role the server's reason names, the rules covering the request, and the Rancher chain behind the binding (ClusterRoleTemplateBinding or ProjectRoleTemplateBinding, GlobalRoleBinding and GlobalRole, RoleTemplate inheritance); on deny, the bindings naming the subject or its groups; exit 0 allowed, 12 denied, 13 unknown, never changed by a partial chain
access clusters
List the clusters Rancher lets you (or --as a user) into, as its proxy answers per cluster, beside the management bindings that grant it; exit 13 when any cluster is unknown
access projects [--cluster]
List the projects you (or --as a user) can see into, grouped by cluster: the authorizer's answer to getting each namespace of the project, summarized per project (all, partial, none, unknown), beside the ProjectRoleTemplateBindings that make the subject a member and the cluster or global bindings that reach it without membership; exit 13 when any cluster, project or namespace is unknown
Logs & support
Command
Purpose
logs <target>
Verified-location logs of Rancher components for server/agent/fleet-agent/kube-api-auth/webhook/api-extension
support-bundle
Pack what Rancher's Kubernetes API can reach (logs, cluster/node state, events, settings/features/schema) into one tar.gz for support
kubectl integration
Command
Purpose
token
Legacy exec-credential shim for Rancher-generated kubeconfigs (deprecated; new kubeconfigs use auth get-token)
kubeconfig
Emit a LOCAL exec-credential kubeconfig for a cluster (no embedded secret), with the direct endpoint contexts when the cluster has the Authorized Cluster Endpoint; the exec entry records its config directory and, with --user-id, the owner its login records, and --exec-command names the binary kubectl runs - see create kubeconfig for the server-created, embedded alternative
Telemetry
Command
Purpose
telemetry status
Show whether usage recording is on, what decided it (the RANCHER_CLI_TELEMETRY variable, the telemetry key of config.yaml, or the default), the counts of recorded and dropped events, the contract version and the config directory id; whether this build sends the events that later recorded runs store (a release build sends none, and a development build sends only with an upload endpoint and recording on; a release build prints sending: none - this build sends no event; recorded events stay on this machine, a development build with no endpoint prints sending: none - no upload endpoint is set; recorded events stay on this machine, and -o json has sendsEvents); in a development build with RANCHER_CLI_EXPERIMENT set, also the active experiments and the upload endpoint; a development build sends the stored events of finished hours to that endpoint at most once an hour, after a recorded run, never from the kubectl exec plugin, and with an endpoint status shows the last attempt, the next attempt, the events waiting and the events of the current hour; creates nothing and works while recording is off
telemetry on
Set the telemetry key to true; creates the config directory when it is missing and deletes nothing
telemetry off
Set the telemetry key to false, then delete the recorded events, the server facts, the config directory id and the upload state (the upload lock and the state file in telemetry/upload); creates the config directory when it is missing
telemetry reset
Delete the recorded events, the server facts, the config directory id and the upload state (the upload lock and the state file in telemetry/upload); keeps the telemetry key
telemetry show
List the recorded events, oldest first; the HOUR column is the hour in UTC, the only time an event stores; -o json carries every stored field of each event; in a development build with the telemetryupload experiment, a sent event is listed until the file that holds it is deleted
telemetry upload
Send the stored events of finished hours and of the current hour to the telemetryupload experiment endpoint now, without waiting for the hourly limit; development builds only, at most 30 seconds, never from the kubectl exec plugin; exits 0 whatever the endpoint answered; sent counts every event in a request the endpoint answered with a 2xx, including the ones it refused
Discovery & tooling
Command
Purpose
schema [command|kind|group]
Schema manifest: bare = grouped table of contents; <command>/<kind>/<group> = one card; filter flags search all commands
completion <bash|zsh|fish|pwsh>
Print a shell completion script; -o is ignored, output is always the raw script
skill install
Install the rancher-cli agent skill into coding-agent harnesses (a target that already holds the same files is left untouched and reported unchanged); the command stops with an error when the skill directory is a symbolic link or a Windows directory link (NTFS junction), and with --scope project also when an entry between the working directory and the skill directory is a symbolic link, a Windows directory link (NTFS junction) or anything else that is not a directory; --force does not prevent this error
skill uninstall
Remove the agent skills that rancher-cli installed (a skill directory that rancher-cli did not install is never removed: the command stops with an error and changes no target); a skills directory it leaves empty is removed too; the command stops with an error when the skill directory is a symbolic link or a Windows directory link (NTFS junction), and with --scope project also when an entry between the working directory and the skill directory is a symbolic link, a Windows directory link (NTFS junction) or anything else that is not a directory
skill status
Report, for each harness, the installed skill version and whether its files are unchanged; exits 7 when a selected target is not in the expected state (another version, changed files, content rancher-cli did not install, or missing under --require-installed); the command stops with an error when the skill directory is a symbolic link or a Windows directory link (NTFS junction), and with --scope project also when an entry between the working directory and the skill directory is a symbolic link, a Windows directory link (NTFS junction) or anything else that is not a directory; that error exits 1, not 7
Nouns accept singular, plural, and short aliases (get pod = get pods =
get po). Addressing a namespaced kind by name needs --cluster
(management) or --namespace/-n (downstream); bare lists may omit them.
Every generated get <kind> list takes --selector (-l), a Kubernetes
label selector applied by the server (get pods --selector app=web,tier!=cache);
it cannot be combined with a name.
get, patch and delete of a user, project, roletemplate,
globalrole or nodedriver take the object's id, not its username or
display name. A miss names the id only when the typed text is exactly the
username or display name of one object.
Generated per kind from the 73-kind table: get <kind> (73), patch <kind>
(73), delete <kind> (43 - 42 deletable kinds, including the Rancher role binding
kinds, token, kubeconfig, management-token, user, and oidcclient, plus a provisioning-cluster override) -
189 generated commands, 276 total together with the fixed commands above. The authoritative, always-current list is
rancher schema --all -o json.