feat: add colored CLI docs links
This commit is contained in:
@@ -2,12 +2,22 @@ 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";
|
||||
|
||||
export function registerDocsCli(program: Command) {
|
||||
program
|
||||
.command("docs")
|
||||
.description("Search the live Clawdbot docs")
|
||||
.argument("[query...]", "Search query")
|
||||
.addHelpText(
|
||||
"after",
|
||||
() =>
|
||||
`\n${theme.muted("Docs:")} ${formatDocsLink(
|
||||
"/hubs",
|
||||
"docs.clawd.bot/hubs",
|
||||
)}\n`,
|
||||
)
|
||||
.action(async (queryParts: string[]) => {
|
||||
try {
|
||||
await docsSearchCommand(queryParts, defaultRuntime);
|
||||
|
||||
Reference in New Issue
Block a user