akm-opencode
v0.2.0
Published
OpenCode plugin for Agentikit - search and show extension assets via the akm CLI.
Maintainers
Readme
akm-opencode
OpenCode plugin for the Agentikit CLI. Registers tools that let your AI agent search, show, and manage extension assets from stash directories and registries.
Installation
Add to your OpenCode config (opencode.json):
{
"plugin": ["akm-opencode"]
}Tools
| Tool | Description |
|------|-------------|
| akm_search | Search the local stash, the registry, or both for scripts, skills, commands, agents, and knowledge |
| akm_registry_search | Search configured registries for installable kits and optional asset-level hits |
| akm_show | Show a stash asset by its ref |
| akm_index | Build or rebuild the search index |
| akm_agent | Dispatch a stash agent:* into OpenCode using the stash prompt and metadata |
| akm_cmd | Execute a stash command:* template in OpenCode via SDK session prompting |
| akm_add | Install kits from npm, GitHub, git URLs, or local directories |
| akm_list | List installed registry kits |
| akm_remove | Remove an installed registry kit and reindex |
| akm_update | Update one installed kit or all installed kits |
| akm_clone | Clone an asset into the working stash or a custom destination for editing |
| akm_config | Get, set, unset, list, or inspect akm configuration (including config path --all) |
| akm_run | Execute a stash script using its run field |
| akm_sources | List all resolved stash search paths |
| akm_upgrade | Check for or install akm CLI updates |
Registry discovery
Use either:
akm_searchwithsource: "registry"orsource: "both"akm_registry_searchwhen you only want installable community kits
Registry hits include id, installRef, and action fields. Use installRef when passing a result into akm_add; registry-specific IDs are not installable refs. Use assets: true when you also want asset-level matches from registry v2 indexes.
Agent Dispatch
Use akm_agent after retrieving an agent ref from akm_search.
Inputs:
ref(optional): stash ref likeagent:coach.mdquery(optional): resolve best matching stash agent whenrefis omittedtask_prompt(required): user task to rundispatch_agent(optional): OpenCode agent name (defaults togeneral)as_subtask(optional): create child session (defaults totrue)
At least one of ref or query is required.
Behavior:
- Loads the stash agent via
akm show - Uses stash
promptverbatim as OpenCodesystem - Applies stash
modelHintwhen inprovider/modelformat - Applies stash
toolPolicywhen it maps to boolean tool flags
Command Execution
Use akm_cmd to execute stash command templates through the OpenCode SDK.
Inputs:
ref(optional): stash ref likecommand:review.mdquery(optional): resolve best matching stash command whenrefis omittedarguments(optional): raw command arguments for$ARGUMENTS,$1,$2, etc.dispatch_agent(optional): OpenCode agent name (defaults to current agent)as_subtask(optional): create child session (defaults tofalse)
At least one of ref or query is required.
Prerequisites
When the plugin loads, it runs bun install -g akm-cli@latest so it always picks up the latest published npm package. It then prefers the Bun-installed binary and falls back to an existing akm on PATH when needed. It does not run the standalone shell installers automatically.
# macOS / Linux
curl -fsSL https://raw.githubusercontent.com/itlackey/agentikit/main/install.sh | bash
# PowerShell (Windows)
irm https://raw.githubusercontent.com/itlackey/agentikit/main/install.ps1 -OutFile install.ps1; ./install.ps1
# Or via Bun
bun install -g akm-cli@latestStash model
The stash directory is resolved automatically via a three-tier fallback: AKM_STASH_DIR env var (optional override) → stashDir in config.json → platform default. Set it persistently with:
akm config set stashDir /abs/path/to/your-stashExpected layout:
stash/
├── scripts/ # executable scripts (.sh, .ts, .js, .ps1, .cmd, .bat, .py, .rb, .go, .pl, .php, .lua, .r, .swift, .kt)
├── skills/ # skill directories containing SKILL.md
├── commands/ # markdown files
├── agents/ # markdown files
└── knowledge/ # markdown filesAssets are resolved from three source types: working (local stash), search paths (additional dirs via searchPaths config), and installed (registry kits via akm add).
