An opencode plugin that auto-discovers Rust CLI binaries as callable tools.
Drop compiled Rust binaries into ~/.config/opencode/rust-tools/ or <project>/.opencode/rust-tools/. The plugin scans both directories on startup and registers each executable as a tool that the AI can call with { args: string[] }.
| Scope | Path |
|---|---|
| Global | ~/.config/opencode/rust-tools/ |
| Project | <worktree>/.opencode/rust-tools/ |
Optionally add a .description file alongside each binary to give the AI a usage hint:
~/.config/opencode/rust-tools/
├── code-review # compiled Rust binary (executable)
└── code-review.description # plain text, one line
Project tools override global tools if names collide.
Clone the repo:
git clone https://github.com/you/opencode-rust-tools /path/to/opencode-rust-toolsAdd to opencode.jsonc:
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["/path/to/opencode-rust-tools/src/index.ts"]
}Restart opencode.
- Write a Rust CLI (any arg parsing —
clap, manual, etc.) - Compile:
cargo build --release - Copy to global or project tools:
cp target/release/my-tool ~/.config/opencode/rust-tools/cp target/release/my-tool .opencode/rust-tools/
- Optionally describe it:
echo "Does X. Pass --flag" > .opencode/rust-tools/my-tool.description - Restart opencode
The AI will see my-tool in its tool list and can call it like any other tool.
The bundled skill in skill/SKILL.md teaches the AI about this plugin. Install it by copying to your skills directory:
mkdir -p ~/.config/opencode/skills/rust-tools
cp skill/SKILL.md ~/.config/opencode/skills/rust-tools/MIT