docs: align CLI docs and help surface

This commit is contained in:
Peter Steinberger
2026-02-22 20:04:08 +01:00
parent 42b3c52350
commit 72446f419f
10 changed files with 194 additions and 4 deletions

View File

@@ -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);
}

View File

@@ -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,

View File

@@ -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)",

View File

@@ -197,7 +197,7 @@ async function noteChannelPrimer(
"Multi-user DMs: run: " +
formatCliCommand('openclaw config set session.dmScope "per-channel-peer"') +
' (or "per-account-channel-peer" for multi-account channels) to isolate sessions.',
`Docs: ${formatDocsLink("/start/pairing", "start/pairing")}`,
`Docs: ${formatDocsLink("/channels/pairing", "channels/pairing")}`,
"",
...channelLines,
].join("\n"),
@@ -253,7 +253,7 @@ async function maybeConfigureDmPolicies(params: {
"Multi-user DMs: run: " +
formatCliCommand('openclaw config set session.dmScope "per-channel-peer"') +
' (or "per-account-channel-peer" for multi-account channels) to isolate sessions.',
`Docs: ${formatDocsLink("/start/pairing", "start/pairing")}`,
`Docs: ${formatDocsLink("/channels/pairing", "channels/pairing")}`,
].join("\n"),
`${policy.label} DM access`,
);