$npx -y skills add rudderlabs/rudder-agent-skills --skill rudder-cli-setupInstalls and authenticates rudder-cli. Use when installing rudder-cli, setting up rudder cli, rudder-cli command not found, or authenticating with RudderStack
| 1 | # Rudder CLI Setup |
| 2 | |
| 3 | Install rudder-cli, authenticate with RudderStack, and verify the setup works. |
| 4 | |
| 5 | ## Setup Workflow |
| 6 | |
| 7 | ``` |
| 8 | 1. Check Installation ──► which rudder-cli |
| 9 | │ |
| 10 | ├── Found ──► Skip to Authentication |
| 11 | │ |
| 12 | └── Not Found ──► Install from GitHub Releases |
| 13 | │ |
| 14 | 2. Verify Installation ◄────────────┘ |
| 15 | │ |
| 16 | └── rudder-cli --version |
| 17 | |
| 18 | 3. Check Authentication ──► rudder-cli workspace info |
| 19 | │ |
| 20 | ├── Authenticated ──► Done! Show workspace info |
| 21 | │ |
| 22 | └── Not Authenticated ──► Guide through auth flow |
| 23 | ``` |
| 24 | |
| 25 | ## Step 1: Check if Installed |
| 26 | |
| 27 | ```bash |
| 28 | which rudder-cli |
| 29 | ``` |
| 30 | |
| 31 | **If found:** Skip to Step 3 (Authentication). |
| 32 | |
| 33 | **If not found:** Continue to Step 2 (Installation). |
| 34 | |
| 35 | ## Step 2: Install rudder-cli |
| 36 | |
| 37 | ### Detect Operating System |
| 38 | |
| 39 | ```bash |
| 40 | uname -s |
| 41 | ``` |
| 42 | |
| 43 | - `Darwin` = macOS |
| 44 | - `Linux` = Linux |
| 45 | |
| 46 | ### Download from GitHub Releases |
| 47 | |
| 48 | Go to: https://github.com/rudderlabs/rudder-iac/releases |
| 49 | |
| 50 | Download the appropriate binary for your OS and architecture: |
| 51 | |
| 52 | | OS | Architecture | Binary Name | |
| 53 | |----|--------------|-------------| |
| 54 | | macOS | Intel | `rudder-cli_darwin_amd64` | |
| 55 | | macOS | Apple Silicon | `rudder-cli_darwin_arm64` | |
| 56 | | Linux | x86_64 | `rudder-cli_linux_amd64` | |
| 57 | | Linux | ARM64 | `rudder-cli_linux_arm64` | |
| 58 | | Windows | x86_64 | `rudder-cli_windows_amd64.exe` | |
| 59 | |
| 60 | ### Installation Commands (macOS/Linux) |
| 61 | |
| 62 | ```bash |
| 63 | # Example for macOS Apple Silicon - adjust URL for your platform |
| 64 | # Check latest version at https://github.com/rudderlabs/rudder-iac/releases |
| 65 | |
| 66 | # Download (replace VERSION and BINARY with actual values) |
| 67 | curl -L -o rudder-cli https://github.com/rudderlabs/rudder-iac/releases/download/VERSION/BINARY |
| 68 | |
| 69 | # Make executable |
| 70 | chmod +x rudder-cli |
| 71 | |
| 72 | # Move to PATH (choose one) |
| 73 | sudo mv rudder-cli /usr/local/bin/ # System-wide |
| 74 | # OR |
| 75 | mv rudder-cli ~/.local/bin/ # User-only (ensure ~/.local/bin is in PATH) |
| 76 | ``` |
| 77 | |
| 78 | ### Verify Installation |
| 79 | |
| 80 | ```bash |
| 81 | rudder-cli --version |
| 82 | ``` |
| 83 | |
| 84 | Expected output: Version number (e.g., `rudder-cli version 0.x.x`) |
| 85 | |
| 86 | ## Step 3: Authenticate |
| 87 | |
| 88 | ### Check Current Status |
| 89 | |
| 90 | ```bash |
| 91 | rudder-cli workspace info |
| 92 | ``` |
| 93 | |
| 94 | **If authenticated:** Shows workspace name and ID. You're done! |
| 95 | |
| 96 | **If not authenticated:** Continue with authentication. |
| 97 | |
| 98 | ### Get Access Token |
| 99 | |
| 100 | 1. Log in to your RudderStack dashboard |
| 101 | 2. Go to **Settings → Access Tokens** |
| 102 | 3. Click **Generate New Token** |
| 103 | 4. Copy the token (you won't see it again) |
| 104 | |
| 105 | ### Run Authentication |
| 106 | |
| 107 | ```bash |
| 108 | rudder-cli auth login |
| 109 | ``` |
| 110 | |
| 111 | This prompts for your access token. Paste it when asked. |
| 112 | |
| 113 | ### Verify Authentication |
| 114 | |
| 115 | ```bash |
| 116 | rudder-cli workspace info |
| 117 | ``` |
| 118 | |
| 119 | Expected output: |
| 120 | ``` |
| 121 | Workspace Information: |
| 122 | ID: 2iKXWU4QnqclkpPIfXfsbBqrAVa |
| 123 | Name: My Workspace |
| 124 | ``` |
| 125 | |
| 126 | ## Credential Security |
| 127 | |
| 128 | - **Never echo or log your access token** |
| 129 | - Store tokens in environment variables if needed: `RUDDER_ACCESS_TOKEN` |
| 130 | - Add `.env` files to `.gitignore` |
| 131 | - For CI/CD, use repository secrets |
| 132 | - Rotate tokens periodically in the RudderStack dashboard |
| 133 | |
| 134 | ## Troubleshooting |
| 135 | |
| 136 | | Issue | Solution | |
| 137 | |-------|----------| |
| 138 | | `command not found` after install | Check PATH includes install location | |
| 139 | | `unauthorized` error | Re-run `rudder-cli auth login` with new token | |
| 140 | | Wrong workspace | Token is tied to workspace; generate new token in correct workspace | |
| 141 | | Download fails | Check network; try browser download from releases page | |
| 142 | |
| 143 | ## Next Steps |
| 144 | |
| 145 | After setup completes: |
| 146 | - Run `/rudder-environment-check` to verify full environment |
| 147 | - Start with `/rudder-cli-workflow` for validate → dry-run → apply cycles |