@troed/oc-done (0.1.23)

Published 2026-07-24 18:54:20 +02:00 by troed in troed/oc-done

Installation

@troed:registry=
npm install @troed/oc-done@0.1.23
"@troed/oc-done": "0.1.23"

About this package

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 indicating success or failure. 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.

Installation

opencode plugin @troed/oc-done@latest --global

Usage

The plugin registers a single tool: exit().

await exit({
  success?: boolean,  // default: true
  message?: string,   // optional summary
});

Examples

// Signal success (default)
await exit();

// Signal success with message
await exit({ message: "All tasks completed" });

// Signal failure
await exit({ success: false, message: "Something went wrong" });

Exit Codes

  • 0 — success (default)
  • 1 — failure (when success: false)

Output

[exit] SUCCESS: All tasks completed
[exit] FAILURE: Something went wrong
[exit] SUCCESS: (no message)

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/

Dependencies

Development dependencies

ID Version
@types/node ^26.1.1
typescript ^5.0.0

Peer dependencies

ID Version
@opencode-ai/plugin >=1.0.0
Details
npm
2026-07-24 18:54:20 +02:00
2
CC0
latest
1.8 KiB
Assets (1)
Versions (24) View all
0.1.23 2026-07-24
0.1.22 2026-07-24
0.1.21 2026-07-24
0.1.20 2026-07-24
0.1.19 2026-07-24