705 字
4 分钟

Tired of Rebuilding Every New Machine? Try rig

Tired of Rebuilding Every New Machine? Try rig#

A friend from our group recently built a small tool aimed at solving a very common, very annoying problem: bootstrapping a fresh machine.

If you work with servers or development machines often, this routine probably looks familiar:

Install zsh, configure Oh My Zsh, add nvm, get Docker running, restore your Git config, then reinstall tools like ripgrep, fd, bat, jq, and gh.

On Ubuntu, you eventually get used to it. But once you switch to CentOS, Fedora, Arch, or even macOS, the package names and installation commands change again.

Cloud servers, local dev machines, WSL, temporary test boxes… almost every machine means doing the same setup all over again.

If you are getting tired of that, this project is worth a look: rig.

X-Zero-L
/
rig
Waiting for api.github.com...
00K
0K
0K
Waiting...

Quick Start#

Interactive TUI, where you choose the components you want to install:

Terminal window
curl -fsSL https://ba.sh/rig | bash
# or: curl -fsSL https://raw.githubusercontent.com/X-Zero-L/rig/master/install.sh | bash

Install through a proxy, recommended for users in China:

Terminal window
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

image-20260311100713236


What rig Can Do#

What rig really solves is simple: it helps you set up the common parts of a development environment on a new machine in one go.

It already includes more than a dozen common components, roughly grouped like this:

CategoryComponents
Base environmentzsh, Oh My Zsh, Starship, Tmux, Git, ripgrep, fd, bat, jq, gh
Language runtimesNode.js (nvm), Python (uv), Go (goenv)
InfrastructureDocker, Compose, SSH hardening, Tailscale, Clash
AI coding toolsClaude Code, Codex CLI, Gemini CLI, Agent Skills

That covers most of the tools people commonly use in development and operations work.


Why Not Ansible#

For many people, the first reaction to a project like this is: “Why not just use Ansible?”

The answer is that they are not really solving the same problem.

Ansible is better suited for managing large numbers of servers, like orchestrating dozens or hundreds of machines in a datacenter.

rig is aimed at a simpler scenario:

I just got a new machine, and I want my own development environment set up as quickly as possible.


Cross-Platform Support#

Lots of scripts claim to be “cross-platform”, but in reality they were written on Ubuntu and happen to not crash immediately elsewhere.

rig actually abstracts this properly. The rough structure looks like this:

OS detection
Package name mapping
Package manager invocation

In plain terms:

Differences in package names across systems are handled internally by rig.

Take fd as an example:

  • fd-find on Debian and Ubuntu
  • fd on Arch Linux
  • fd on macOS via Homebrew

You do not need to remember any of that yourself. The script handles it automatically.

Currently supported systems include:

  • Debian / Ubuntu
  • CentOS / RHEL
  • Fedora
  • Arch Linux
  • macOS

After installation, you can check the current environment status with:

Terminal window
rig status

It gives you a quick view of which components are installed and whether the versions look correct.


Preset Installation Modes#

If you do not want to select components one by one from the menu, rig also includes preset configurations:

  • minimal: basic shell setup plus CLI tools
  • agent: AI coding tools such as Claude, Codex, and Gemini
  • devops: infrastructure components like Docker, SSH, and Tailscale
  • fullstack: everything above

For example, if you only want the AI coding stack:

Terminal window
rig install --preset agent

If you are using the remote installation script, you can also specify a preset directly:

Terminal window
curl -fsSL https://raw.githubusercontent.com/X-Zero-L/rig/master/install.sh | bash -s -- --preset fullstack

That is often enough to get a fresh machine into a usable state with a single command.


Exporting and Migrating Your Environment#

Run:

Terminal window
rig export

image-20260311120855632

This generates two files:

  • rig-config.json: stores environment configuration
  • secrets.env: stores API keys and other sensitive information

More specifically:

  • rig-config.json can safely be committed to Git
  • secrets.env defaults to 600 permissions and is automatically added to .gitignore

If you later switch machines or reinstall your system, all you need is:

Terminal window
rig import ~/.rig/rig-config.json

That lets you reuse much of the environment you would otherwise have to set up again manually.


Final Result#

If you install a more complete setup, the end result looks roughly like this:

  • zsh with Oh My Zsh, autocomplete, syntax highlighting, and history search
  • Starship for a unified prompt
  • Tmux with better theming and navigation
  • A modern CLI toolkit: rg, fd, bat
  • A Docker environment that is already configured
  • AI coding assistants ready to use

image-20260311120758868


Summary#

If you often have to rebuild your development environment on new machines, this project is definitely worth trying.

Setting up an environment is not necessarily hard. The annoying part is having to do the same thing over and over again. If you can automate that away, day-to-day work becomes a lot easier.


Tired of Rebuilding Every New Machine? Try rig
https://catcat.blog/en/2026/03/rig-bootstrap-development-environment
作者
猫猫博客
发布于
2026-03-11
许可协议
CC BY-NC-SA 4.0