Skip to content

Bounded automation

Splinterm exposes the same persistent topology to people and authorized tools. Automation can inspect Lairs, Dojos, and Splints; read bounded terminal state; mutate layouts and lifecycle; send input; resize; and subscribe to change streams.

It does not receive authority merely because it can reach the daemon. Policy-controlled operations require matching identity, scope, resource, and limit checks; input and resize additionally require exclusive controller ownership. The narrow authenticated-local focus projection is the documented exception: it exposes only nullable active Splint ID and working directory, never topology or terminal content.

JSON/NDJSON client · MCP host · SSH stdio relay
↓
exact executable identity
↓
closed scopes · resources · limits
↓
splinterd
↓
topology · terminal · control

One-shot JSON commands return one versioned splinterm.cli.v2 document. Supported reads include topology, Splint state, visible terminal snapshots, scrollback pages, literal search, authorization status, and bounded audit metadata.

Terminal window
splinterm --output json --schema-major 2 --timeout-ms 5000 topology
splinterm --output json --schema-major 2 --timeout-ms 5000 \
snapshot SPLINT_ID

Authorized clients can create Lairs and Dojos, split Splints, launch argument vectors, rename topology, set ratios and focus hints, restore exited processes, send literal input, resize, and explicitly terminate resources.

Terminal window
splinterm --output json --schema-major 2 --timeout-ms 10000 \
split SPLINT_ID --axis horizontal --side second \
--cwd "$PWD" -- cargo test --workspace

Machine mode never prompts. Destructive operations such as kill, close, close-dojo, and authorization revocation require an explicit --yes in addition to policy authority.

NDJSON subscriptions provide bounded topology, terminal, and controller streams:

Terminal window
splinterm --output ndjson --schema-major 2 --timeout-ms 300000 \
subscribe terminal SPLINT_ID

A sequence gap, replaced history, or stalled subscriber emits resync_required and ends the stream. Clients must fetch fresh authoritative state and explicitly subscribe again rather than silently guessing what was missed.

An agent can tell Splinterm whether it is working, needs_input, done, error, or idle. Status comes only from an explicit report and is display data, never authority. Splinterm never infers it from terminal text, titles, or output.

Terminal window
splinterm agent-status set needs_input --detail 'waiting for approval'
splinterm agent-status clear
splinterm --output json agent-status get

Inside a Splint the target defaults to $SPLINTERM_SPLINT_ID and $SPLINTERM_SPLINT_INCARNATION. Outside one, without --splint ID --incarnation N, the command fails with the usage error not inside a Splint. A process in the Splint’s session or process ancestry, such as an agent hook, reports for that Splint with no grant or prompt. An agent that fully detaches from the Splint (for example inside a tmux server started there) needs an agent_status_report grant.

Active states turn stale without a fresh report (120 seconds by default). inspect and topology JSON gain an optional agent_status object while a status is set. Agent hooks make this work without MCP; for Claude Code:

{
"hooks": {
"UserPromptSubmit": [{"hooks": [{"type": "command", "command": "splinterm agent-status set working --ttl 900 >/dev/null 2>&1 || true"}]}],
"PostToolUse": [{"hooks": [{"type": "command", "command": "splinterm agent-status set working --ttl 900 >/dev/null 2>&1 || true"}]}],
"Notification": [{"matcher": "permission_prompt", "hooks": [{"type": "command", "command": "splinterm agent-status set needs_input --ttl 900 >/dev/null 2>&1 || true"}]}],
"Stop": [{"hooks": [{"type": "command", "command": "splinterm agent-status set done >/dev/null 2>&1 || true"}]}]
}
}

The permission_prompt matcher keeps Claude Code’s idle-prompt notification from replacing done with needs_input after every turn, and PostToolUse returns the status to working after a permission is approved. Codex can map its notify program to done. The repository docs/automation.md has the full contract, exit codes, and recipes.

The graphical client shows a fresh working status as a Braille spinner (⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏) that Splinterm draws itself. It steps at most four times a second, only while the Window has keyboard focus, and holds its first frame, ⠋, in an unfocused Window, with SPLINTERM_REDUCED_MOTION=1, and for a stale status. Every other state is a static built-in Tabler icon: a speech bubble with ? (message-question) for needs input, circle-check for done, alert-circle for error, and a small ring (point) for idle, with ASCII ?, +, !, - only if the built-in icons cannot load. Splint rows in the one-line Lair Explorer show the icon in a column right of the name, and the footer spells out the selected row’s state and detail in words; Dojo and Lair rows and each Dojo tab show the most urgent state, with needs input first, and parent rows count states in words. A stale status keeps its icon and adds a clock icon, and the Explorer shows “Agent status unavailable” while its data is stale or disconnected. Explorer search matches state words such as needs input. The palette command Clear agent status clears the focused Splint, and agent-status=no in the [explorer] configuration section hides all of it.

Persistent policy is owner-controlled and fails closed. A policy rule binds:

  • the absolute canonical executable path and SHA-256 digest;
  • one or more closed operation scopes;
  • explicit daemon, Lair, Dojo, or Splint resources;
  • bounded rows, bytes, results, subscriptions, spawns, and deadlines; and
  • an optional expiry.

There are no wildcard scopes, basename-only identities, path-only identities, or implicit authority over future resources. A policy load failure installs a deny-all generation.

Transport is not authority. Access to the Unix socket, an authenticated SSH login, the same Unix account, inherited environment variables, or installation of splinterm-mcp does not grant operations.

Many clients may observe a Splint, but only one daemon connection may own its input and resize controller at a time. Controller denial is therefore a normal exclusive-ownership result—not a reason to force takeover or broaden policy.

One-shot CLI input and resize use an atomic acquire, act, and release workflow on one connection. Connection closure or policy revocation releases its controller-owned state.

Public audit records intentionally omit terminal bodies, input bytes, clipboard data, search queries, environment contents, capability tokens, and complete command arguments. The daemon retains bounded metadata for its current lifetime.

The compatibility boundary consists of:

  • JSON emitted by --output json;
  • NDJSON emitted by --output ndjson;
  • checked-in versioned schemas; and
  • documented operations, exit categories, limits, cancellation, and resync behavior.

Human-readable output, raw daemon frames, Rust types, and private protocol DTOs are not machine compatibility contracts. Clients should reject unknown schema majors rather than infer their meaning.

The complete authoritative contract remains in repository docs/automation.md. Integration authors should also follow repository docs/integrations.md for stale-incarnation handling, structured argument vectors, subscription reconciliation, and daemon-injected discovery hints.

  • Use the JSON CLI for scripts and bounded one-shot operations.
  • Use NDJSON when a client must observe changes over time.
  • Use the MCP adapter when an MCP host should receive a fixed, policy-identified tool surface.
  • Use the SSH stdio relay for remote machine access without exposing a daemon network listener.