oc-agent
v1.0.0
Published
A zero-dependency npx CLI for installing and managing OpenCode agent .md files
Readme
oc-agent
A zero-dependency npx CLI for installing and managing OpenCode agent .md files.
Installation • Commands • Publishing Agents
npx oc-agent add https://github.com/owner/repo --agent my-agentFeatures
- One-command install — clone a git repo and install agents into the right directory
- Zero dependencies — pure Node.js, no compiled native modules
- Project or global scope — install agents per-project or system-wide
- Manifest tracking — every install is recorded for reliable
updateandremove - CI-friendly —
-yflag skips all prompts for automated workflows
Installation
No install needed — run directly with npx:
npx oc-agent <command>Or install globally:
npm install -g oc-agentCommands
add
Install an agent from a git repo.
npx oc-agent add <git-url> [--agent <name>] [-g] [-y]The repo must have an /agents folder containing .md files. The --agent flag is required when the repo contains more than one agent.
[!TIP] Supports
https://,git@,ssh://, andfile://URLs.
# Single-agent repo (--agent optional)
npx oc-agent add https://github.com/owner/repo
# Multi-agent repo (--agent required)
npx oc-agent add https://github.com/owner/repo --agent coder
# Install globally
npx oc-agent add https://github.com/owner/repo --agent coder -g
# Non-interactive (CI)
npx oc-agent add https://github.com/owner/repo --agent coder -g -ylist
Show all installed agents and their source repo.
npx oc-agent list
npx oc-agent list -g # global agentsremove
Uninstall an agent by name.
npx oc-agent remove coder
npx oc-agent remove coder -gupdate
Re-pull and reinstall agents from their source repo.
npx oc-agent update # update all
npx oc-agent update coder # update one
npx oc-agent update -g # update all globalScope
| Scope | Path |
|---|---|
| Project (default) | ./.opencode/agents/ |
| Global (-g) | ~/.config/opencode/agents/ |
How it works
- Clones the repo into a temp directory
- Looks for
.mdfiles inside the/agentssubfolder - Copies the chosen file to the install destination
- Records the install in a manifest for future
updateandremove
Installed agents are tracked in oc-agent-manifest.json alongside your agents, so update and remove always know where a file came from.
Options
| Flag | Description |
|---|---|
| --agent <name> | Select agent to install (required if repo has multiple) |
| -g, --global | Install to ~/.config/opencode/agents/ instead of ./.opencode/agents/ |
| -y, --yes | Skip confirmation prompts (CI-friendly) |
| -h, --help | Show help message |
| -v, --version | Show version |
Publishing Agents
Structure your repo like this:
my-agents/
agents/
coder.md
reviewer.md
planner.md
README.mdEach .md file becomes an installable agent. Users install individual agents with --agent <filename-without-extension>.
Requirements
- Node.js 18+
gitavailable in PATH
