Installs and authenticates rudder-cli. Use when installing rudder-cli, setting up rudder cli, rudder-cli command not found, or authenticating with RudderStack
19 stars
0 votes
0 copies
5 views
Added August 31, 2026
ai-agentsgoshellbashgitci/cdsecurity
Works with
terminal
cli
Security analysis
F0/100
mediumUses curl or wget to download content
criticalModifies startup scripts or system services for persistence
criticalModifies startup scripts or system services for persistence
criticalModifies startup scripts or system services for persistence
criticalExfiltrates credentials via HTTP — exact pattern from Snyk ToxicSkills study
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Rudder Cli Setup?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/rudderlabs-rudder-cli-setup)
---
name: rudder-cli-setup
description: Installs and authenticates rudder-cli. Use when installing rudder-cli, setting up rudder cli, rudder-cli command not found, or authenticating with RudderStack
allowed-tools: "Bash(which, curl, chmod, uname, rudder-cli *), Read, Write, Edit"
---
# Rudder CLI Setup
Install rudder-cli, authenticate with RudderStack, and verify the setup works.
## Setup Workflow
```
1. Check Installation ──► command -v rudder-cli, then ~/.local/bin
│
├── Found ──► Skip to Authentication
│
└── Not Found ──► Install the latest release into ~/.local/bin
│
2. Verify Installation ◄────────────┘
│
└── rudder-cli --version
3. Check Authentication ──► rudder-cli workspace info --json
│
├── Authenticated ──► Done! Show workspace info
│
└── Not Authenticated ──► rudder-cli auth login (browser sign-in)
or RUDDERSTACK_ACCESS_TOKEN (CI, no browser)
```
## Step 1: Check if Installed
```bash
command -v rudder-cli || ls "$HOME/.local/bin/rudder-cli"
```
**If `command -v` prints a path:** Skip to Step 3 (Authentication).
**If only `~/.local/bin/rudder-cli` exists:** An earlier install put it there, and that folder is not on PATH. Follow "If `~/.local/bin` is not on PATH" below, then skip to Step 3.
**If neither exists:** Continue to Step 2 (Installation).
## Step 2: Install rudder-cli
The command below installs the latest release from [GitHub Releases](https://github.com/rudderlabs/rudder-iac/releases) on macOS or Linux, on x86_64 or arm64 (Linux also on i386). It checks the archive against the release's checksums file, puts `rudder-cli` in `~/.local/bin` without `sudo`, and replaces no copy elsewhere. On Windows, download the `.zip` for your CPU from the [latest release](https://github.com/rudderlabs/rudder-iac/releases/latest) instead.
Never install rudder-cli with npm, npx or Homebrew. No npm package or Homebrew tap ships it, and the npm package named `rudder-cli` belongs to someone else.
### Run the install script
The script is the `install.sh` attached to the latest release. Download it into a new temporary folder, then run it. Do not pipe it into a shell.
```bash
d=$(mktemp -d) && curl -fsSL https://github.com/rudderlabs/rudder-iac/releases/latest/download/install.sh -o "$d/install.sh" && sh "$d/install.sh"
```
### If the script download fails with 404
If curl prints `The requested URL returned error: 404` while it downloads `install.sh`, a release came out in the last few minutes and its files are still uploading. Wait one minute and run the same command again, up to 10 times. Go by that message, not by curl's exit code, which is 22 or 56 for the same 404. If the last try also gets a 404, tell the user that a new rudder-cli release is being published and that they can try again in a few minutes.
A line that starts with `rudder-cli install:` comes from the script, which ran and failed. That is not this 404, even when a curl message comes before it, so do not retry it here; see Troubleshooting.
### If the install cannot write to `~/.local/bin` or reach github.com
Inside an agent's sandbox, the script cannot write to `~/.local/bin`, and curl may not reach github.com. Ask the user to let the command run outside the sandbox or to run it in their own terminal. Never set `RUDDER_CLI_INSTALL_DIR` to a folder inside the project. The binary would land in the user's repository, and `"$HOME/.local/bin/rudder-cli"` would not exist.
### If `~/.local/bin` is not on PATH
After the install, check which rudder-cli a plain `rudder-cli` runs:
```bash
command -v rudder-cli
```
If it prints the path of `~/.local/bin/rudder-cli`, go on. If it prints nothing, `~/.local/bin` is not on PATH. If it prints another path, an older copy comes first on PATH. In both cases:
- Do not stop, and do not ask the user to edit their shell profile or restart you now. The install script prints an `export PATH` line for the profile and says to open a new terminal. That line goes in your closing summary instead.
- For the rest of the session, run `"$HOME/.local/bin/rudder-cli"` wherever this skill or another RudderStack skill says `rudder-cli`. When you ask the user to run a rudder-cli command, such as `rudder-cli auth login`, give it with the full path as well.
- In your closing summary, or in your last message if you stop before it, show the line the user adds to their shell profile (`~/.zshrc`, `~/.bash_profile` for bash on macOS, `~/.bashrc` for bash on Linux, or `~/.profile`) so that a new terminal runs this copy:
```bash
export PATH="$HOME/.local/bin:$PATH"
```
### Verify Installation
```bash
rudder-cli --version
```
Use `"$HOME/.local/bin/rudder-cli" --version` if `~/.local/bin` is not on PATH.
Expected output: Version number (e.g., `rudder-cli version 0.x.x`)
## Step 3: Authenticate
### Check Current Status
```bash
rudder-cli workspace info --json
```
**If authenticated:** Prints the workspace as JSON. `workspaceID` and `name` identify it. You're done!
**If not authenticated:** The command exits non-zero with an error. Continue with authentication.
### Sign in
rudder-cli reads its token from `RUDDERSTACK_ACCESS_TOKEN` when the variable is set. Otherwise it uses the token from the last browser sign-in, which is in the OS keychain, or the token in the config file. The variable wins over both. To change workspace while it is set, the user has to unset it or replace it. A new `auth login` does not override it.
**Browser sign-in.** It needs rudder-cli 2.0.0 or later. `--no-browser`, `--with-token` and `auth logout` also need 2.0.0. `rudder-cli auth login` prints `Confirmation code: K7QM-3XPD` and a sign-in URL, and opens the browser. The user signs in, picks one workspace, types the printed code and clicks Authorize. rudder-cli stores a personal access token for that workspace in the OS keychain. The token never passes through the chat. `rudder-cli auth logout` removes it and tries to revoke it.
The browser has to be on the same machine as rudder-cli, because the sign-in page hands the result back to a port on `127.0.0.1`. Over SSH, in a container or in a remote session, a browser on another machine cannot finish it, so use the fallback.
1. Run `rudder-cli workspace info --json`. If it succeeds, check that `workspaceID` is the workspace the user means, and stop.
2. Start `rudder-cli auth login` once, as a background command whose output you can read while it runs. It prints the code once and then waits up to 5 minutes. If your tool shows output only when the command ends, or stops background commands when the call returns, ask the user to run `rudder-cli auth login` in their own terminal instead and tell you when it is done.
3. Read the output. If there is no `Confirmation code:` line, or the command ends with a read error, stop it and run `rudder-cli --version`. Below 2.0.0, which added browser sign-in, offer to install the latest release. Offer it and do not run it, because 2.0.0 has a breaking data-catalog change. Use the fallback only if the user declines. On 2.0.0 or later, a missing code usually means rudder-cli could not bind `127.0.0.1`, for example in a sandbox that blocks local ports, and it fails with `starting callback listener`. Show the user that error and ask them to run `rudder-cli auth login` in their own terminal.
4. Give the user the code and the URL in chat. The URL always prints. rudder-cli opens no browser on a Linux host with no display, and it can fail to open one without saying so, so the user may have a code and no page. Ask them to sign in, pick the workspace, type the code and click Authorize. Do not start a second login while the first waits, because each run has its own code.
5. Wait for `Signed in to workspace "<name>"`, then run `rudder-cli workspace info --json` and confirm the workspace.
**Fallback: a token in the environment.** Use it in CI, on a host with no keychain or no browser at all, over SSH or in a remote session, or when browser sign-in is not available. A person creates the token in the RudderStack dashboard under **Settings → Access Tokens** with Read-Write access. Never ask the user to paste it into the chat, because any token in a transcript has to be treated as compromised. Ask the user to run one of these in their own terminal. Only the export needs the agent restarted from that shell, because `--with-token` writes the config file:
```bash
# Export it for the shell that starts the agent. read -s keeps the token
# off the screen and out of shell history.
read -rs RUDDERSTACK_ACCESS_TOKEN && export RUDDERSTACK_ACCESS_TOKEN
# Or, with rudder-cli 2.0.0 or later, save it to the config file without
# the keychain. In a terminal it asks for the token without echoing it. In
# CI, pipe it from a secret store: printf '%s' "$TOKEN" | rudder-cli auth login --with-token
rudder-cli auth login --with-token
```
rudder-cli versions below 2.0.0 prompt for a token on `auth login` and read stdin otherwise, so an agent gets a read error and no confirmation code. Offer the upgrade first, as step 3 says.
### Verify Authentication
```bash
rudder-cli workspace info --json
```
Expected output:
```json
{
"dataPlaneURL": "https://example.dataplane.rudderstack.com",
"environment": "PRODUCTION",
"name": "My Workspace",
"region": "US",
"status": "ACTIVE",
"workspaceID": "2iKXWU4QnqclkpPIfXfsbBqrAVa"
}
```
## Credential Security
- **Never echo or log your access token**
- **Never ask the user to paste a token into the chat.** Agents sign in with `rudder-cli auth login`, or read `RUDDERSTACK_ACCESS_TOKEN` in CI
- Browser sign-in keeps the token in the OS keychain. For the fallback, keep it in the `RUDDERSTACK_ACCESS_TOKEN` environment variable
- Add `.env` files to `.gitignore`
- For CI/CD, use repository secrets
- Rotate tokens periodically in the RudderStack dashboard
## Troubleshooting
| Issue | Solution |
|-------|----------|
| `command not found` after install | `~/.local/bin` is not on PATH. Run `"$HOME/.local/bin/rudder-cli"` for the rest of the session, and show the `export PATH` line from Step 2 in the closing summary |
| `unauthorized` error | Check `RUDDERSTACK_ACCESS_TOKEN` first. If it is set in the shell that started the agent, it wins over the saved login, so a new `auth login` changes nothing: the user replaces or unsets it. Otherwise run `rudder-cli auth login` again (Sign in) |
| Wrong workspace | A token is tied to one workspace. If `RUDDERSTACK_ACCESS_TOKEN` is set, it overrides the token that `auth login` saved, so the user replaces or unsets it. Otherwise run `rudder-cli auth login` and pick the right workspace |
| Download fails | A 404 for `install.sh` right after a release means its files are still uploading; wait a minute and run the command again, up to 10 times (Step 2). Otherwise check the network |
| `rudder-cli install: cannot write to ...` | Inside an agent's sandbox, ask the user to run the command outside it (Step 2). Never set `RUDDER_CLI_INSTALL_DIR` to a folder inside the project |
| `checksum mismatch` | The script installs nothing. Run the command again once; if it fails the same way, stop and tell the user |
## Next Steps
After setup completes:
- Run `/rudder-environment-check` to verify full environment
- Start with `/rudder-cli-workflow` for validate → dry-run → apply cycles