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

@@ -4,6 +4,7 @@ import { defaultRuntime } from "../runtime.js";
import { normalizeOptionalString } from "../shared/string-coerce.js";
import { formatDocsLink } from "../terminal/links.js";
import { theme } from "../terminal/theme.js";
import { formatCliCommand } from "./command-format.js";
import type { GatewayRpcOpts } from "./gateway-rpc.js";
import { addGatewayClientOptions, callGatewayFromCli } from "./gateway-rpc.js";
@@ -62,7 +63,9 @@ export function registerSystemCli(program: Command) {
async () => {
const text = normalizeOptionalString(opts.text) ?? "";
if (!text) {
throw new Error("--text is required");
throw new Error(
`--text is required. Example: ${formatCliCommand('openclaw system event --text "deploy finished"')}.`,
);
}
const mode = normalizeWakeMode(opts.mode);
return await callGatewayFromCli("wake", opts, { mode, text }, { expectFinal: false });