fix(cli): clarify remaining required options

This commit is contained in:
Vincent Koc
2026-05-09 09:22:04 +08:00
parent 737d5253e5
commit e45b9d7a74
11 changed files with 40 additions and 15 deletions

View File

@@ -2,6 +2,7 @@ import type { Command } from "commander";
import { defaultRuntime } from "../../runtime.js";
import { normalizeOptionalString } from "../../shared/string-coerce.js";
import { getTerminalTableWidth } from "../../terminal/table.js";
import { formatCliCommand } from "../command-format.js";
import { getNodesTheme, runNodesCommand } from "./cli-utils.js";
import { parsePairingList } from "./format.js";
import { renderPendingPairingRequestsTable } from "./pairing-render.js";
@@ -80,7 +81,9 @@ export function registerNodesPairingCommands(nodes: Command) {
await runNodesCommand("remove", async () => {
const nodeId = await resolveNodeId(opts, normalizeOptionalString(opts.node) ?? "");
if (!nodeId) {
defaultRuntime.error("--node required");
defaultRuntime.error(
`--node is required. Run ${formatCliCommand("openclaw nodes pairing pending")} to choose a node request.`,
);
defaultRuntime.exit(1);
return;
}
@@ -106,7 +109,9 @@ export function registerNodesPairingCommands(nodes: Command) {
const nodeId = await resolveNodeId(opts, normalizeOptionalString(opts.node) ?? "");
const name = normalizeOptionalString(opts.name) ?? "";
if (!nodeId || !name) {
defaultRuntime.error("--node and --name required");
defaultRuntime.error(
`--node and --name are required. Run ${formatCliCommand("openclaw nodes pairing pending")} to choose a node, then rerun with --name <displayName>.`,
);
defaultRuntime.exit(1);
return;
}