Rancher CLI
Go to file
Andreas Kupries 91b77df57a added separate printout of request id for quick and easy access in case of problems.
also added marker for login origin
2025-09-04 10:43:31 +02:00
.github/workflows Fix panic on `context switch` (#386) (#387) 2024-09-04 15:05:45 +02:00
cliclient [v2.9] Bump dependencies (#377) 2024-07-17 17:41:08 -04:00
cmd added separate printout of request id for quick and easy access in case of problems. 2025-09-04 10:43:31 +02:00
config [2.9] Avoid permissions errors on Windows (#400) 2024-11-26 13:22:26 -05:00
contrib Build rancher/cli image 2017-03-02 21:22:50 -07:00
package [v2.9] Bump Go to 1.23.12 (#460) 2025-08-20 09:26:29 -04:00
scripts [v2.9] Migrate from Drone to Github Actions, remove Dapper and add Darwin/arm64 support (#362) 2024-05-06 12:31:58 +02:00
.dockerignore
.gitignore Call yaml.Unmarshal on values/answers file using YAML 2019-10-03 11:25:49 -07:00
.golangci.json [v2.9] Migrate from Drone to Github Actions, remove Dapper and add Darwin/arm64 support (#362) 2024-05-06 12:31:58 +02:00
CODEOWNERS add codeowners file 2024-05-23 15:18:05 -04:00
LICENSE
Makefile [v2.9] Migrate from Drone to Github Actions, remove Dapper and add Darwin/arm64 support (#362) 2024-05-06 12:31:58 +02:00
README.md Update docker command 2019-11-21 13:39:56 -08:00
go.mod update rancher to v2.9.11 (#465) 2025-08-27 20:14:02 -03:00
go.sum update rancher to v2.9.11 (#465) 2025-08-27 20:14:02 -03:00
main.go Added linter and removed deprecated and unused packages (#357) 2024-04-10 11:52:59 +02:00
main_test.go Reverting to 9ac2118268 2020-11-10 09:03:30 -07:00

README.md

Rancher CLI

The Rancher Command Line Interface (CLI) is a unified tool for interacting with your Rancher Server.

For usage information see: https://rancher.com/docs/rancher/v2.x/en/cli/

Note: This is for version 2.x.x of the cli, for info on 1.6.x see here

Installing

Check the releases page for direct downloads of the binary. After you download it, you can add it to your $PATH or build your own from source.

Setting up Rancher CLI with a Rancher Server

The CLI requires your Rancher Server address, along with credentials for authentication. Rancher CLI pulls this information from a JSON file, cli2.json, which is created the first time you run rancher login. By default, the path of this file is ~/.rancher/cli2.json.

$ rancher login https://<RANCHER_SERVER_URL> -t my-secret-token

Note: When entering your <RANCHER_SERVER_URL>, include the port that was exposed while you installed Rancher Server.

Usage

Run rancher --help for a list of available commands.

Building from Source

The binaries will be located in /bin.

Linux Binary

Run make.

Mac Binary

Run CROSS=1 make build.

Docker Image

Run docker run --rm -it -v <PATH_TO_CONFIG>:/root/.rancher/cli2.json rancher/cli2 [ARGS]. Pass credentials by replacing <PATH_TO_CONFIG> with your config file for the server.

To build rancher/cli, run make. To use a custom Docker repository, do REPO=custom make, which produces a custom/cli image.

Contact

For bugs, questions, comments, corrections, suggestions, etc., open an issue in rancher/rancher with a title prefix of [cli] .

Or just click here to create a new issue.

License

Copyright (c) 2014-2019 Rancher Labs, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.