feat(cli): top-level ls alias for list

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-27 12:12:03 +01:00
parent 44a9211a6f
commit c826042625
2 changed files with 12 additions and 2 deletions
+2 -2
View File
@@ -161,9 +161,9 @@ func Run(args []string, out, errOut io.Writer) int {
} }
cmd, rest := args[0], args[1:] cmd, rest := args[0], args[1:]
role := commandRole(args) role := commandRole(args)
switch cmd { switch normalizeVerb(cmd) {
case "list", "get", "search", "ack": case "list", "get", "search", "ack":
return runAgent(cmd, rest, role, out, errOut) return runAgent(normalizeVerb(cmd), rest, role, out, errOut)
case "send": case "send":
return runSend(rest, role, out, errOut) return runSend(rest, role, out, errOut)
case "account": case "account":
+10
View File
@@ -81,3 +81,13 @@ func b64AgentKey() string {
// 32 bytes of 0x01, base64 — distinct from b64Key so slot mix-ups surface. // 32 bytes of 0x01, base64 — distinct from b64Key so slot mix-ups surface.
return "AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQE=" return "AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQE="
} }
func TestTopLevelLsAlias(t *testing.T) {
adminEnv(t)
// `ls` with no --account must hit the same usage path as `list` (CodeUsage
// envelope on stdout, exit 2) — proving it routed to the agent list command.
code, out, _ := run(t, "ls")
if code != 2 || !strings.Contains(out, "account") {
t.Fatalf("ls should alias list (usage about --account): code=%d out=%q", code, out)
}
}