partly implementedProfilecpuQualifiedcpu

28. The command line behind the agent

Status: partly implemented. The #authority OpenAgentsCli member 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 in openagents/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:

On the protocol (chapter 65):

RecordSchemaCarriageToday
A command as a memberopenagents.capability.v1 Definition (spec 19.3), generated from the command tableNostr kind 30180 when published; MCP for other agentsSpec sketch; no .proto file. MCP is an external format
A command's --json outputNone yet (compliance plan, step C8)Standard outputHand-written JSON

The chapter's check

  • Source: the generated descriptors in openagents/agent/members/cli.coax, read from apps/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 state shows 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.coax lists over MCP and the commands in apps/openagents-cli/help-generated.coax.

Planned paths: openagents/agent/members/cli.coax.

Sources

Open questions for the owner

  1. Which commands can chat never call? Proposed: key export, admin commands, and anything that deletes data.