opm v1.2.0
opm exec — run OpenCode (or any command) under a specific profile for the duration of one session, without changing what opm use last set.
What's New
opm exec <name> [-- command [args...]]
Switch profiles per-project or per-session without touching global state.
# Open OpenCode using the "work" profile
opm exec work
# Pass flags through to opencode
opm exec personal -- opencode --no-auto-update
# Run any command with the profile's config in scope
opm exec ci -- opencode run "fix the tests"opm exec sets XDG_CONFIG_HOME to a temporary directory containing a symlink to the named profile, then spawns the command. The global active profile — what opm show returns — is never touched. When the command exits, the temp directory is cleaned up automatically.
When to use opm exec vs opm use:
opm use |
opm exec |
|
|---|---|---|
| Scope | Global, persistent | Single command, ephemeral |
Affects opm show |
Yes | No |
| Cleanup | Manual (opm use <other>) |
Automatic on exit |
Install / Upgrade
If you already have opm, upgrade with your usual install path:
# Homebrew
brew upgrade opm
# Go
go install github.com/tbcrawford/opm@v1.2.0