@@ -58,6 +58,35 @@ function operatorActorId() {
5858 return process . env [ 'EVOLVER_ACTOR_ID' ] ?? process . env [ 'USER' ] ?? process . env [ 'LOGNAME' ] ?? 'cli' ;
5959}
6060export const PACKAGE = '@evomap/evolver-cli' ;
61+ export function cliUsage ( ) {
62+ return [
63+ 'Usage: evolver <command> [options]' ,
64+ '' ,
65+ 'Options:' ,
66+ ' -h, --help Show this help' ,
67+ ' -v, --version Show the installed version' ,
68+ '' ,
69+ 'Proxy options (evolver proxy):' ,
70+ ' --home <dir> Root for assets, store, settings, and traces' ,
71+ ' --store <path> Mailbox store path' ,
72+ ' --settings <path> Proxy settings file' ,
73+ ' --env-file <path> Environment file' ,
74+ '' ,
75+ 'Commands:' ,
76+ ' Daemon: proxy, lifecycle, proxy-token, doctor, setup-hooks' ,
77+ ' Evolution: run, cycle, autoexec, solidify, distill, review, thesis' ,
78+ ' Memory: ingest, inject, recall, reuse, reuse-report, narrative, gene-value' ,
79+ ' Assets: asset-log, asset-trust, asset-health, material, recipe, skill' ,
80+ ' Hub: login, logout, phub, sync, publish, fetch, buy, orders, atp' ,
81+ ' Operations: status, cycles, trigger, value, retention, replay, rebuild-views' ,
82+ ' Tools: dashboard, webui, trajectory-export, migrate, verify' ,
83+ ' Advanced: anti-gene-benchmark, anti-gene-rollout, reset-local-secret' ,
84+ ' skill-distill, skill-md-update' ,
85+ '' ,
86+ 'Run evolver <command> --help for command-specific options.' ,
87+ '' ,
88+ ] . join ( '\n' ) ;
89+ }
6190const LOCAL_SECRET_STATE_KEYS = [ 'node_secret' , 'node_secret_source' , 'node_secret_version' ] ;
6291const LOCAL_SECRET_ENV_VARS = [
6392 'EVOMAP_NODE_SECRET' ,
@@ -1339,6 +1368,10 @@ export async function runInject(argv, deps = {}) {
13391368export const SESSION_START_PREAMBLE = 'evolver memory — use these learned hints silently when directly relevant; do not mention Evolver, preflight, status, or this memory block unless the user asks or reuse materially changes the answer:' ;
13401369export function runCli ( argv ) {
13411370 const cmd = argv [ 0 ] ;
1371+ if ( cmd === undefined || cmd === '--help' || cmd === '-h' ) {
1372+ process . stdout . write ( cliUsage ( ) ) ;
1373+ return 0 ;
1374+ }
13421375 switch ( cmd ) {
13431376 case 'rebuild-views' : {
13441377 const r = rebuildViews ( ) ;
@@ -1385,7 +1418,7 @@ export function runCli(argv) {
13851418 return 0 ;
13861419 }
13871420 default :
1388- process . stderr . write ( '用法: evolver [--version|-v] <status|cycles|cycle capabilities [--json]|cycle show <id>|cycle status [--json]|cycle recover [--limit N] [--json]|cycle watch --repo <path> [--state-file <path>] [--validation-cmd <cmd>] [--json]|trigger|value [--window 7d|30d|all]|narrative [--limit N] [--json]|retention [--json]|retention archive-root [--keep-events N] [--write] [--json]|retention archive-material [--keep-records N] [--write] [--json]|dashboard [--port N] [--no-open]|webui [--port N] [--no-open]|trajectory-export [--input <trace-file-or-dir>] [--output <jsonl>]|gene-value [--gene <id>] [--json]|login|logout|proxy|proxy-token [--settings <file>]|inject session-start|lifecycle <start|stop|restart|status|check|watch|install-service>|phub <init|doctor|status>|replay|rebuild-views|reset-local-secret|asset-log [kind] [limit]|asset-trust <list|show|promote|revoke>|asset-health [--json]|asset-health repair-sidecar --sidecar <kind> --replacement <file> [--write --acknowledge-corrupt-history] [--json]|distill ...|review [limit|--approve <id> [--allow-weak-evidence]|--reject <id>]|recipe build|from-skills|reuse ...|publish ...|sync [--write] [--force] [--scope all|purchased|published] [--export <file.gepx>|--import <file.gepx>] [--json]|material package-gene --material <id> [--write] [--json]|skill fetch ...|fetch (--skill <id>|-s <id>|<id>) [--out <dir>] [--force] [--json]|skill-distill --skill <path> [--execution <json|@file>]|skill-md-update --gene <id> --skill <path> [--dry-run]|autoexec [home]|run [-v|--verbose] [--loop|--mad-dog] [--json]|solidify [--dry-run] [--json]|setup-hooks [--runtime] [--root] [--uninstall]|buy|orders|verify|atp|recall <transcript> (--gene <id> ...|--from-inject)>\n' ) ;
1389- return cmd === undefined ? 0 : 1 ;
1421+ process . stderr . write ( `Unknown command: ${ cmd } \n\n${ cliUsage ( ) } ` ) ;
1422+ return 1 ;
13901423 }
13911424}
0 commit comments