aterm: shell completion for roles and seats, plus a JSON twin for --list #1253

Closed
opened 2026-08-26 02:49:04 +00:00 by coilyco-ops · 1 comment
Member

Part of #1245. Two small changes that belong together, since completion is the first consumer of the JSON form.

Completion

aterm refuses a stale slug well: edit-distance suggestions, then the live roster printed underneath. That is a good error for a mistake that never had to happen.

Turn on EnableShellCompletion and add a hook that serves roster slugs for the first positional argument and that role's nativeSeats() for the second. The roster call was timed at 10 ms, so completion is free at the shell prompt.

--list --json

writeRoster renders with lipgloss for humans only. The machine form is what the completion script, a Warp launcher, and any dashboard need, and it costs one flag.

Keep the human form as the default so aterm --list stays readable.

aterm/main.go, aterm/roster.go, aterm/picker.go.

Part of #1245. Two small changes that belong together, since completion is the first consumer of the JSON form. ## Completion aterm refuses a stale slug well: edit-distance suggestions, then the live roster printed underneath. That is a good error for a mistake that never had to happen. Turn on `EnableShellCompletion` and add a hook that serves roster slugs for the first positional argument and that role's `nativeSeats()` for the second. The roster call was timed at 10 ms, so completion is free at the shell prompt. ## `--list --json` `writeRoster` renders with lipgloss for humans only. The machine form is what the completion script, a Warp launcher, and any dashboard need, and it costs one flag. Keep the human form as the default so `aterm --list` stays readable. `aterm/main.go`, `aterm/roster.go`, `aterm/picker.go`.
Author
Member

Half of this already shipped. Re-checked on main at d24e5d5a.

Completion is done:

  • aterm/completion.go exists and serves roster slugs for the first positional and that role's nativeSeats() for the second, exactly as asked.
  • main.go:105 sets EnableShellCompletion: true.
  • aterm/completion_test.go covers it.
  • shell/common.sh registers bash and zsh through aterm completion <shell>, and docs/aterm.md documents the behavior including the silence-on-missing-agent-compose rule.

--list --json is still absent. runLaunch does if cmd.Bool("list") { return writeRoster(stdout, roster) } with no machine form beside it, and writeRoster is still lipgloss-only.

So the remaining scope here is the JSON twin alone. Retitle or reduce accordingly before this is handed to an agent, otherwise it re-implements completion that is already on main.

**Half of this already shipped.** Re-checked on `main` at `d24e5d5a`. Completion is done: * `aterm/completion.go` exists and serves roster slugs for the first positional and that role's `nativeSeats()` for the second, exactly as asked. * `main.go:105` sets `EnableShellCompletion: true`. * `aterm/completion_test.go` covers it. * `shell/common.sh` registers bash and zsh through `aterm completion <shell>`, and `docs/aterm.md` documents the behavior including the silence-on-missing-`agent-compose` rule. **`--list --json` is still absent.** `runLaunch` does `if cmd.Bool("list") { return writeRoster(stdout, roster) }` with no machine form beside it, and `writeRoster` is still lipgloss-only. So the remaining scope here is the JSON twin alone. Retitle or reduce accordingly before this is handed to an agent, otherwise it re-implements completion that is already on `main`.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
coilyco-flight-deck/agentic-os#1253
No description provided.