feat(cli): add client commands and home-based local runtime defaults
This commit is contained in:
@@ -5,6 +5,14 @@ import { doctor } from "./commands/doctor.js";
|
||||
import { envCommand } from "./commands/env.js";
|
||||
import { configure } from "./commands/configure.js";
|
||||
import { heartbeatRun } from "./commands/heartbeat-run.js";
|
||||
import { runCommand } from "./commands/run.js";
|
||||
import { registerContextCommands } from "./commands/client/context.js";
|
||||
import { registerCompanyCommands } from "./commands/client/company.js";
|
||||
import { registerIssueCommands } from "./commands/client/issue.js";
|
||||
import { registerAgentCommands } from "./commands/client/agent.js";
|
||||
import { registerApprovalCommands } from "./commands/client/approval.js";
|
||||
import { registerActivityCommands } from "./commands/client/activity.js";
|
||||
import { registerDashboardCommands } from "./commands/client/dashboard.js";
|
||||
|
||||
const program = new Command();
|
||||
|
||||
@@ -26,7 +34,9 @@ program
|
||||
.option("--repair", "Attempt to repair issues automatically")
|
||||
.alias("--fix")
|
||||
.option("-y, --yes", "Skip repair confirmation prompts")
|
||||
.action(doctor);
|
||||
.action(async (opts) => {
|
||||
await doctor(opts);
|
||||
});
|
||||
|
||||
program
|
||||
.command("env")
|
||||
@@ -41,6 +51,15 @@ program
|
||||
.option("-s, --section <section>", "Section to configure (llm, database, logging, server, secrets)")
|
||||
.action(configure);
|
||||
|
||||
program
|
||||
.command("run")
|
||||
.description("Bootstrap local setup (onboard + doctor) and run Paperclip")
|
||||
.option("-c, --config <path>", "Path to config file")
|
||||
.option("-i, --instance <id>", "Local instance id (default: default)")
|
||||
.option("--repair", "Attempt automatic repairs during doctor", true)
|
||||
.option("--no-repair", "Disable automatic repairs during doctor")
|
||||
.action(runCommand);
|
||||
|
||||
const heartbeat = program.command("heartbeat").description("Heartbeat utilities");
|
||||
|
||||
heartbeat
|
||||
@@ -48,7 +67,10 @@ heartbeat
|
||||
.description("Run one agent heartbeat and stream live logs")
|
||||
.requiredOption("-a, --agent-id <agentId>", "Agent ID to invoke")
|
||||
.option("-c, --config <path>", "Path to config file")
|
||||
.option("--context <path>", "Path to CLI context file")
|
||||
.option("--profile <name>", "CLI context profile name")
|
||||
.option("--api-base <url>", "Base URL for the Paperclip server API")
|
||||
.option("--api-key <token>", "Bearer token for agent-authenticated calls")
|
||||
.option(
|
||||
"--source <source>",
|
||||
"Invocation source (timer | assignment | on_demand | automation)",
|
||||
@@ -56,7 +78,19 @@ heartbeat
|
||||
)
|
||||
.option("--trigger <trigger>", "Trigger detail (manual | ping | callback | system)", "manual")
|
||||
.option("--timeout-ms <ms>", "Max time to wait before giving up", "0")
|
||||
.option("--json", "Output raw JSON where applicable")
|
||||
.option("--debug", "Show raw adapter stdout/stderr JSON chunks")
|
||||
.action(heartbeatRun);
|
||||
|
||||
program.parse();
|
||||
registerContextCommands(program);
|
||||
registerCompanyCommands(program);
|
||||
registerIssueCommands(program);
|
||||
registerAgentCommands(program);
|
||||
registerApprovalCommands(program);
|
||||
registerActivityCommands(program);
|
||||
registerDashboardCommands(program);
|
||||
|
||||
program.parseAsync().catch((err) => {
|
||||
console.error(err instanceof Error ? err.message : String(err));
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user