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

24 lines
823 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";
import { runCommandWithRuntime } from "./cli-utils.js";
2026-01-07 02:03:06 +01:00
export function registerDocsCli(program: Command) {
program
.command("docs")
2026-01-30 03:15:10 +01:00
.description("Search the live OpenClaw docs")
2026-01-07 02:03:06 +01:00
.argument("[query...]", "Search query")
2026-01-10 20:50:17 +01:00
.addHelpText(
"after",
2026-01-30 03:15:10 +01:00
() =>
`\n${theme.muted("Docs:")} ${formatDocsLink("/cli/docs", "docs.openclaw.ai/cli/docs")}\n`,
2026-01-10 20:50:17 +01:00
)
2026-01-07 02:03:06 +01:00
.action(async (queryParts: string[]) => {
await runCommandWithRuntime(defaultRuntime, async () => {
2026-01-07 02:03:06 +01:00
await docsSearchCommand(queryParts, defaultRuntime);
});
2026-01-07 02:03:06 +01:00
});
}