Automated setup scripts for Linux and macOS systems.
| OS | Package Manager | Status |
|---|---|---|
| Debian/Ubuntu | apt |
✓ Full support |
| CentOS/RHEL | yum/dnf |
✓ Full support |
| Fedora | dnf |
✓ Full support |
| Arch Linux | pacman |
✓ Full support |
| macOS | brew |
✓ Full support (see macOS notes) |
All scripts are idempotent — safe to run multiple times. Already installed components are skipped automatically. Requires
curl,git, andsudo(except some macOS operations).
Use install.sh for a one-stop interactive or non-interactive installation.
Note: After installation, the
rigCLI will be automatically installed to~/.local/bin/rig. You can then use commands likerig status,rig export,rig uninstall, etc. See Management Tools for details.
Interactive TUI — select what to install:
curl -fsSL https://ba.sh/rig | bash
# or: curl -fsSL https://raw.githubusercontent.com/X-Zero-L/rig/master/install.sh | bashVia proxy (recommended for China):
curl -fsSL https://z.ls/rig | bash -s -- --gh-proxy https://gh-proxy.org
# or: curl -fsSL https://gh-proxy.org/https://raw.githubusercontent.com/X-Zero-L/rig/master/install.sh | bash -s -- --gh-proxy https://gh-proxy.org💡 China users: For the best experience, install Clash first — the setup script adds
clashctlandwatch_proxyto your shell rc, so proxy env vars are automatically active in every new terminal. Once Clash is running (clashctl on), all subsequent rig scripts work withoutGH_PROXY.curl -fsSL https://gh-proxy.org/https://raw.githubusercontent.com/X-Zero-L/rig/master/setup-clash.sh | bash -s -- 'https://your-subscription-url' # Then enable proxy: source ~/.bashrc && clashctl on
Install everything non-interactively:
curl -fsSL https://raw.githubusercontent.com/X-Zero-L/rig/master/install.sh | bash -s -- --allSpecific components only:
curl -fsSL https://raw.githubusercontent.com/X-Zero-L/rig/master/install.sh | bash -s -- --components shell,node,dockerWith pre-configured API keys:
export CLAUDE_API_URL=https://your-api-url CLAUDE_API_KEY=your-key
export CODEX_API_URL=https://your-api-url CODEX_API_KEY=your-key
export GEMINI_API_URL=https://your-api-url GEMINI_API_KEY=your-key
curl -fsSL https://raw.githubusercontent.com/X-Zero-L/rig/master/install.sh | bash -s -- --allVerbose mode (show raw script output instead of spinner):
curl -fsSL https://raw.githubusercontent.com/X-Zero-L/rig/master/install.sh | bash -s -- --all --verboseAvailable components: shell, tmux, git, clash, node, uv, go, docker, tailscale, ssh, claude-code, codex, gemini, skills
New: Use presets for common setups:
# AI agent development (shell, tools, git, node, claude-code, codex, gemini, skills)
curl -fsSL https://ba.sh/rig | bash -s -- --preset agent
# See all presets: minimal, agent, devops, fullstack
# Docs: https://github.com/X-Zero-L/rig/blob/master/docs/rig-management.mdEach script can also be run standalone. All scripts support two install styles — direct and via gh-proxy:
curl -fsSL https://raw.githubusercontent.com/X-Zero-L/rig/master/<script> | bashcurl -fsSL https://gh-proxy.org/https://raw.githubusercontent.com/X-Zero-L/rig/master/<script> | bashInstalls zsh, Oh My Zsh, plugins (autosuggestions, syntax-highlighting, z), Starship prompt with Catppuccin Powerline preset. Requires sudo.
curl -fsSL https://raw.githubusercontent.com/X-Zero-L/rig/master/setup-shell.sh | bashVia proxy:
curl -fsSL https://gh-proxy.org/https://raw.githubusercontent.com/X-Zero-L/rig/master/setup-shell.sh | bashInstalls tmux, TPM plugin manager, Catppuccin theme, and essential plugins (sensible, vim-tmux-navigator, yank, resurrect, continuum). Requires sudo.
Default (no custom keybindings):
curl -fsSL https://raw.githubusercontent.com/X-Zero-L/rig/master/setup-tmux.sh | bashWith custom keybindings (Ctrl+a prefix, | and - splits, vim-style resize):
export TMUX_KEYBINDS=1
curl -fsSL https://raw.githubusercontent.com/X-Zero-L/rig/master/setup-tmux.sh | bashVia proxy:
curl -fsSL https://gh-proxy.org/https://raw.githubusercontent.com/X-Zero-L/rig/master/setup-tmux.sh | bashConfig: TMUX_KEYBINDS, TMUX_MOUSE, TMUX_STATUS_POS, GH_PROXY — see Configuration Reference.
Configures Git global user.name, user.email, and sensible defaults (init.defaultBranch=main, pull.rebase=true, etc.).
export GIT_USER_NAME="Your Name"
export GIT_USER_EMAIL="you@example.com"
curl -fsSL https://raw.githubusercontent.com/X-Zero-L/rig/master/setup-git.sh | bashConfig: GIT_USER_NAME, GIT_USER_EMAIL — see Configuration Reference.
Installs clash-for-linux with subscription support.
With subscription URL as argument:
curl -fsSL https://raw.githubusercontent.com/X-Zero-L/rig/master/setup-clash.sh | bash -s -- 'https://your-subscription-url'With pre-exported env var:
export CLASH_SUB_URL='https://your-subscription-url'
curl -fsSL https://raw.githubusercontent.com/X-Zero-L/rig/master/setup-clash.sh | bashVia proxy:
curl -fsSL https://gh-proxy.org/https://raw.githubusercontent.com/X-Zero-L/rig/master/setup-clash.sh | bash -s -- 'https://your-subscription-url'Config: CLASH_SUB_URL, CLASH_KERNEL, CLASH_GH_PROXY — see Configuration Reference.
Installs Docker Engine, Compose plugin, configures registry mirrors, log rotation, address pools, and optional proxy. Requires sudo.
Default (no mirror, suitable for overseas):
curl -fsSL https://raw.githubusercontent.com/X-Zero-L/rig/master/setup-docker.sh | bashCustom configuration:
export DOCKER_MIRROR=https://mirror.example.com
export DOCKER_DATA_ROOT=/data/docker
export DOCKER_PROXY=http://localhost:7890
curl -fsSL https://raw.githubusercontent.com/X-Zero-L/rig/master/setup-docker.sh | bashVia proxy:
curl -fsSL https://gh-proxy.org/https://raw.githubusercontent.com/X-Zero-L/rig/master/setup-docker.sh | bashConfig: DOCKER_MIRROR, DOCKER_PROXY, DOCKER_DATA_ROOT, DOCKER_LOG_SIZE, etc. — see Configuration Reference.
Installs Tailscale VPN mesh network.
Install only:
curl -fsSL https://raw.githubusercontent.com/X-Zero-L/rig/master/setup-tailscale.sh | bashInstall + auto connect:
export TAILSCALE_AUTH_KEY=tskey-auth-xxxxx
curl -fsSL https://raw.githubusercontent.com/X-Zero-L/rig/master/setup-tailscale.sh | bashConfigures OpenSSH server: custom port, key-only authentication, and GitHub SSH proxy.
Install only (ensure sshd running):
curl -fsSL https://raw.githubusercontent.com/X-Zero-L/rig/master/setup-ssh.sh | bashChange port + enable key-only auth:
export SSH_PORT=2222
export SSH_PUBKEY="ssh-ed25519 AAAA..."
curl -fsSL https://raw.githubusercontent.com/X-Zero-L/rig/master/setup-ssh.sh | bashWith GitHub SSH proxy (when port 22 is blocked or proxy required):
export SSH_PROXY_PORT=7890
curl -fsSL https://raw.githubusercontent.com/X-Zero-L/rig/master/setup-ssh.sh | bashConfig: SSH_PORT, SSH_PUBKEY, SSH_PROXY_PORT — see Configuration Reference.
Installs nvm and Node.js.
Default (Node.js 24):
curl -fsSL https://raw.githubusercontent.com/X-Zero-L/rig/master/setup-node.sh | bashSpecific version:
export NODE_VERSION=22
curl -fsSL https://raw.githubusercontent.com/X-Zero-L/rig/master/setup-node.sh | bashVia proxy:
curl -fsSL https://gh-proxy.org/https://raw.githubusercontent.com/X-Zero-L/rig/master/setup-node.sh | bashInstalls uv package manager, optionally installs a Python version.
uv only:
curl -fsSL https://raw.githubusercontent.com/X-Zero-L/rig/master/setup-uv.sh | bashuv + Python:
export UV_PYTHON=3.12
curl -fsSL https://raw.githubusercontent.com/X-Zero-L/rig/master/setup-uv.sh | bashVia proxy:
curl -fsSL https://gh-proxy.org/https://raw.githubusercontent.com/X-Zero-L/rig/master/setup-uv.sh | bashInstalls goenv and Go.
Default (latest Go):
curl -fsSL https://raw.githubusercontent.com/X-Zero-L/rig/master/setup-go.sh | bashSpecific version:
export GO_VERSION=1.23.0
curl -fsSL https://raw.githubusercontent.com/X-Zero-L/rig/master/setup-go.sh | bashVia proxy:
curl -fsSL https://gh-proxy.org/https://raw.githubusercontent.com/X-Zero-L/rig/master/setup-go.sh | GH_PROXY=https://gh-proxy.org bashAll three agent scripts share the same behavior:
- With API keys → install tool + write config (skip if already up to date)
- Without API keys → install tool only, configure later
- Re-run with keys → skip install, check and update config if changed
Installs Claude Code CLI. Alias: cc.
Install + configure:
export CLAUDE_API_URL=https://your-api-url
export CLAUDE_API_KEY=your-key
curl -fsSL https://raw.githubusercontent.com/X-Zero-L/rig/master/setup-claude-code.sh | bashInstall only (configure later):
curl -fsSL https://raw.githubusercontent.com/X-Zero-L/rig/master/setup-claude-code.sh | bashVia CLI arguments:
curl -fsSL https://raw.githubusercontent.com/X-Zero-L/rig/master/setup-claude-code.sh | bash -s -- --api-url https://your-api-url --api-key your-keyVia proxy:
curl -fsSL https://gh-proxy.org/https://raw.githubusercontent.com/X-Zero-L/rig/master/setup-claude-code.sh | bashConfig: CLAUDE_API_URL, CLAUDE_API_KEY, CLAUDE_MODEL, CLAUDE_NPM_MIRROR — see Configuration Reference.
Installs Codex CLI. Alias: cx.
Install + configure:
export CODEX_API_URL=https://your-api-url
export CODEX_API_KEY=your-key
curl -fsSL https://raw.githubusercontent.com/X-Zero-L/rig/master/setup-codex.sh | bashInstall only (configure later):
curl -fsSL https://raw.githubusercontent.com/X-Zero-L/rig/master/setup-codex.sh | bashVia CLI arguments:
curl -fsSL https://raw.githubusercontent.com/X-Zero-L/rig/master/setup-codex.sh | bash -s -- --api-url https://your-api-url --api-key your-keyVia proxy:
curl -fsSL https://gh-proxy.org/https://raw.githubusercontent.com/X-Zero-L/rig/master/setup-codex.sh | bashConfig: CODEX_API_URL, CODEX_API_KEY, CODEX_MODEL, CODEX_EFFORT, CODEX_NPM_MIRROR — see Configuration Reference.
Installs Gemini CLI. Alias: gm.
Install + configure:
export GEMINI_API_URL=https://your-api-url
export GEMINI_API_KEY=your-key
curl -fsSL https://raw.githubusercontent.com/X-Zero-L/rig/master/setup-gemini.sh | bashInstall only (configure later):
curl -fsSL https://raw.githubusercontent.com/X-Zero-L/rig/master/setup-gemini.sh | bashVia CLI arguments:
curl -fsSL https://raw.githubusercontent.com/X-Zero-L/rig/master/setup-gemini.sh | bash -s -- --api-url https://your-api-url --api-key your-keyVia proxy:
curl -fsSL https://gh-proxy.org/https://raw.githubusercontent.com/X-Zero-L/rig/master/setup-gemini.sh | bashConfig: GEMINI_API_URL, GEMINI_API_KEY, GEMINI_MODEL, GEMINI_NPM_MIRROR — see Configuration Reference.
Installs common agent skills globally for all coding agents.
| Skill | Source | Description |
|---|---|---|
find-skills |
vercel-labs/skills | Discover and install agent skills |
pdf |
anthropics/skills | PDF reading and manipulation |
gemini-cli |
X-Zero-L/agent-skills | Gemini CLI integration |
context7 |
intellectronica/agent-skills | Library documentation lookup |
writing-plans |
obra/superpowers | Implementation plan writing |
executing-plans |
obra/superpowers | Plan execution with checkpoints |
codex |
softaworks/agent-toolkit | Codex agent skill |
curl -fsSL https://raw.githubusercontent.com/X-Zero-L/rig/master/setup-skills.sh | bashVia proxy:
curl -fsSL https://gh-proxy.org/https://raw.githubusercontent.com/X-Zero-L/rig/master/setup-skills.sh | bashConfig: SKILLS_NPM_MIRROR — see Configuration Reference.
All environment variables across all scripts in one table.
| Variable | Scope | Default | Description |
|---|---|---|---|
GH_PROXY |
install.sh |
(empty) | GitHub proxy URL for script downloads |
| Variable | Default | Description |
|---|---|---|
TMUX_KEYBINDS |
0 |
Enable custom keybindings: Ctrl+a prefix, | and - splits, vim-style resize (1 to enable) |
TMUX_MOUSE |
1 |
Enable mouse support (0 to disable) |
TMUX_STATUS_POS |
top |
Status bar position (top or bottom) |
| Variable | Default | Description |
|---|---|---|
GIT_USER_NAME |
(empty) | git config --global user.name value |
GIT_USER_EMAIL |
(empty) | git config --global user.email value |
| Variable | Default | Description |
|---|---|---|
CLASH_SUB_URL |
(empty) | Subscription URL (also accepted as first argument) |
CLASH_KERNEL |
mihomo |
Proxy kernel (mihomo or clash) |
CLASH_GH_PROXY |
https://gh-proxy.org |
GitHub proxy for clash downloads (empty to disable) |
| Variable | Default | Description |
|---|---|---|
NODE_VERSION |
24 |
Node.js major version (also accepted as first argument) |
NVM_NODEJS_ORG_MIRROR |
(empty) | Node.js binary mirror. Auto-set when GH_PROXY is set. |
NPM_REGISTRY |
(empty) | npm registry URL. Auto-set when GH_PROXY is set. |
| Variable | Default | Description |
|---|---|---|
UV_PYTHON |
(empty) | Python version to install (also accepted as first argument) |
| Variable | Default | Description |
|---|---|---|
GO_VERSION |
latest |
Go version to install (also accepted as first argument) |
GO_BUILD_MIRROR_URL |
(empty) | Go binary download mirror. Auto-set when GH_PROXY is set. |
| Variable | Default | Description |
|---|---|---|
DOCKER_MIRROR |
(empty) | Registry mirror URL(s), comma-separated. Auto-set to https://docker.1ms.run when --gh-proxy is used in install.sh |
DOCKER_PROXY |
(empty) | HTTP/HTTPS proxy for daemon and containers |
DOCKER_NO_PROXY |
localhost,127.0.0.0/8 |
No-proxy list |
DOCKER_DATA_ROOT |
(empty) | Data directory (default: /var/lib/docker) |
DOCKER_LOG_SIZE |
20m |
Max size per log file |
DOCKER_LOG_FILES |
3 |
Max number of log files |
DOCKER_EXPERIMENTAL |
1 |
Enable experimental features (0 to disable) |
DOCKER_ADDR_POOLS |
172.17.0.0/12:24,192.168.0.0/16:24 |
Default address pools (base/cidr:size) |
DOCKER_COMPOSE |
1 |
Install docker-compose-plugin (0 to skip) |
| Variable | Default | Description |
|---|---|---|
TAILSCALE_AUTH_KEY |
(empty) | Auth key for auto-connect. Leave empty to install only. |
| Variable | Default | Description |
|---|---|---|
SSH_PORT |
(empty) | Custom SSH port. Leave empty to keep current port. |
SSH_PUBKEY |
(empty) | Public key string. When set, adds key and disables password auth. |
SSH_PRIVATE_KEY |
(empty) | Private key content. When set, imports to ~/.ssh/ for outbound SSH. |
SSH_PROXY_HOST |
127.0.0.1 |
Proxy host for GitHub SSH. Only used when SSH_PROXY_PORT is set. |
SSH_PROXY_PORT |
(empty) | Proxy port (e.g. 7890). Configures GitHub SSH via ssh.github.com:443 + corkscrew. |
| Variable | Default | Description |
|---|---|---|
CLAUDE_API_URL |
(empty) | API base URL (skip config if empty) |
CLAUDE_API_KEY |
(empty) | Auth token (skip config if empty) |
CLAUDE_MODEL |
opus |
Model name |
CLAUDE_NPM_MIRROR |
(empty) | npm registry mirror. Auto-set when GH_PROXY is set. |
| Variable | Default | Description |
|---|---|---|
CODEX_API_URL |
(empty) | API base URL (skip config if empty) |
CODEX_API_KEY |
(empty) | API key (skip config if empty) |
CODEX_MODEL |
gpt-5.2 |
Model name |
CODEX_EFFORT |
xhigh |
Reasoning effort |
CODEX_NPM_MIRROR |
(empty) | npm registry mirror. Auto-set when GH_PROXY is set. |
| Variable | Default | Description |
|---|---|---|
GEMINI_API_URL |
(empty) | API base URL (skip config if empty) |
GEMINI_API_KEY |
(empty) | API key (skip config if empty) |
GEMINI_MODEL |
gemini-3-pro-preview |
Model name |
GEMINI_NPM_MIRROR |
(empty) | npm registry mirror. Auto-set when GH_PROXY is set. |
| Variable | Default | Description |
|---|---|---|
SKILLS_NPM_MIRROR |
(empty) | npm registry mirror. Auto-set when GH_PROXY is set. |
Step-by-step flow for setting up a fresh machine. The recommended order ensures dependencies are met.
1. Proxy (so subsequent downloads are faster)
curl -fsSL https://gh-proxy.org/https://raw.githubusercontent.com/X-Zero-L/rig/master/setup-clash.sh | bash -s -- 'https://your-subscription-url'source ~/.bashrc && clashon2. Prepare API keys (optional — omit to install tools without config)
export CLAUDE_API_URL=https://your-api-url CLAUDE_API_KEY=your-key
export CODEX_API_URL=https://your-api-url CODEX_API_KEY=your-key
export GEMINI_API_URL=https://your-api-url GEMINI_API_KEY=your-key3. Install everything
curl -fsSL https://raw.githubusercontent.com/X-Zero-L/rig/master/install.sh | bash -s -- --allOr install components individually in this order:
setup-shell.sh— Shell environment (zsh, plugins, Starship)setup-tmux.sh— Tmux + Catppuccin + pluginssetup-git.sh— Git user identity + defaultssetup-ssh.sh— SSH port + key-only authsetup-docker.sh— Docker Engine + Composesetup-tailscale.sh— Tailscale VPNsetup-uv.sh— uv + Pythonsetup-go.sh— goenv + Gosetup-node.sh— nvm + Node.jssetup-claude-code.sh— Claude Codesetup-codex.sh— Codex CLIsetup-gemini.sh— Gemini CLIsetup-skills.sh— Agent skills
See the docs/ directory for in-depth documentation on each script — what gets installed, which files are created/modified, re-run behavior, and OS-specific notes.
macOS support has the following differences:
- Docker: Uses Docker Desktop instead of Docker Engine. The
setup-docker.shscript installs via Homebrew and does not configure systemd services (macOS doesn't use systemd). - SSH: Uses macOS Remote Login instead of OpenSSH server configuration via
systemctl. - Clash Proxy: Not supported on macOS (Linux-only component).
- Homebrew: Automatically installed if not present. The scripts detect and use
brewinstead ofapt/yum/dnf/pacman. - sudo: Some Homebrew operations don't require sudo. The scripts handle this automatically.
- Starship icons require a Nerd Font in your terminal.
- If
gh-proxy.orgis unavailable, check ghproxy.link for alternatives. - Re-running a script with different API keys/config will update the configuration without reinstalling.
- Linux-only components: Clash proxy is only available on Linux systems.
