ocp is a developer-first CLI for managing OpenCode profiles in Git, so work, personal, OSS, and experimental environments stay clean, reproducible, and one command away.
Get started · Read the docs · Star on GitHub · Contribute
If ocp is useful to you, please consider starring the repository. It helps more developers discover the project.
OpenCode configuration tends to drift into local state: copied files, one-off edits, and fragile “don’t touch this” setups that nobody wants to revisit.
ocp turns that into a versioned workflow. Profiles live in repositories, changes are reviewable, switching contexts is fast, and your active setup becomes explicit instead of accidental.
|
⚡ Fast context switching Move between work, personal, OSS, and experiment setups without manually rewriting config files. |
🧬 Configuration in Git Treat OpenCode profiles like code: version them, review them, share them, and keep them reproducible. |
🛡️ Safer local changes `ocp` links active profile files into your OpenCode directory, creates backups when replacing existing files, and rolls back partial switches on failure. |
# Add a profile repository
ocp repository add git@github.com:my-org/opencode-profiles.git --name my-org-opencode-profiles
# See what is available
ocp repository list
ocp profile list
# Switch your active OpenCode configuration
ocp profile use my-companyThat is the core idea: store configuration intentionally, discover it easily, and switch without friction.
- Repository-backed profiles for OpenCode configuration
- Simple switching between named environments
- Interactive terminal UI for day-to-day workflows
- Profile inheritance for layered configuration setups
- Backup-aware file replacement when applying profiles
- Optional Git and GitHub publish flows for local repositories
- Native-image distribution target for a fast CLI experience
brew install alvarosanchez/tap/ocpgitin yourPATHbatoptional for syntax-highlighted previews in interactive modeghoptional for GitHub publish from the interactive post-creation flow
The README stays intentionally concise. The full GitHub Pages documentation covers installation, concepts, command reference, interactive mode, troubleshooting, and contributor workflow.
- Docs site: https://alvarosanchez.github.io/ocp/docs/
- Landing page: https://alvarosanchez.github.io/ocp/
- Product spec:
SPEC.md - License:
LICENSE
- Run
./gradlew test jacocoTestReportto generate coverage reports. - Open the HTML report at
build/reports/jacoco/test/html/index.html. - The README badge is generated in CI by
cicirello/jacoco-badge-generatorand committed to.github/badges/jacoco.svg.
ocp is built as a modern CLI with a strong behavior contract and a native-distribution path in mind.
./gradlew test
./gradlew check
./gradlew build
npm --prefix site install
npm --prefix site run buildIf you are contributing, start with SPEC.md. It is the source of truth for product behavior and acceptance criteria.
Issues and pull requests are welcome as ocp moves toward its 1.0 release.
If you want to help, the highest-value contributions are the ones that improve developer experience, reliability, and the clarity of the configuration workflow.

