DEV Community

Vicente Figueiredo
Vicente Figueiredo

Posted on

I built a tiny CLI to switch between config “profiles”

When you build tools all day, configs get weird.

At least mine do.

I constantly end up with multiple versions of the same config:

  • my real everyday config
  • an experimental config to try new features
  • a broken one to reproduce bugs

First times it happened, I just edited my config files directly, and I kept forgetting what I had changed.

Then I got a little smart, so I started doing this:

cp ~/.config/nelson/nelson.conf nelson.conf.backup
cp ./other-version.conf ~/.config/nelson/nelson.conf
Enter fullscreen mode Exit fullscreen mode

Over and over.

It felt… dumb.

So I built a tiny CLI to fix it.

Meet robe

robe is a small Rust CLI that lets you save and switch between named config versions.

That’s it. That’s the whole feature set.

Example:

# save current config
robe add tmux/work -r .config/tmux

# switch anytime
robe use tmux/minimal

# view or edit
robe view tmux/work
robe edit tmux/work
Enter fullscreen mode Exit fullscreen mode

Configs are stored as plain files.

No templating.
No symlinks.
No background process.
No magic.

Just copy files in and out.

Very boring. Very predictable.

Exactly how I like my tools.

Why not use a full dotfile manager?

There are great tools out there for managing entire dotfile repos.

But I didn’t want:

  • git repos
  • templating
  • environment logic
  • setup scripts
  • abstractions

I just wanted:

“save this config as a name, switch later”

So robe intentionally does less.

It’s basically a glorified cp, but with names.

Sometimes that’s all you need.

The real use case

I actually built it while developing other CLIs.

When you’re testing your own tools, it’s super handy to have:

  • a “clean” environment
  • a “testing” config
  • a “broken” setup
  • your daily setup

Switching instantly made my development way faster.

So much so that I actually implemented this feature in one of my other clis, even though it was literally irrelevant for every user except me.

robe bridges that gap. No manual backups. No forgetting what you changed. Deliberately simple.

Design philosophy

I tried to keep it very Unix-y:

  • configs are plain files
  • no hidden state
  • no daemon
  • no cleverness
  • everything inspectable

If something breaks, you can literally cd ~/.config/robe and see everything.

That simplicity was the goal.

If this sounds useful

It’s open source and written in Rust:

Feedback and ideas welcome — especially from people who live in the terminal like I do. Let me know what you want to see in v0.1.0.

Bonus: what I learned

Building tiny tools like this is weirdly satisfying.

Not everything needs to be a big framework or platform.

Sometimes a 200–300 line CLI that solves one annoying problem is enough.

Honestly, those are my favorite kinds of tools.

Top comments (0)