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:
@@ -1,10 +1,20 @@
|
||||
import type { Command } from "commander";
|
||||
import { Command } from "commander";
|
||||
import { connectToDaemon, getDaemonHost } from "../../utils/client.js";
|
||||
import type { CommandOptions } from "../../output/index.js";
|
||||
import { fetchProjectedTimelineItems } from "../../utils/timeline.js";
|
||||
import type { DaemonClient, AgentStreamMessage, AgentTimelineItem } from "@getpaseo/server";
|
||||
import { curateAgentActivity } from "@getpaseo/server";
|
||||
|
||||
export function addLogsOptions(cmd: Command): Command {
|
||||
return cmd
|
||||
.description("View agent activity/timeline")
|
||||
.argument("<id>", "Agent ID (or prefix)")
|
||||
.option("-f, --follow", "Follow log output (streaming)")
|
||||
.option("--tail <n>", "Show last n entries")
|
||||
.option("--filter <type>", "Filter by event type (tools, text, errors, permissions)")
|
||||
.option("--since <time>", "Show logs since timestamp");
|
||||
}
|
||||
|
||||
export interface AgentLogsOptions extends CommandOptions {
|
||||
follow?: boolean;
|
||||
tail?: string;
|
||||
|
||||
Reference in New Issue
Block a user