Add top-level paseo archive as alias for paseo agent archive
This commit is contained in:
@@ -17,6 +17,7 @@ import { addStopOptions, runStopCommand } from "./commands/agent/stop.js";
|
|||||||
import { addSendOptions, runSendCommand } from "./commands/agent/send.js";
|
import { addSendOptions, runSendCommand } from "./commands/agent/send.js";
|
||||||
import { addInspectOptions, runInspectCommand } from "./commands/agent/inspect.js";
|
import { addInspectOptions, runInspectCommand } from "./commands/agent/inspect.js";
|
||||||
import { addWaitOptions, runWaitCommand } from "./commands/agent/wait.js";
|
import { addWaitOptions, runWaitCommand } from "./commands/agent/wait.js";
|
||||||
|
import { addArchiveOptions, runArchiveCommand } from "./commands/agent/archive.js";
|
||||||
import { addAttachOptions, runAttachCommand } from "./commands/agent/attach.js";
|
import { addAttachOptions, runAttachCommand } from "./commands/agent/attach.js";
|
||||||
import { withOutput } from "./output/index.js";
|
import { withOutput } from "./output/index.js";
|
||||||
import { onboardCommand } from "./commands/onboard.js";
|
import { onboardCommand } from "./commands/onboard.js";
|
||||||
@@ -93,6 +94,10 @@ export function createCli(): Command {
|
|||||||
addWaitOptions(program.command("wait")),
|
addWaitOptions(program.command("wait")),
|
||||||
).action(withOutput(runWaitCommand));
|
).action(withOutput(runWaitCommand));
|
||||||
|
|
||||||
|
addJsonAndDaemonHostOptions(
|
||||||
|
addArchiveOptions(program.command("archive")),
|
||||||
|
).action(withOutput(runArchiveCommand));
|
||||||
|
|
||||||
// Top-level local daemon shortcuts
|
// Top-level local daemon shortcuts
|
||||||
program.addCommand(onboardCommand());
|
program.addCommand(onboardCommand());
|
||||||
program.addCommand(daemonStartCommand());
|
program.addCommand(daemonStartCommand());
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { Command } from "commander";
|
import { Command } from "commander";
|
||||||
import { connectToDaemon, getDaemonHost, resolveAgentId } from "../../utils/client.js";
|
import { connectToDaemon, getDaemonHost, resolveAgentId } from "../../utils/client.js";
|
||||||
import type {
|
import type {
|
||||||
CommandOptions,
|
CommandOptions,
|
||||||
@@ -24,6 +24,13 @@ export const archiveSchema: OutputSchema<AgentArchiveResult> = {
|
|||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export function addArchiveOptions(cmd: Command): Command {
|
||||||
|
return cmd
|
||||||
|
.description('Archive an agent (soft-delete)')
|
||||||
|
.argument("<id>", "Agent ID, prefix, or name")
|
||||||
|
.option("--force", "Force archive running agent (interrupts active run first)");
|
||||||
|
}
|
||||||
|
|
||||||
export interface AgentArchiveOptions extends CommandOptions {
|
export interface AgentArchiveOptions extends CommandOptions {
|
||||||
force?: boolean;
|
force?: boolean;
|
||||||
host?: string;
|
host?: string;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Command } from "commander";
|
import { Command } from "commander";
|
||||||
import { runModeCommand } from "./mode.js";
|
import { runModeCommand } from "./mode.js";
|
||||||
import { runArchiveCommand } from "./archive.js";
|
import { addArchiveOptions, runArchiveCommand } from "./archive.js";
|
||||||
import { addDeleteOptions, runDeleteCommand } from "./delete.js";
|
import { addDeleteOptions, runDeleteCommand } from "./delete.js";
|
||||||
import { addLsOptions, runLsCommand } from "./ls.js";
|
import { addLsOptions, runLsCommand } from "./ls.js";
|
||||||
import { addRunOptions, runRunCommand } from "./run.js";
|
import { addRunOptions, runRunCommand } from "./run.js";
|
||||||
@@ -69,11 +69,7 @@ export function createAgentCommand(): Command {
|
|||||||
).action(withOutput(runModeCommand));
|
).action(withOutput(runModeCommand));
|
||||||
|
|
||||||
addJsonAndDaemonHostOptions(
|
addJsonAndDaemonHostOptions(
|
||||||
agent
|
addArchiveOptions(agent.command("archive")),
|
||||||
.command("archive")
|
|
||||||
.description("Archive an agent (soft-delete)")
|
|
||||||
.argument("<id>", "Agent ID, prefix, or name")
|
|
||||||
.option("--force", "Force archive running agent (interrupts active run first)"),
|
|
||||||
).action(withOutput(runArchiveCommand));
|
).action(withOutput(runArchiveCommand));
|
||||||
|
|
||||||
addJsonAndDaemonHostOptions(
|
addJsonAndDaemonHostOptions(
|
||||||
|
|||||||
Reference in New Issue
Block a user