- TypeScript 83.5%
- JavaScript 16.5%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
- Tool renamed from done to exit - Uses PluginInput.exit() API instead of process.kill(SIGHUP) - Takes optional code argument (default 0) - Updated README with requirements note |
||
| src | ||
| tests | ||
| .gitignore | ||
| jest.config.js | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
oc-done
A plugin for OpenCode that registers an exit() tool to signal agent completion.
When an agent finishes its tasks, it calls exit() to exit opencode with a status code. This allows parent shell scripts or orchestration to detect completion and handle the result accordingly.
The tool uses the opencode plugin API's input.exit() method for clean shutdown, rather than killing processes externally.
Requirements
This plugin requires an opencode fork that exposes the exit() method on PluginInput. The official opencode release does not yet include this API.
Installation
opencode plugin @troed/oc-done@latest --global
Usage
The plugin registers a single tool: exit().
await exit({
code?: number, // exit code (default: 0)
});
Examples
// Exit with code 0 (success)
await exit();
// Exit with code 1 (failure)
await exit({ code: 1 });
Exit Codes
0— success (default)- Any non-zero value — failure (the shell can inspect
$?)
Source code repo
For known issues, posting new ones, forking or contributing:
https://git.sync.wtf/troed/oc-done
License
Creative Commons Zero (CC0 1.0 Universal) — https://creativecommons.org/publicdomain/zero/1.0/