mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 07:19:35 +00:00
docs: align CLI docs and help surface
This commit is contained in:
@@ -1,7 +1,16 @@
|
||||
import type { Command } from "commander";
|
||||
import { formatDocsLink } from "../terminal/links.js";
|
||||
import { theme } from "../terminal/theme.js";
|
||||
import { registerQrCli } from "./qr-cli.js";
|
||||
|
||||
export function registerClawbotCli(program: Command) {
|
||||
const clawbot = program.command("clawbot").description("Legacy clawbot command aliases");
|
||||
const clawbot = program
|
||||
.command("clawbot")
|
||||
.description("Legacy clawbot command aliases")
|
||||
.addHelpText(
|
||||
"after",
|
||||
() =>
|
||||
`\n${theme.muted("Docs:")} ${formatDocsLink("/cli/clawbot", "docs.openclaw.ai/cli/clawbot")}\n`,
|
||||
);
|
||||
registerQrCli(clawbot);
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@ import path from "node:path";
|
||||
import { Command, Option } from "commander";
|
||||
import { resolveStateDir } from "../config/paths.js";
|
||||
import { routeLogsToStderr } from "../logging/console.js";
|
||||
import { formatDocsLink } from "../terminal/links.js";
|
||||
import { theme } from "../terminal/theme.js";
|
||||
import { pathExists } from "../utils.js";
|
||||
import {
|
||||
buildFishOptionCompletionLine,
|
||||
@@ -230,6 +232,11 @@ export function registerCompletionCli(program: Command) {
|
||||
program
|
||||
.command("completion")
|
||||
.description("Generate shell completion script")
|
||||
.addHelpText(
|
||||
"after",
|
||||
() =>
|
||||
`\n${theme.muted("Docs:")} ${formatDocsLink("/cli/completion", "docs.openclaw.ai/cli/completion")}\n`,
|
||||
)
|
||||
.addOption(
|
||||
new Option("-s, --shell <shell>", "Shell to generate completion for (default: zsh)").choices(
|
||||
COMPLETION_SHELLS,
|
||||
|
||||
@@ -4,6 +4,7 @@ import { loadConfig } from "../config/config.js";
|
||||
import { resolvePairingSetupFromConfig, encodePairingSetupCode } from "../pairing/setup-code.js";
|
||||
import { runCommandWithTimeout } from "../process/exec.js";
|
||||
import { defaultRuntime } from "../runtime.js";
|
||||
import { formatDocsLink } from "../terminal/links.js";
|
||||
import { theme } from "../terminal/theme.js";
|
||||
|
||||
type QrCliOptions = {
|
||||
@@ -38,6 +39,10 @@ export function registerQrCli(program: Command) {
|
||||
program
|
||||
.command("qr")
|
||||
.description("Generate an iOS pairing QR code and setup code")
|
||||
.addHelpText(
|
||||
"after",
|
||||
() => `\n${theme.muted("Docs:")} ${formatDocsLink("/cli/qr", "docs.openclaw.ai/cli/qr")}\n`,
|
||||
)
|
||||
.option(
|
||||
"--remote",
|
||||
"Use gateway.remote.url and gateway.remote token/password (ignores device-pair publicUrl)",
|
||||
|
||||
Reference in New Issue
Block a user