Skip to content

Ochnee/opencode-rust-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

opencode-rust-tools

An opencode plugin that auto-discovers Rust CLI binaries as callable tools.

How it works

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.

Install

Clone the repo:

git clone https://github.com/you/opencode-rust-tools /path/to/opencode-rust-tools

Add to opencode.jsonc:

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["/path/to/opencode-rust-tools/src/index.ts"]
}

Restart opencode.

Usage

  1. Write a Rust CLI (any arg parsing — clap, manual, etc.)
  2. Compile: cargo build --release
  3. Copy to global or project tools:
    • cp target/release/my-tool ~/.config/opencode/rust-tools/
    • cp target/release/my-tool .opencode/rust-tools/
  4. Optionally describe it: echo "Does X. Pass --flag" > .opencode/rust-tools/my-tool.description
  5. Restart opencode

The AI will see my-tool in its tool list and can call it like any other tool.

Skill

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/

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors