Spaces:
Paused
Paused
Download src/cli/docs-cli.ts from Gaston895/opengsstec: direct link, hf CLI and curl.
- Browser
- Download file 823 Bytes
-
https://huggingface.co/spaces/Gaston895/opengsstec/resolve/main/src/cli/docs-cli.ts
- Command line
-
hf download hf://spaces/Gaston895/opengsstec/src/cli/docs-cli.ts
-
curl -L -o docs-cli.ts https://huggingface.co/spaces/Gaston895/opengsstec/resolve/main/src/cli/docs-cli.ts
823 Bytes
| import type { Command } from "commander"; | |
| import { docsSearchCommand } from "../commands/docs.js"; | |
| import { defaultRuntime } from "../runtime.js"; | |
| import { formatDocsLink } from "../terminal/links.js"; | |
| import { theme } from "../terminal/theme.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); | |
| }); | |
| }); | |
| } | |