refactor(cli): deduplicate command options between top-level and agent subcommands

Extract addXxxOptions() builder functions for all 9 shared commands
(ls, run, attach, logs, stop, delete, send, inspect, wait) so both
paseo <cmd> and paseo agent <cmd> use a single source of truth.

Fixes drift where agent subcommands were missing --wait-timeout (run),
--worktree/--base/--image (run), --since (logs), and --image (send).
This commit is contained in:
Mohamed Boudra
2026-03-23 10:33:06 +07:00
parent 07720f1d99
commit 7f9dafab68
11 changed files with 156 additions and 198 deletions
+8 -1
View File
@@ -1,4 +1,4 @@
import type { Command } from "commander";
import { Command } from "commander";
import { connectToDaemon, getDaemonHost } from "../../utils/client.js";
import type {
CommandOptions,
@@ -53,6 +53,13 @@ async function getRecentActivityTranscript(
}
}
export function addWaitOptions(cmd: Command): Command {
return cmd
.description("Wait for an agent to become idle")
.argument("<id>", "Agent ID (or prefix)")
.option("--timeout <seconds>", "Maximum wait time (default: no limit)");
}
export async function runWaitCommand(
agentIdArg: string,
options: AgentWaitOptions,