28. The command line behind the agent
Status: partly implemented. The
#authorityOpenAgentsClimember tool in `openagents/core/members.coax` (#14057) mounts a closed 8-subcommand allowlist (nostr,pylon,project,dictate,transcribe,realm,vault,tasks), rejects unsafe argument characters, enforces bypass-immune interactive approval for vault secret reads and Nostr signing/publishing, and runs inside `coder/tui/oa-worker.coax` beside the command table and MCP server in `apps/openagents-cli/`. Remaining: auto-generating NIP-CAP descriptors for every command inopenagents/agent/members/cli.coax.
Premise
Members so far were written as members. This chapter turns something that already exists into members: every command in the openagents command line becomes something the front can call.
Draft
Episode 289: "Our whole CLI, everything, everything, everything behind this single agent, accessible through anything." You say "show the Test-Time Capabilities deck", and a deck opens. This is promise P8.
The command line is the most complete description of what OpenAgents can do. It has commands for your identity, relays, realms, projects, models, Pylons, skills, a vault and Coder. If the agent can call each one, then everything the product does can be reached from a sentence on any surface.
Each command gets a member descriptor: its name, what it does, its typed arguments and its effects. The descriptors are generated from the command table itself. The command line and the agent can't drift apart, because they read the same table.
The front then treats "show the deck" like any other route. The decision picks the member, and the plan carries the arguments. A deterministic parser reads bounded fields such as an amount, an ID or a date, and it runs only after the route is chosen.
Effects still need grants. A command that only shows something runs at once. A command that changes something asks first. A few commands should never be reachable from chat at all, such as exporting a key.
The same descriptors serve other agents. The command line already speaks MCP, so a person's own agent can call the same commands.
What we build
A plan for what this chapter ships once the draft is approved:
- Member descriptors generated from the command line's command table.
- Routes for the first commands, starting with opening a deck and showing a project.
- A deny list for commands that chat can never call.
It builds on what exists today:
- `openagents/core/members.coax` (
#authorityOpenAgentsCli8-subcommand allowlist & bypass-immune vault/Nostr signing guard,#14057) - `apps/openagents-cli/commands.coax`
- `apps/openagents-cli/help-generated.coax`
- `apps/openagents-cli/mcp.coax`
- `apps/openagents-cli/rules.coax`
- `docs/cli/2026-11-01-openagents-cli-v1.md`
On the protocol (chapter 65):
| Record | Schema | Carriage | Today |
|---|---|---|---|
| A command as a member | openagents.capability.v1 Definition (spec 19.3), generated from the command table | Nostr kind 30180 when published; MCP for other agents | Spec sketch; no .proto file. MCP is an external format |
A command's --json output | None yet (compliance plan, step C8) | Standard output | Hand-written JSON |
The chapter's check
- Source: the generated descriptors in
openagents/agent/members/cli.coax, read fromapps/openagents-cli/commands.coax, with a fake decision service. - Trace: "show the Test-Time Capabilities deck" routes to the deck member, the parser reads the deck's name, and
stateshows that deck open. The trace prints one descriptor for each command in the table. - Refusal: "export my key" hits the deny list and prints `refused: key export can't run from chat`. A command that changes something waits for approval and does not run before it.
- Independent check: the descriptor names match the commands that
apps/openagents-cli/mcp.coaxlists over MCP and the commands inapps/openagents-cli/help-generated.coax.
Planned paths: openagents/agent/members/cli.coax.
Sources
- Episodes:
- Episode 289, *OpenAgents*: 1:00 to 1:30, the whole CLI and the deck
- Episode 170, *Commander*
- Episode 165, *Integrating MCP via AI SDK*: tools through MCP
- Episode 168, *Remote MCP Server & Client*: a remote MCP server and client
- Old code at
coder-v1.0.0, crates:openagents-cli,openagents-deck,openagents-terminal,coder-control - NIPs: NIP-CAP, NIP-CTRL
- Promises covered (audit): P8
Open questions for the owner
- Which commands can chat never call? Proposed: key export, admin commands, and anything that deletes data.