Files
openclaw/src/cli/docs-cli.ts

26 lines
793 B
TypeScript
Raw Normal View History

2026-01-07 02:03:06 +01:00
import type { Command } from "commander";
import { docsSearchCommand } from "../commands/docs.js";
import { defaultRuntime } from "../runtime.js";
2026-01-10 20:50:17 +01:00
import { formatDocsLink } from "../terminal/links.js";
import { theme } from "../terminal/theme.js";
2026-01-07 02:03:06 +01:00
export function registerDocsCli(program: Command) {
program
.command("docs")
.description("Search the live Clawdbot docs")
.argument("[query...]", "Search query")
2026-01-10 20:50:17 +01:00
.addHelpText(
"after",
() => `\n${theme.muted("Docs:")} ${formatDocsLink("/hubs", "docs.clawd.bot/hubs")}\n`,
2026-01-10 20:50:17 +01:00
)
2026-01-07 02:03:06 +01:00
.action(async (queryParts: string[]) => {
try {
await docsSearchCommand(queryParts, defaultRuntime);
} catch (err) {
defaultRuntime.error(String(err));
defaultRuntime.exit(1);
}
});
}