terminalkoctl list --json for scripts #16
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
terminalkoctl listprints a table:docs/spec/command-line.mdsays plainly that this table is for people and is nota stable interface, and that anything needing to parse it should get a flag
instead. This issue is that flag.
The data behind it is already structured:
terminalko_proto::SessionInfocarriesthe id, state, working directory and foreground program, and the CLI merges that
with the configuration to add names and folders
(
crates/terminalko-ctl/src/main.rs,list).Work
terminalkoctl list --jsonprinting one JSON array of objects:id,name,folder(null when unfiled),state,program(null when not running orunreadable),
cwd, and the session'stype. Nothing else, so the shape stayssmall enough to keep stable;
serde_jsonis already in the workspace (the agent uses it for containerdiscovery), so no new dependency;
protocol's own names (
stopped,starting,running,exited,failed)rather than the table's prose, and document that an
exitedentry carries itscode;
start/stopneed it. They print one line and set an exitstatus, which is already scriptable; adding
--jsonthere is probably noise.Say which way you went.
Acceptance criteria
terminalkoctl list --jsonemits valid JSON — verified by piping it through aparser in the test, not by eye.
the agent still has but the configuration no longer mentions.
the note about there being no agent goes to stderr so stdout stays parseable.
crates/terminalko-ctl/tests/cli.rs, which needsno display) covers both the with-agent and without-agent cases.
docs/spec/command-line.mddocuments the exact keys and states, and says theyare the stable part.
Notes
the one interface people actually use.