Page kind: Reference
swarmops ws hook#
The agent hosts' hooks: read the hook's JSON on stdin, print what the hook expects.
worktree-create makes the session's workspace and prints its path on stdout; worktree-remove keeps uncommitted edits as a rescue changeset and deletes the workspace; config prints the settings entries that register both. Errors go to stderr as an envelope, with its exit code. The opencode-* verbs serve OpenCode: each prints one JSON object on stdout, its answer or the error's envelope with its exit code.
- Group
workspaces- Since
0.3.0- Mutates
- yes
- Identity required
- no
- MCP tool
- none
- Envelope op
ws_hook- Exit codes
- 0
- Errors
- none
Syntax#
swarmops ws hook [OPTIONS] <VERB>Required arguments#
Syntax: <VERB>.
Which hook. Values: worktree-create: The WorktreeCreate hook; worktree-remove: The WorktreeRemove hook; config: The settings entries that register both; opencode-create: OpenCode's create: {source, destination, ref?, name?} to {path, name, head}; opencode-remove: OpenCode's remove: {directory, force?} to {removed, name, head, rescued}; opencode-list: OpenCode's list: {source} to {entries: [{path, kind}]}.
Optional arguments#
The command also takes the global options.
Examples#
No recorded example yet.
Return information#
swarmops mcp prints no envelope: stdout carries the MCP protocol until stdin ends, and a command line it refuses has its envelope on stderr.
Envelope op: ws_hook.
Exit codes:
0: Success.
Errors#
No golden step shows this command failing yet.
Any command that opens a store may also fail with a store error, such as E_NOT_A_REPO, E_IO or E_STORE_CORRUPT; a command line the grammar refuses is E_INVALID_ARG (exit 2).