mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-06 03:32:54 +00:00
* refactor: move terminal core into package * refactor: move terminal module files * fix: clean terminal package CI followups * test: update lint suppression allowlist * fix: ship terminal core runtime aliases
38 lines
1.4 KiB
TypeScript
38 lines
1.4 KiB
TypeScript
import type { Command } from "commander";
|
|
import { theme } from "../../../packages/terminal-core/src/theme.js";
|
|
import { runCrestodian } from "../../crestodian/crestodian.js";
|
|
import { defaultRuntime } from "../../runtime.js";
|
|
import { runCommandWithRuntime } from "../cli-utils.js";
|
|
import { formatHelpExamples } from "../help-format.js";
|
|
|
|
export function registerCrestodianCommand(program: Command) {
|
|
program
|
|
.command("crestodian")
|
|
.description("Open the ring-zero setup and repair helper")
|
|
.option("-m, --message <text>", "Run one Crestodian request")
|
|
.option("--yes", "Approve persistent config writes for this request", false)
|
|
.option("--json", "Output startup overview as JSON", false)
|
|
.addHelpText(
|
|
"after",
|
|
() =>
|
|
`\n${theme.heading("Examples:")}\n${formatHelpExamples([
|
|
["openclaw", "Start Crestodian."],
|
|
["openclaw crestodian", "Start Crestodian explicitly."],
|
|
['openclaw crestodian -m "status"', "Run one status request."],
|
|
[
|
|
'openclaw crestodian -m "set default model openai/gpt-5.2" --yes',
|
|
"Apply a typed config write.",
|
|
],
|
|
])}`,
|
|
)
|
|
.action(async (opts) => {
|
|
await runCommandWithRuntime(defaultRuntime, async () => {
|
|
await runCrestodian({
|
|
message: opts.message as string | undefined,
|
|
yes: Boolean(opts.yes),
|
|
json: Boolean(opts.json),
|
|
});
|
|
});
|
|
});
|
|
}
|