-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathcli.ts
More file actions
54 lines (52 loc) · 1.59 KB
/
cli.ts
File metadata and controls
54 lines (52 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/env -S deno run --allow-read --allow-write --allow-run --allow-env
/**
* Unified CLI entrypoint for busytown.
*
* Install globally: deno task install
* Then use from anywhere: busytown <command>
*
* @module cli
*/
import { Command } from "@cliffy/command";
import { eventsCommand } from "./scripts/events.ts";
import { mapCommand } from "./scripts/map.ts";
import {
daemonCommand,
restartCommand,
runCommand,
startCommand,
statusCommand,
stopCommand,
} from "./scripts/runner.ts";
import { dashboardCommand } from "./scripts/dashboard.ts";
import { mcpServerCommand } from "./scripts/mcp-server.ts";
import { openDb, pushEvent } from "./lib/event-queue.ts";
await new Command()
.name("busytown")
.description("Multi-agent coordination framework.")
.command("run", runCommand())
.command("start", startCommand())
.command("stop", stopCommand)
.command("restart", restartCommand())
.command("status", statusCommand)
.command("_daemon", daemonCommand())
.command("events", eventsCommand)
.command("map", mapCommand())
.command("dashboard", dashboardCommand())
.command("mcp-server", mcpServerCommand)
.command("plan")
.description("Push a plan.request event for a PRD file.")
.option("--db <path:string>", "Database path", { default: "events.db" })
.arguments("<prd-file:string>")
.action((options, prdFile) => {
const db = openDb(options.db);
try {
const event = pushEvent(db, "user", "plan.request", {
prd_path: prdFile,
});
console.log(JSON.stringify(event));
} finally {
db.close();
}
})
.parse(Deno.args);