Skip to content

tbcrawford/opm

Repository files navigation

opm — OpenCode Profile Manager

Switch between completely isolated OpenCode environments with one command.
Different MCPs, agents, models, plugins, and AGENTS.md files. No manual config surgery.

brew install tbcrawford/tap/opm

License: MIT  Go  Release

Quick Start

Each profile is a full OpenCode config directory. Switching changes what ~/.config/opencode points to, so OpenCode keeps using the same path it already knows.

That is the whole flow: one command to switch, same path, no config surgery.

Terminal demo showing opm init, create work, use work, and list


Why opm

OpenCode setups tend to drift into roles.

  • Work needs strict MCPs, specific models, and a locked-down AGENTS.md.
  • Personal projects want different tools, different defaults, and less ceremony.
  • Experiments should be free to break without touching the setup you actually rely on.

Without profiles, switching contexts means editing files by hand, remembering what you changed last time, and hoping you undo all of it correctly.

opm turns each context into a first-class profile: a complete, isolated OpenCode config directory under ~/.config/opm/profiles/ that you can switch to with a single command.

What a profile isolates

Every profile is its own OpenCode environment.

  • MCP configuration
  • agents and prompts
  • model selection
  • plugins and local tweaks
  • AGENTS.md rules and project-specific behavior

Nothing leaks between profiles unless you explicitly copy it.

Why it feels good to use

  • Fast to switch: opm use <name> updates the active profile in one step.
  • Safe to experiment: copy a working profile, try whatever you want, and switch back.
  • Transparent: OpenCode still reads and writes ~/.config/opencode like it always has.
  • Low overhead: no wrapper workflow, no special edit path, no new mental model after setup.

Install

Get it installed in under a minute.

Homebrew

brew install tbcrawford/tap/opm

Go

go install github.com/tbcrawford/opm@latest

Prebuilt binary

Download the latest release from GitHub Releases, extract it, and place opm in your $PATH.


Command Reference

Everything opm exposes for day-to-day use, without context trees.

Command Description
opm init [--as <name>] Migrate your existing config into opm management. Non-destructive. The initial profile is named default unless overridden with --as.
opm create <name> Create a new empty profile. Use --from to clone an existing profile as the starting point.
opm use <name> Switch the active profile via atomic symlink swap. Reload OpenCode to pick up the new profile.
opm list [-l] List all profiles. Active marked . Dangling marked and shown as missing. Pass -l to include paths.
opm show Print the name of the currently active profile.
opm copy <src> <dst> Clone a profile to a new name.
opm rename <old> <new> Rename a profile. Updates the symlink atomically if active.
opm remove <name> [name...] Remove one or more profiles. Refuses the active profile without --force.
opm path <name> Print the absolute path to a profile directory. Useful for scripting.
opm inspect <name> Show profile details and directory contents.
opm doctor Run installation health checks. Exits with code 1 on failure.
opm reset Remove opm management and restore ~/.config/opencode as a plain directory.

Shell completion — profile names are tab-completed for use, copy, rename, remove, path, and inspect:

opm completion bash > /etc/bash_completion.d/opm   # bash
opm completion zsh  > "${fpath[1]}/_opm"           # zsh
opm completion fish > ~/.config/fish/completions/opm.fish  # fish

How it works

opm init moves your existing OpenCode config into a named profile directory and replaces ~/.config/opencode with a symlink.

After that, switching profiles is just repointing the managed symlink:

~/.config/opencode  →  ~/.config/opm/profiles/work/

That means OpenCode, your tools, and your own muscle memory all keep using the same path as before.

~/.config/opm/
├── current
└── profiles/
    ├── default/
    ├── work/
    └── experiments/


MIT License · Built with Go · Report an issue

About

Switch between isolated OpenCode environments — MCPs, models, agents, and AGENTS.md — with a single command.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors