Platform support: Windows 11 x64 only. This fork is developed, packaged and verified on Windows 11 x64 with all four companion plugins (
opencode-elf,opencode-mem,openrtk,caveman) enabled in the same OpenCode process. Linux and macOS are not supported.
Caveman communication mode plugin for opencode. Adapts JuliusBrussee/caveman into a hook-based plugin.
Fork of
caveman-opencode-pluginby dantesCode, adding OpenCode V2 support (dual-generation export). Published under the@argaborscope.
Fast path (published package):
opencode plugin add @argabor/caveman-opencode-pluginOr add it to opencode.json(c) manually.
OpenCode V2:
{
"plugins": ["@argabor/caveman-opencode-plugin"]
}OpenCode V1:
{
"plugin": ["@argabor/caveman-opencode-plugin"]
}Local checkout or unpacked tarball — point plugins at the directory that holds package.json:
The directory needs an entrypoint (index.ts or index.js, both shipped). Alternatively, drop it into the global discovery directory and leave plugins untouched:
~/.config/opencode/plugins/caveman/ # unpacked package, or a directory with an index.ts that re-exports the build
Verify the plugin loaded with opencode api plugin.list (look for "id":"caveman") or by checking the log for loading plugin ... caveman.
Run the interactive setup script:
# Download and run
curl -fsSL https://raw.githubusercontent.com/argabor/caveman-opencode-plugin/main/setup.sh | bash
# Or clone and run locally
curl -O https://raw.githubusercontent.com/argabor/caveman-opencode-plugin/main/setup.sh
bash setup.shOr create caveman.json manually:
# Project-level config (recommended)
echo '{"enabled":true,"defaultMode":"full","features":{"caveman":true,"commit":true,"review":true}}' > caveman.json
# Or global config in ~/.config/opencode/
mkdir -p ~/.config/opencode
echo '{"enabled":true,"defaultMode":"full","features":{"caveman":true,"commit":true,"review":true}}' > ~/.config/opencode/caveman.jsonDefault when no caveman.json exists: defaultMode: "off". The plugin loads but stays silent until you configure a mode or run /caveman <mode>.
This package is dual-generation: one default export provides both implementations.
- V1 calls
server()— requires OpenCode>= 1.18.29for the object entrypoint. - V2 reads
id+setup()and ignoresserver().
The V2 half uses the V2 domain APIs:
ctx.session.hook("context", ...)replaces the V1experimental.chat.system.transformhook for system-prompt injection.ctx.command.transform(...)replaces the V1config+command.execute.beforepair for the/caveman*commands.
caveman.json is read from the same locations on both generations (project root, then $XDG_CONFIG_HOME/opencode/).
On V1 hosts
>= 1.17.10an embedded V2 core may also invokesetup()in a registration-only pass, which can add extra[v2]log lines. It does not change V1 behavior.
caveman.json example:
{
"enabled": true,
"defaultMode": "full",
"features": {
"caveman": true,
"commit": true,
"review": true
}
}enabled— master switchdefaultMode— mode on session start (lite,full,ultra,wenyan-lite,wenyan-full,wenyan-ultra,off; defaultoff)features— toggle individual features:caveman— enable caveman communication modecommit— enable/caveman-commitcommandreview— enable/caveman-reviewcommand
Plugin looks for caveman.json in this order:
./caveman.json(project root)$XDG_CONFIG_HOME/opencode/caveman.json(global, defaults to~/.config/opencode/caveman.json)
Both files are merged per key, so a global defaultMode is kept unless the project file sets its own. The project file takes precedence over global for the keys it contains.
| Command | Description |
|---|---|
/caveman <mode> |
Switch caveman mode. No argument: report current mode |
/caveman-mode <mode> |
Alias of /caveman |
/caveman-commit <diff> |
Generate conventional commit message |
/caveman-review <code> |
One-line code review |
/caveman normal and /caveman stop are aliases for /caveman off.
| Mode | Description |
|---|---|
lite |
Light compression: no filler/hedging, keep articles and full sentences |
full |
Default caveman rules: drop articles, fragments OK, short synonyms |
ultra |
Maximum brevity: strip conjunctions, no invented abbreviations, no arrows |
wenyan-lite |
Lite in classical Chinese style |
wenyan-full |
Full classical Chinese style |
wenyan-ultra |
Ultra classical Chinese style |
off / normal / stop |
Disable caveman |
Behavior mirrors JuliusBrussee/caveman methodology. See UPSTREAM.md for reference and intentional differences.
No Bun required on Windows. The build and the package smoke
test run on plain Node.js; only the original upstream unit tests use bun test.
npm install
npm test # upstream suite (requires bun)
npm run test:package # package smoke test (plain Node.js)
npm run build # esbuild bundle + tsc declarations -> dist/index.js + .d.tsnpm run build:bun keeps the original Bun-based build for environments that
have bun installed.
npm pack # prepack runs the build, emits argabor-caveman-opencode-plugin-<version>.tgzInstall the tarball on another machine:
tar -xzf argabor-caveman-opencode-plugin-*.tgz
# Option A: point plugins at the extracted package/ directory in opencode.json(c)
# Option B: copy it into the global discovery directory
mkdir -p ~/.config/opencode/plugins
cp -r package ~/.config/opencode/plugins/cavemanEither route works because the package ships a directory entrypoint (index.js).
To publish to a registry, change name to a scope you own (for example @yourname/caveman-opencode-plugin), then:
npm publish --access publicFor context compression, pair with @tarquinen/opencode-dcp.
MIT
{ "plugins": ["/absolute/path/to/caveman-opencode-plugin"] }