@@ -1024,26 +1024,65 @@ function buildCliMaintenanceCommands(ctx) {
10241024 }
10251025 }
10261026
1027- function cmdHelp ( ) {
1027+ function cmdHelp ( topicInput ) {
1028+ const topicParts = Array . isArray ( topicInput )
1029+ ? topicInput . map ( item => String ( item || '' ) . trim ( ) ) . filter ( Boolean )
1030+ : ( topicInput ? [ String ( topicInput ) . trim ( ) ] : [ ] )
1031+ const topic = topicParts [ 0 ] || null
1032+ const detail = {
1033+ init : [ 'devcodex init [--profile <project>] [--dry-run]' , 'Initialize the current workspace .devcodex state and Profile baseline.' ] ,
1034+ update : [ 'devcodex update [--dry-run]' , 'Refresh only the current workspace .devcodex runtime state.' ] ,
1035+ status : [ 'devcodex status [--completion] [--json]' , 'Show workspace and user-global adapter readiness.' ] ,
1036+ doctor : [ 'devcodex doctor [--completion] [--json]' , 'Diagnose adapter, native host and workflow readiness.' ] ,
1037+ profile : [ 'devcodex profile plan|init [--tier <tier>] [--dry-run] [--force] [--prod]' , 'Preview or create an advanced project Profile. Ordinary workspaces only need `devcodex init`.' ] ,
1038+ runtime : [ 'devcodex runtime status|prune [--dry-run|--apply] [--json]' , 'Inspect runtime-state usage or preview safe stale-temp cleanup.' ] ,
1039+ uninstall : [ 'npm uninstall -g devcodex' , 'Remove the published global package.' ] ,
1040+ 'global-adapters' : [ 'devcodex global-adapters apply [--dry-run] [--json]' , 'Advanced: refresh user-global host adapters from the current package root.' ] ,
1041+ grok : [ 'devcodex grok [Grok CLI options]' , 'Launch Grok with the user-global DevCodex kernel.' ] ,
1042+ 'migrate-layout' : [ 'devcodex migrate-layout plan|apply|rollback' , 'Advanced: manage centralized workspace layout migration.' ] ,
1043+ probe : [ 'devcodex probe <id> [--json]' , 'Advanced: run bounded local-only diagnostics.' ] ,
1044+ trace : [ 'devcodex trace show|replay [options]' , 'Advanced: inspect or replay LocalTaskTrace evidence.' ] ,
1045+ skill : [ 'devcodex skill plan|resolve [options]' , 'Advanced: inspect Skill resolution; ordinary users do not configure built-in Skills.' ] ,
1046+ task : [ 'devcodex task resolve|verify|risk [options]' , 'Advanced: inspect task identity, reconciliation or explicit risk decisions.' ]
1047+ } [ topic ]
1048+
1049+ if ( topic && detail ) {
1050+ console . log ( `
1051+ ${ c . bold ( `DevCodex ${ topic } help` ) }
1052+
1053+ ${ c . bold ( 'Usage:' ) }
1054+ ${ detail [ 0 ] }
1055+
1056+ ${ detail [ 1 ] }
1057+
1058+ Run ${ c . cyan ( 'devcodex help' ) } for the command overview.
1059+ User guide: https://github.com/devcodex-labs/devcodex#readme
1060+ ` )
1061+ return
1062+ }
1063+
10281064 console . log ( `
10291065 ${ c . bold ( 'DevCodex' ) } — AI-powered development workflow rules for Copilot, Claude, Codex, Gemini & Grok
10301066
10311067 ${ c . bold ( 'Usage:' ) }
10321068 devcodex <command> [options]
10331069 npx devcodex <command> [options] ${ c . dim ( '(without npm link)' ) }
10341070
1035- ${ c . bold ( 'Commands :' ) }
1071+ ${ c . bold ( 'Everyday commands :' ) }
10361072 ${ c . cyan ( 'init' ) } Initialize workspace-owned .devcodex runtime state only
10371073 ${ c . cyan ( 'update' ) } Refresh workspace-owned .devcodex runtime state only
1038- ${ c . cyan ( 'global-adapters' ) } Apply user-level host adapters from package root (source-friendly)
1039- ${ c . cyan ( 'grok' ) } Launch Grok with the user-global DevCodex kernel
1040- ${ c . cyan ( 'migrate-layout' ) } Plan/apply/rollback centralized .devcodex workspace layout
1074+ ${ c . cyan ( 'status' ) } Check workspace and host adapter readiness
1075+ ${ c . cyan ( 'doctor' ) } Diagnose installation or workflow problems
10411076 ${ c . cyan ( 'runtime status' ) } Inspect runtime-state owners, size and last-use timestamps
10421077 ${ c . cyan ( 'runtime prune' ) } Preview safe stale-temp cleanup; add --apply to remove
10431078 ${ c . cyan ( 'profile init' ) } Auto-generate tiered .devcodex/profile/ drafts
10441079 ${ c . cyan ( 'profile plan' ) } Preview Profile root/tier/file actions without writing
1045- ${ c . cyan ( 'status' ) } Show installed files; add --completion for workflow state
1046- ${ c . cyan ( 'doctor' ) } Diagnose host/agent/mode; add --completion for blockers/actions
1080+ ${ c . cyan ( 'help <command>' ) } Show read-only help for one command
1081+
1082+ ${ c . bold ( 'Advanced commands:' ) }
1083+ ${ c . cyan ( 'global-adapters' ) } Apply user-level host adapters from package root
1084+ ${ c . cyan ( 'grok' ) } Launch Grok with the user-global DevCodex kernel
1085+ ${ c . cyan ( 'migrate-layout' ) } Plan/apply/rollback centralized .devcodex workspace layout
10471086 ${ c . cyan ( 'probe' ) } Run bounded local-only diagnostics; accepts IDs and --json
10481087 ${ c . cyan ( 'trace show|replay' ) } Read LocalTaskTrace; trace show --completion reads receipt identities
10491088 ${ c . cyan ( 'skill plan' ) } Plan a dependency-closed whole-SKILL bundle; add --json for BundleDecisionV2
@@ -1060,27 +1099,18 @@ function buildCliMaintenanceCommands(ctx) {
10601099 ${ c . dim ( '--allow-downgrade' ) } (profile init only) Explicitly allow a lower tier; files are retained
10611100 ${ c . dim ( '--json' ) } Emit one DevCodexCliEnvelopeV1 document for supported commands
10621101
1063- ${ c . bold ( 'Examples:' ) }
1064- devcodex global-adapters apply --dry-run # R1a: plan user-global adapters from source tree
1065- devcodex global-adapters apply # R1a: refresh user-global adapters without pack/publish
1066- npm install -g . # R1b: local global install postinstall refresh
1067- npm pack && npm install -g ./devcodex-*.tgz # R2: pre-release tarball
1068- npm install -g devcodex # R3: published install + postinstall adapters
1069- npm update -g devcodex # R3: published upgrade + postinstall refresh
1070- npm install devcodex # Dependency only; prints the required -g guidance
1071- devcodex init # R4: initialize only this workspace .devcodex
1072- devcodex update # R4: refresh only this workspace .devcodex
1073- devcodex grok # Full-evidence Grok launcher using the global kernel
1074- devcodex grok -p "Review this diff" --output-format json
1075- devcodex migrate-layout plan # Generate centralized layout migration manifest
1076- devcodex runtime status # Inspect canonical and legacy runtime state
1077- devcodex runtime prune --dry-run # Preview safe cleanup without writing
1078- devcodex profile init --tier profile-standard # Generate tiered Profile drafts
1079- devcodex profile plan --tier profile-closed-loop # Preview a safe upgrade
1080- devcodex status # Check installation
1081- devcodex skill plan intent load-profile --max-bytes 32768 --json
1082- devcodex skill resolve my-ws-skill --json
1083- devcodex task resolve "my task" --json # Resolve without loading unrelated task bodies
1102+ ${ c . bold ( 'First use:' ) }
1103+ npm install -g devcodex
1104+ cd <your-project-or-workspace>
1105+ devcodex init
1106+ devcodex status
1107+
1108+ ${ c . bold ( 'Update / uninstall:' ) }
1109+ npm update -g devcodex
1110+ npm uninstall -g devcodex
1111+
1112+ Every command supports ${ c . cyan ( '<command> --help' ) } and ${ c . cyan ( 'help <command>' ) } without writing files.
1113+ User guide: https://github.com/devcodex-labs/devcodex#readme
10841114 ` )
10851115 }
10861116
0 commit comments