channel-terminal
Run and operate a local terminal/TUI channel for LionClaw using the kernel channel bridge APIs.
Terminal Channel Worker
Use this skill when the user wants a real terminal/TUI channel instead of the direct CLI path.
What you run:
- attach a terminal to LionClaw,
- type messages as a local peer,
- see answer, reasoning, status, and error lanes in separate regions.
Under the hood, the worker:
- restores the latest interactive session snapshot for
(channel_id, peer_id), - posts inbound text to
/v0/channels/inboundpinned to the chosensession_id, - long-polls
/v0/channels/stream/pull, - renders typed outbound events in separate terminal regions,
- starts recovery actions through
/v0/sessions/action, - advances its consumer cursor through
/v0/channels/stream/ack.
Prerequisites
python3uv- A configured LionClaw runtime if
channel attachneeds to start LionClaw for you
Setup
- Register the skill and channel:
lionclaw skill add skills/channel-terminal --alias terminal
lionclaw channel add terminal --launch interactive
- Attach your terminal to the interactive channel:
lionclaw channel attach terminal
If LionClaw is not already running, channel attach will start it for you. Passing --runtime <id> pins that attached worker's turns to the requested runtime.
For a fresh manual test home in one command:
./scripts/bootstrap-terminal-test.sh /tmp/lionclaw-terminal-e2e
That helper gives a fresh test home its own loopback bind, so it does not inherit state from another LionClaw daemon already running elsewhere on your machine.
For repeated manual testing, you can use the repo helper:
./scripts/attach-terminal-test.sh /tmp/lionclaw-terminal-e2e
Notes
- LionClaw enforces pairing. The TUI shows pending pairing state and the exact approval command to run through
lionclaw channel pairing approve .... - The worker defaults to
channel_id=terminalandpeer_id=$USER(falling back to$USERNAMEorlocal-user). channel attachrestores the latesthistory_policy=interactivesession for that peer, renders the last 12 durable turns into the transcript, and resumes a still-running answer stream from the last durable checkpoint when one exists.- The TUI echoes your message immediately, shows a local pending state right away, and then follows live
queue.*/runtime.*stream events for the active turn. - Slash commands are built into the TUI:
/continue/retry/reset/quit/exit
- The Transcript pane is durable session history plus live answer deltas.
- The Thinking pane is live-only. It does not replay historical reasoning on attach.
- Runtime selection normally comes from the running LionClaw service, unless you pass
lionclaw channel attach <id> --runtime ..., which pins that attached worker to a specific runtime. - Attach only reuses a daemon when that daemon belongs to the same
LIONCLAW_HOME, current project, and daemon-compatible config, including runtime, preset, and workspace settings. - A shell debug harness is available in
scripts/debug-worker.sh.