mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-05 19:52:54 +00:00
* refactor: move terminal core into package * refactor: move terminal module files * fix: clean terminal package CI followups * test: update lint suppression allowlist * fix: ship terminal core runtime aliases
24 lines
865 B
TypeScript
24 lines
865 B
TypeScript
import type { Command } from "commander";
|
|
import { formatDocsLink } from "../../packages/terminal-core/src/links.js";
|
|
import { theme } from "../../packages/terminal-core/src/theme.js";
|
|
import { docsSearchCommand } from "../commands/docs.js";
|
|
import { defaultRuntime } from "../runtime.js";
|
|
import { runCommandWithRuntime } from "./cli-utils.js";
|
|
|
|
export function registerDocsCli(program: Command) {
|
|
program
|
|
.command("docs")
|
|
.description("Search the live OpenClaw docs")
|
|
.argument("[query...]", "Search query")
|
|
.addHelpText(
|
|
"after",
|
|
() =>
|
|
`\n${theme.muted("Docs:")} ${formatDocsLink("/cli/docs", "docs.openclaw.ai/cli/docs")}\n`,
|
|
)
|
|
.action(async (queryParts: string[]) => {
|
|
await runCommandWithRuntime(defaultRuntime, async () => {
|
|
await docsSearchCommand(queryParts, defaultRuntime);
|
|
});
|
|
});
|
|
}
|