trustgraph/ts/packages/cli/src/index.ts

41 lines
1.3 KiB
TypeScript
Raw Normal View History

2026-04-05 21:09:33 -05:00
#!/usr/bin/env node
/**
* Unified TrustGraph CLI.
*
* Replaces the 60+ individual Python CLI scripts with a single
* `tg` command using subcommands.
*
* Python reference: trustgraph-cli/trustgraph/cli/
*/
import { Command } from "commander";
import { registerAgentCommands } from "./commands/agent.js";
import { registerGraphRagCommands } from "./commands/graph-rag.js";
import { registerConfigCommands } from "./commands/config.js";
import { registerFlowCommands } from "./commands/flow.js";
2026-04-05 22:44:45 -05:00
import { registerLibraryCommands } from "./commands/library.js";
import { registerTriplesCommands } from "./commands/triples.js";
import { registerEmbeddingsCommands } from "./commands/embeddings.js";
2026-04-05 21:09:33 -05:00
const program = new Command();
program
.name("tg")
.description("TrustGraph CLI — interact with TrustGraph services")
.version("0.1.0")
2026-06-01 16:22:25 -05:00
.option("-g, --gateway <url>", "Gateway WebSocket URL", "ws://localhost:8088/api/v1/rpc")
2026-04-05 22:44:45 -05:00
.option("-u, --user <id>", "User identifier", "cli")
2026-04-05 21:09:33 -05:00
.option("-t, --token <token>", "Authentication token")
.option("-f, --flow <id>", "Flow ID", "default");
registerAgentCommands(program);
registerGraphRagCommands(program);
registerConfigCommands(program);
registerFlowCommands(program);
2026-04-05 22:44:45 -05:00
registerLibraryCommands(program);
registerTriplesCommands(program);
registerEmbeddingsCommands(program);
2026-04-05 21:09:33 -05:00
program.parse();