|
This is unreleased documentation for SUSE® Rancher Manager v2.16 (Unreleased). |
SUSE Rancher Prime CLI
|
SUSE Rancher Prime CLI is an experimental feature released separately from Rancher. Please be aware that commands, flags and output can change between releases. It is available for Rancher v2.14 and later. For information on the legacy SUSE Rancher Prime CLI, refer to the documentation and legacy CLI migration section. |
The SUSE Rancher Prime CLI provides a structured, self-describing command-line interface for managing SUSE Rancher Prime resources and powering interactive terminal coding agent sessions.
Built supporting AI-native workflows, it features structured JSON/YAML output for easy programmatic parsing and explicit plan/apply safety controls to preview and confirm infrastructure changes before execution. This page serves as a reference overview for the SUSE Rancher Prime CLI including installation instructions, command reference, and usage examples. Refer to the CLI Releases and Developer documentation for contribution guidelines, architecture and further design details.
Installation
Installation scripts are available to download binaries, verify cryptographic checksums, validate build provenance, and set up the Rancher CLI and its credential helper (rancher-credential-vault) into a rootless directory without requiring administrator privileges.
Run the installation script directly from your terminal:
|
Install Paths
Ensure your target destination binary path is included in your system’s |
-
Linux / macOS
-
Windows
curl --proto '=https' --tlsv1.2 -fsSL https://raw.githubusercontent.com/rancher/rancher-cli/main/install.sh | sh
irm https://raw.githubusercontent.com/rancher/rancher-cli/main/install.ps1 | iex
Installation Security
The installation scripts enforce multiple layers of verification and safety controls to ensure operational integrity:
-
Cryptographic Integrity: Downloaded binaries are always verified against official
SHA256SUMShashes before execution. -
Build Provenance & Attestations: When an authenticated GitHub CLI (
gh) is detected on your system, the installer verifies signed GitHub Build Attestations against the official repository workflow (rancher/rancher-cli/.github/workflows/release.yaml). Note the minimum version ofghneeded is v2.68.0. You can enforce build verification as mandatory by passing--verify-attestation(or-VerifyAttestationon Windows). -
Atomic Version Swapping: Binaries for
rancherandrancher-credential-vaultare unpacked into versioned subdirectories. The active version is switched atomically using symlinks (Linux/macOS) or NTFS junctions (Windows). Upgrades, rollbacks, and installs ensure both binaries update simultaneously and in turn prevent version mismatch states. -
Truncation Protection: The installation script logic is encapsulated inside a wrapper function invoked on the script’s final line. If a network interruption truncates the download mid-stream, the script will raise a syntax error or fail to execute entirely rather than running partial commands.
-
Audit Receipt: Successful installations write an audit receipt to
install-receipt.json(located at~/.config/rancher-cli/on Linux/macOS or%APPDATA%\rancher-cli\on Windows), tracking installed assets and metadata.
Installation Options
Below are the options for customizing the Rancher CLI installation. You can pass flags into the installer pipe (… | sh -s — <flags>) or as PowerShell parameters (iex "& { $(…) } <parameters>"). No GitHub token is needed. When a GH_TOKEN or GITHUB_TOKEN is set, or gh is logged in, the installer uses that token, which raises the GitHub API rate limit for --pre lookups.
Installation Options
| Flag (POSIX) | Parameter (PowerShell) | Description |
|---|---|---|
|
|
Installs a specific version. (Env twin: |
|
|
Selects the newest prerelease. Linux and macOS: |
|
|
Overrides the install directory. (Env twin: |
|
|
Makes build provenance verification mandatory. |
|
|
Prints the installation plan without modifying disk. |
|
|
Suppresses progress notes. |
Manual Installation and Verification
Follow the steps outlined below for manual installation and verification of the SUSE Rancher Prime CLI depending on your operating system.
Linux and macOS
-
Download the latest release for your operating system and architecture:
rancher-<os>-<arch>,rancher-credential-vault-<os>-<arch>(both with.exeon Windows) andSHA256SUMS. -
Check each binary against its line in
SHA256SUMS. On Linux:grep ' rancher-linux-amd64$' SHA256SUMS | sha256sum -c - grep ' rancher-credential-vault-linux-amd64$' SHA256SUMS | sha256sum -c -On macOS use
shasum -a 256 -c -in place ofsha256sum -c -. Each command prints<name>: OK. -
Optional: verify the build provenance with the GitHub CLI (2.68.0 or newer; it needs
gh auth login), for each of the two binaries:gh attestation verify rancher-linux-amd64 --repo rancher/rancher-cli \ --cert-identity https://github.com/rancher/rancher-cli/.github/workflows/release.yaml@refs/tags/<tag> \ --source-ref refs/tags/<tag>Use the tag you downloaded if you are verifying a different release (for example
v0.1.0-beta.1).The attestations cover the binaries, their software bill of materials (SBOM) files,
rancher-schema.json,install.shandinstall.ps1.SHA256SUMShas no attestation and does not list the SBOMs or the Sigstore bundles. It protects only against a damaged download.Each binary also has an SPDX 2.3 SBOM,
<binary>.spdx.json(for examplerancher-linux-amd64.spdx.json), which Syft writes from the Go modules built into the binary. Its digest is in the build provenance and in its own attestation. To verify that the release workflow (release.yaml) attested an SBOM for a binary:gh attestation verify rancher-linux-amd64 --repo rancher/rancher-cli \ --cert-identity https://github.com/rancher/rancher-cli/.github/workflows/release.yaml@refs/tags/<tag> \ --source-ref refs/tags/<tag> \ --predicate-type https://spdx.dev/Document/v2.3To verify without a GitHub login, also download the Sigstore bundle files. Each holds one attestation and its signature:
provenance.sigstore.jsonfor the build provenance and<binary>.sbom.sigstore.jsonfor the SBOM of each binary. Withcosign(flags as of cosign v3.1.4):cosign verify-blob-attestation \ --bundle rancher-linux-amd64.sbom.sigstore.json \ --type https://spdx.dev/Document/v2.3 \ --certificate-identity https://github.com/rancher/rancher-cli/.github/workflows/release.yaml@refs/tags/<tag> \ --certificate-oidc-issuer https://token.actions.githubusercontent.com \ rancher-linux-amd64For the build provenance use
--bundle provenance.sigstore.jsonand--type https://slsa.dev/provenance/v1. That bundle names every file the provenance covers; the last argument can be any of them. Give the whole URL as the type. The short namesspdxandspdxjsonstand for a type without a version, and the type of these SBOM attestations has one (v2.3). -
Rename the two downloads to
rancherandrancher-credential-vault, make both binaries executable (chmod +xon Linux and macOS) and put them in one directory onPATH. Both names matter: the CLI runs a credential helper asrancher-credential-<name>, and kubectl runs a kubeconfig’s exec plugin asrancher.
Windows
-
Download the
windowsassets from the latest release: the CLI binary andrancher-credential-vault. -
Rename them to
rancher.exeandrancher-credential-vault.exe. Both names matter and need to be changed: kubectl runs the kubeconfig’s exec plugin as the commandrancherunlessrancher kubeconfig --exec-commandsets another, and the CLI runs a credential helper asrancher-credential-<name>. On Windows, a program started by name is found only onPATHand only with an extension listed inPATHEXT(.exe). -
Verify both binaries against
SHA256SUMS(PowerShell).rancher-credential-vault.exematters as much asrancher.exe, it is the process that stores your Rancher credentials and holds your Vault token, never install them unverified:Get-FileHash rancher.exe -Algorithm SHA256 Get-FileHash rancher-credential-vault.exe -Algorithm SHA256Compare each output against its matching line in
SHA256SUMS. -
Optionally verify build provenance for both:
gh attestation verify rancher.exe --repo rancher/rancher-cli --cert-identity https://github.com/rancher/rancher-cli/.github/workflows/release.yaml@refs/tags/<tag> --source-ref refs/tags/<tag>Run the above with the tag you downloaded (for example
v0.1.0-beta.1), then run the same command usingrancher-credential-vault.exeinstead ofrancher.exeto verify. The SBOMs, Sigstore bundles, and the commands that verify them are the same as in Linux and macOS however replacerancherwithrancher.exeandrancher-credential-vaultwithrancher-credential-vault.exe. -
Only after both binaries verify should you place them in a directory on
PATH.
|
Notepad on Windows 11
On Windows 11, the Store version of Notepad opens `config edit’s temp file as a new tab in an already-running Notepad window rather than a new window; close the tab, not the window, to return control to the CLI. |
Managing the Installation
Options for managing the Rancher CLI installation:
-
Updating the Version: Re-run the installation command. The installer resolves to the latest release and performs an atomic binary swap.
-
Rollback the Version: Re-run the installation script specifying the targeted version:
--version <tag>(or-Version <tag>). -
Uninstall (Linux or macOS): Remove the
rancherandrancher-credential-vaultsymlinks from your bin directory, then remove~/.local/share/rancher-cliand~/.config/rancher-cli/install-receipt.json. -
Uninstall (Windows): Remove
%LOCALAPPDATA%\rancher-cli,%APPDATA%\rancher-cli\install-receipt.json, and remove the binary directory from yourPATH.
Platforms and Credential Stores
The SUSE Rancher Prime CLI is distributed as a static binary running across macOS, Linux (including musl/distroless distros), and Windows.
| Platform | Config Directory (Default) | Primary Credential Store (Default) | File Fallback |
|---|---|---|---|
macOS |
|
Keychain |
|
Linux |
|
Secret Service (D-Bus; fallback when headless) |
|
Windows |
|
Credential Manager |
Owner-only-ACL file |
Config directory resolution follows this precedence: --config flag (-c) > RANCHER_CLI_CONFIG_DIR > $XDG_CONFIG_HOME/rancher (or default).
Store Declaration and Isolation
The credential backend belongs to the configuration directory, not the process:
-
Directory Declaration: The first login records the chosen store in
config.yaml(credentialStore: keychain|file|auto|exec:<name>). From that point, all processes operating on that directory use that declared store. -
Environment Override Rule:
RANCHER_CLI_CREDENTIAL_STOREsets the store for an un-declared directory (e.g., CI runs). If set on a directory that already declared a different store, the CLI exits with aVALIDATIONerror to prevent cross-backend token leakage. -
Auto-Probing: On fresh directories defaulting to
auto, the first login probes the OS keychain and pins the backend. In headless environments or CI where native keychains are unavailable, it automatically pins to thefilestore. On headless/CI setups, setRANCHER_CLI_CREDENTIAL_STORE=fileexplicitly prior to initial login.
Changing Credential Stores
To migrate an existing directory to a different backend:
rancher auth login <name> --credential-store keychain|file|auto|exec:<name>
|
Credential Helpers
The Rancher CLI can delegate token storage to external program credential helpers so tokens reside in enterprise secret infrastructure (e.g., HashiCorp Vault, OpenBao, 1Password, or pass).
Configuration
To configure a helper, set the credentialStore in config.yaml:
credentialStore: exec:vault
Or pass RANCHER_CLI_CREDENTIAL_STORE=exec:vault on an undeclared config directory. The name following exec: must match ^[a-z0-9][a-z0-9-]*$. The CLI invokes the binary named rancher-credential-<name> found on your system PATH.
|
There is no fallback. If the helper binary is missing or fails, execution halts with the helper’s error message. Set |
HashiCorp Vault and OpenBao Helper
The CLI ships with rancher-credential-vault, an official helper for HashiCorp Vault and OpenBao.
Environment configuration parameters:
| Environment Variable | Default | Purpose |
|---|---|---|
|
(Required) |
Vault or OpenBao API address URL. |
|
|
Vault authentication token. |
|
|
KV v2 secrets engine mount path. |
|
|
Path prefix under the mount where credentials are stored. |
Credentials are stored as KV v2 secrets at <mount>/data/<path>/sha256hex(serverURL + "\n" + name) where the following required vault policy paths must be set:
|
The policy paths change with |
path "secret/data/cli.rancher.io/*" { capabilities = ["create", "update", "read"] }
path "secret/metadata/cli.rancher.io/*" { capabilities = ["delete"] }
Protocol Specification (Version 1)
Custom helpers implement a JSON protocol over standard input/output. The CLI invokes rancher-credential-<name> <verb> with verbs get, store, or erase.
-
Invocation: One JSON request body on
stdin; expects one JSON response onstdout. -
Errors: Exit non-zero on failure with a clear error message on
stderr. -
Timeout: The CLI enforces a 30-second timeout per call.
| Verb | Request Fields | Response Format / Behavior |
|---|---|---|
|
|
|
|
|
Exit 0 with empty JSON or |
|
|
Exit 0. Idempotent deletion. Optional |
Command Output and Execution Controls
All command outputs use enveloped JSON, YAML, or tabular formatting (-o table|json|yaml, plus -o name to output resource IDs only). Tabular formatting is the default for interactive shell sessions.
Mutating commands require explicit flags to write changes, there are no implicit writes:
-
Pass
--applyto execute state-changing or mutating operations. -
Pass
--yes(alongside--apply) to execute destructive operations.
To inspect the full command surface, including available flags, API contracts, and stability levels without checking external documentation, execute the following command:
rancher schema
Safety Model
Every command that changes the server runs these steps, in order:
|
|
-
--dry-runpreviews the change (the action, the fields the command sets or changes, and warnings) and changes nothing. The preview succeeds only if the server-side dry-run succeeds. -
--applyexecutes. A command that changes the server, run with neither--dry-runnor--apply, is refused withCONFIRMATION_REQUIRED, and the refusal names the exact flags required. -
--yesis required together with--apply(never alone) when the change is destructive: everydeleteandrevoke, writes to sensitive kinds, and creating secrets that are shown only once (create token,create kubeconfig). -
--allow-deprecatedis required for a write whose stability isdeprecated. -
Updates and deletes carry a
resourceVersionprecondition taken from their own dry-run preview: if the resource changes between that preview and the apply, the change fails (exit5) instead of overwriting it. A--dry-runrun on its own is a preview only; the later--applyrun takes a new dry-run preview and sets its precondition from the resource as it is at that time. Creating an object has no precondition (there is no existing object to check).A
deletealso waits until the object is gone, for up to 5 minutes by default (--timeout).--wait=falsereturns once the server accepts the request and printsdeletion started.
Most commands carry a contract (public | internal) and a stability (stable/beta/deprecated), shown in the schema manifest. For more detail on all the steps and gates in full refer to the architecture and read-only mode documentation.
Output
Nearly every command prints one JSON document per run under -o json, versioned by apiVersion, that agents can depend on (note the exceptions):
{
"apiVersion": "cli.rancher.io/v1",
"kind": "LoginResult",
"data": { "server": "prod", "url": "https://rancher.example.com" },
"warnings": []
}
Format options:
-
-o table(default) -
-o wide -
-o json -
-o yaml -
-o name -
-o template=<go-template>
For more information refer to the full format semantics.
Exit Codes
-
Errors have the same shape as a success: under
-o json/-o yamlthey are the same document, with the error object underdata, and any warnings go in the document’s ownwarningsarray. Use-o jsonto get the document, errors included:{ "apiVersion": "cli.rancher.io/v1", "kind": "Error", "data": { "error": { "code": "NOT_LOGGED_IN", "message": "...", "hint": "rancher auth login 'prod'", "retryable": false } } }Every other format, including the default, prints a short text message on
stderrinstead:error (NOT_LOGGED_IN): ... hint: rancher auth login 'prod' -
Exit codes (act on the code without parsing output):
-
0ok -
2usage/validation -
3auth -
4not-found -
5conflict/precondition -
6RBAC -
8lock-timeout -
9Prime required -
10TLS trust -
11capability unsupported -
14credential store unavailable -
130interrupted -
1generic; reference for every code with its meaning.Ctrl-C or a termination signal ends the command with
INTERRUPTED, exit130for either; a second signal forces a command that did not stop on the first to exit with 128 plus that signal’s own number (130Ctrl-C,143SIGTERM).
-
-
Discovery:
rancher schema -o jsonis the overview - commands, kinds, and exit codes as a compact table of contents;rancher schema --all -o jsonis the complete manifest, and the single source for contract and stability.rancher schema <command|kind|group>shows only that command, kind or group.
rancher kubeconfig
rancher kubeconfig --cluster <id-or-name> emits a bare kubeconfig YAML document to stdout. Its user entry runs rancher auth get-token as a kubectl exec-credential plugin, so no long-lived token is ever written to disk, only the CLI’s own short-lived cache. It replaces the legacy kubectl passthrough’s purpose; the Rancher CLI itself does not wrap kubectl.
|
PATH note
The exec stanza runs |
Example command merging into your default kubeconfig (the command only writes to stdout, it never touches ~/.kube/config):
KUBECONFIG=~/.kube/config:<(rancher kubeconfig --cluster X) kubectl config view --flatten > merged && mv merged ~/.kube/config
If a rancher binary does not exist on the target machine, then the rancher kubeconfig exec mode is not the only option. The command rancher create kubeconfig [--clusters …] --apply --yes creates a server-side, embedded, revocable kubeconfig that is the same as the Dashboard’s Download KubeConfig option, which does not need a local rancher binary to authenticate. The output goes to stdout, with a shown-once notice on where its server-assigned name is.
--wait on named get
rancher get <kind> <name> --wait [--for state=<value>|condition=<Type>[=<Status>]] [--timeout <duration>] replaces the legacy standalone wait command. Unlike kubectl wait, it fails fast on a Rancher-reported provisioning error instead of going through the full timeout.
For anything --wait doesn’t cover well (arbitrary JSONPath conditions, non-Rancher resources), use kubectl wait via rancher kubeconfig. --for state=<value> matches status.state (the Rancher idiom); for kinds that carry no status.state (core kinds like Pod), it falls back to status.phase instead, compared case-insensitively.
Shell Completion
The Rancher CLI generates shell completion scripts for bash, zsh, fish, and PowerShell (pwsh).
Setup and Configuration
Load completions for your preferred shell:
-
Bash
-
Zsh
-
Fish
-
PowerShell
# Load into the current session:
source <(rancher completion bash)
# Persist to shell profile:
echo 'source <(rancher completion bash)' >> ~/.bashrc
# Load into the current session:
source <(rancher completion zsh)
# Persist to shell profile:
echo 'source <(rancher completion zsh)' >> ~/.zshrc
# Persist directly to fish completions directory:
rancher completion fish > ~/.config/fish/completions/rancher.fish
# Load into the current session:
rancher completion pwsh | Out-String | Invoke-Expression
# Persist to PowerShell profile (requires an ExecutionPolicy allowing local scripts, e.g., RemoteSigned):
Add-Content -Path $PROFILE -Value 'rancher completion pwsh | Out-String | Invoke-Expression'
Static vs. Live Completion Modes
The CLI supports two completion modes:
-
Static Completion (Default): Offline-only mode. It completes all command, group, and flag names, resource kind aliases (
po→po,pod,pods), and configured server entries from your local config file. It never issues network requests, never prompts, and degrades silently without throwing errors if the configuration file is missing or invalid. -
Live Completion (Opt-In): Queries the Rancher API dynamically to complete live resource targets such as cluster names, project names, namespaces, pods, deployments, nodes, users, and role templates.
To enable live resource-name completion:
rancher config set-completion --network=true
To configure the per <TAB> HTTP network budget limit (defaults to 500ms):
rancher config set-completion --timeout=1s
|
Shell Compatibility and Tooltip Descriptions
|
Troubleshooting
When live completion encounters a failure such as an expired session token or network timeout, it degrades silently to offer no candidates rather than interrupting shell output with error messages.
To trace and debug completion behavior, set RANCHER_CLI_COMPLETION_DEBUG=1 and invoke the internal completion entry point directly:
-
Linux / macOS
-
Windows (PowerShell)
RANCHER_CLI_COMPLETION_DEBUG=1 rancher --rancher-completion-proto=2 get cluster --rancher-completion-cur= --generate-shell-completion
$env:RANCHER_CLI_COMPLETION_DEBUG = "1"
rancher --rancher-completion-proto=2 get cluster --rancher-completion-cur= --generate-shell-completion
CLI Quickstart
Once installed an example workflow is authenticating your session, verifying connectivity, and inspecting available resources:
-
Log in to Rancher Manager using a Rancher API key (formatted as
<access-key>:<secret-key>):# Interactive prompt for API key input: rancher auth login prod --url https://rancher.example.com # Non-interactive / pipeline pass: echo "<access-key>:<secret-key>" | rancher auth login prod --url https://rancher.example.com --token-stdin -
Verify credentials and connection status:
rancher auth status -
Inspect available clusters:
rancher get clusters -
Preview and apply state changes:
# Compute a server-side preview of the change: rancher create project web --cluster c-m-abc123 --dry-run # Execute the mutation: rancher create project web --cluster c-m-abc123 --apply -
Discover available commands and inspect the schema for a specific command:
rancher schema # Display top-level command TOC rancher schema delete project # Show contract and flags for a specific command rancher schema pod # Inspect supported verbs and routing for a resource kind rancher schema --search kubeconfig # Find relevant commands by substring rancher schema --all -o json # Output complete programmatic manifest (for agents)
Agent Skill Integration
The Rancher CLI includes a built-in skill specification based on the open Agent Skills standard. This teaches AI coding agents (such as Claude Code, Codex, or GitHub Copilot CLI) how to navigate authentication, command discovery, the dry-run/apply safety loop, structured error handling, and resource wait conditions automatically.
To install the agent skill into your local AI environment:
rancher skill install
Alternatively, point your coding agent’s custom instructions or prompt files directly to the bundled skills/rancher/SKILL.md file within the repository.
Commands
The following commands are available in SUSE Rancher Prime CLI as of release v0.1.0-beta.2. For the live catalog, which also lists the generated get <kind>, patch <kind> and delete <kind> commands, run rancher schema; rancher schema <command> shows one command in detail. Refer to the CLI reference for further architectural details.
Authentication
| Command | Purpose |
|---|---|
|
Log in with a token (interactive prompt or |
|
Clear the stored login token for the current server, |
|
Connectivity and credential preflight (calls the cluster’s Kubernetes API); an unfinished credential store change and what it has left. |
|
exec-credential plugin (invoked by kubeconfigs, not by hand); with |
|
List cached exec-credential entries (name, server, cluster, token, expiry); the TOKEN column names the token the entry holds. |
|
Clear cached exec-credential token(s), then revoke on the server the cluster tokens the CLI created and recorded; idempotent (no match = success). |
Servers and Configuration
|
The server pointer is the config’s only session state, cluster and project scope are explicit flags per invocation. |
| Command | Purpose |
|---|---|
|
List configured servers. |
|
Switch the current server. |
|
Add a server entry (establishes trust); bootstraps the current server if unset - 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. |
|
Change a server’s URL or CA without the credential purge |
|
Remove a server and its stored credentials, after revoking on the server the tokens the CLI created and recorded. Reports each token as |
|
Print the resolved config file path (whether or not the file exists yet). |
|
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. |
|
Edit the config in |
|
Persist live-completion preferences: enable/disable network completion and set the per-TAB HTTP budget (max 2s). |
|
Control whether the kubectl exec plugin ( |
Create
| Command | Purpose |
|---|---|
|
Create a project with an id you give, or with an id Rancher generates when you pass |
|
Create a namespace, optionally inside a project from birth - dry-run/apply. |
|
Create a secret: bare namespaced, or project-scoped into the project’s backing namespace - dry-run/apply. |
|
Create/apply a resource from a YAML manifest (file or stdin); dry-run/apply. |
|
Create a server-side derived token (backed by the Rancher |
|
Create a server-side, embedded, revocable kubeconfig (backed by the Rancher |
|
(Rancher Prime Feature): 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 a local user (Rancher |
|
Change a local user’s password via a synchronous |
|
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 - dry-run/apply. |
|
Create a standalone machine config for |
Projects and Access
| Command | Purpose |
|---|---|
|
Add a namespace to a project - dry-run/apply. |
|
Remove a namespace from its project and remove its project label - dry-run/apply. |
|
Grant a role at project, cluster, or global scope - dry-run/apply --yes. |
|
Revoke role binding(s) at a scope; omitting |
OIDC Client
|
See also |
| Command | Purpose |
|---|---|
|
(Rancher Prime Feature): 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. |
|
(Rancher Prime Feature): 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. |
|
(Rancher Prime Feature): Remove a client secret - destructive; dry-run/apply --yes. A Rancher Prime feature; the connected server decides whether it is available. |
Cluster Scaling and Autoscaling
|
See also Refer to the Prime documentation for details on cluster autoscaling and machine pool management. |
| Command | Purpose |
|---|---|
|
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. |
|
(Rancher Prime Feature): Turn on autoscaling for a machine pool - destructive; dry-run/apply --yes. A Rancher Prime feature; the connected server decides whether it is available. |
|
(Rancher Prime feature): 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. |
|
(Rancher Prime feature): Pause the cluster autoscaler cluster-wide - destructive; dry-run/apply --yes. A Rancher Prime feature; the connected server decides whether it is available. |
|
(Rancher Prime feature): Resume the cluster autoscaler cluster-wide - destructive; dry-run/apply --yes. A Rancher Prime feature; the connected server decides whether it is available. |
|
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. |
|
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. |
Nodes
| Command | Purpose |
|---|---|
|
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 ( |
|
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 and Inspect
| Command | Purpose |
|---|---|
|
List cloud credentials or show one - secret values never shown. |
|
List available Kubernetes versions (RKE2/K3s), merged with the server’s default and supported-range settings. |
|
Composite cluster read: identity, connectivity, provisioning, machine pools, members, machines, registration commands (node command and import command; gated behind |
|
Composite pod read: describe and recent logs. |
|
Composite deployment read. |
|
Composite project read: project, namespaces, members, resource quota, usage. |
|
Composite user read: id and names, groups, and role bindings at global, cluster and project level - bindings that exist only, never permissions. |
|
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 |
|
Active-pod container images, grouped by image or owning workload, Fleet-wide. |
|
Resource usage composite (grouped by |
Apps
| Command | Purpose |
|---|---|
|
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 |
|
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. Like |
|
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; |
Access
| Command | Purpose |
|---|---|
|
Ask the cluster’s authorizer whether you (or |
|
List the rules you (or |
|
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 |
|
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. |
|
List the clusters Rancher lets you (or |
|
List the projects you (or |
Logs and Support
| Command | Purpose |
|---|---|
|
Verified-location logs of Rancher components for |
|
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 |
|---|---|
|
Legacy exec-credential shim for Rancher-generated kubeconfigs; (Deprecated; new kubeconfigs use |
|
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 |
Telemetry
| Command | Purpose |
|---|---|
|
Show whether local usage recording is enabled and what determined it (the |
|
Set the |
|
Set the |
|
Delete the recorded events, the server facts, the config directory id and the upload state; keeps the |
|
List the recorded events, oldest first; the HOUR column is the hour in UTC, the only time an event stores; |
Discovery and Tooling
| Command | Purpose |
|---|---|
|
Schema manifest: bare = grouped table of contents; |
|
Print a shell completion script; |
|
Install the rancher-cli agent skill into coding-agent harnesses (a target that already holds the same files is left untouched and reported |
|
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 |
|
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). |
Limitations
What the app install command does not do. The Rancher UI does more in one install:
-
Upgrade.
app installrefuses a release name that already has an App (CONFLICT). To change a release, userancher app upgrade. -
A chart that names another chart to install first (rancher-monitoring is an example). The UI installs the dependency chart in the same request, in the same namespace, with the main chart’s
globalvalues.app installrefuses such a chart; install it from the Rancher UI. -
The namespace. The CLI refuses a namespace that does not exist, before it sends anything; the UI creates the namespace when it does not exist.
-
Pull secrets. For a repo with
defaultImagePullSecrets, the UI offers a pull secret and setsglobal.imagePullSecretsto the one chosen; for a SUSE Application Collection repository it can create the secret from the repository’s credentials. The CLI creates none.