@aikdna/kdna-cli 0.22.3 → 0.22.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/cli.js +86 -113
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aikdna/kdna-cli",
3
- "version": "0.22.3",
3
+ "version": "0.22.4",
4
4
  "description": "KDNA CLI — runtime control plane for verifying, installing, loading, comparing, publishing, and auditing existing .kdna assets.",
5
5
  "type": "commonjs",
6
6
  "bin": {
package/src/cli.js CHANGED
@@ -57,10 +57,19 @@ const { cmdProtocol } = require('./cmds/protocol');
57
57
  // ─── Main ─────────────────────────────────────────────────────────────
58
58
 
59
59
  const args = process.argv.slice(2);
60
- if (!args.length || args[0] === 'help' || args[0] === '--help' || args[0] === '-h') {
60
+ if (!args.length || args[0] === '--help' || args[0] === '-h') {
61
61
  showHelp();
62
62
  process.exit(0);
63
63
  }
64
+ if (args[0] === 'help') {
65
+ const sub = args[1];
66
+ if (sub === 'advanced' || sub === 'legacy') {
67
+ sub === 'advanced' ? showHelpAdvanced() : showHelpLegacy();
68
+ } else {
69
+ showHelp();
70
+ }
71
+ process.exit(0);
72
+ }
64
73
 
65
74
  // Global flags
66
75
  if (args.includes('--quiet')) setQuiet(true);
@@ -68,137 +77,101 @@ if (args.includes('--exit-code')) setExitCodeOnly(true);
68
77
 
69
78
  function showHelp() {
70
79
  const v = require('../package.json').version;
71
- console.log(`kdna v${v} — The runtime control plane for domain judgment
80
+ console.log(`kdna v${v} — Runtime control plane for KDNA Core v1
72
81
 
73
- Usage: kdna <command> [options]
82
+ Start here:
83
+ kdna demo minimal <dir> Create a minimal KDNA Core v1 demo
74
84
 
75
- Dev Source Utilities (non-canonical):
76
- init <name> Deprecated alias for dev scaffold
77
- dev scaffold <name> Scaffold a non-canonical dev source workspace
78
- dev validate <path> Validate a dev source directory
79
- dev pack <path> Build a dev-only non-trusted .kdna bundle
80
- dev unpack <file> Unpack .kdna into a dev source directory
81
- dev inspect <path> Inspect a dev source directory
82
- dev card <path> Display KDNA Card from a dev source directory
83
- inspect <file.kdna> Inspect a .kdna asset
84
- card <file.kdna> [--locale zh-CN] Display KDNA Card from a .kdna asset
85
- explain <name> Natural language summary: axioms, terms, scenarios
86
- publish <file.kdna> Publish an existing Studio-compiled .kdna asset
87
- publish --check <path> Dev source readiness check only
88
- version bump <level> [path] Bump domain version
89
- version bump --suggest [path] Suggest version bump level
85
+ Core v1:
86
+ inspect <path> Inspect v1 source dir or .kdna container
87
+ validate <path> Validate v1 source dir or .kdna container
88
+ pack <src> <out> Deterministic pack into .kdna container
89
+ unpack <in> <out> Extract .kdna container
90
90
 
91
- Studio Authoring Boundary (dev-preview only — use standalone kdna-studio for trusted authoring):
92
- cards validate <project.json> Dev-only card structure check
93
- lock verify <project.json> Dev-only Human Lock status check
94
- studio Removed. Trusted KDNA authoring: npm install -g @aikdna/kdna-studio-cli
91
+ More:
92
+ kdna help advanced Agent runtime, setup, loading, comparison
93
+ kdna help legacy Registry, badges, licenses (pre-v1)
95
94
 
96
- Agent Runtime:
97
- route "<task>" [--json] [--discover] 5-Gate 7-State routing decision
98
- available [--json] List installed domains with v2.1 fields
99
- match "<task>" [--json] Signal matching — find relevant domains
100
- select --input "..." [--json] Selection policy — decide which domains to load
101
- load <name|file.kdna> [--as=prompt|json|raw] Emit asset in agent-ready format
102
- load <name|file.kdna> --profile=index|compact|scenario|full Load profiles (Phase 2)
103
- postvalidate <name> --output <file> Post-generation judgment check
95
+ Flags:
96
+ --json Structured JSON output
97
+ --quiet Suppress non-error output
98
+ `);
99
+ }
104
100
 
105
- Testing & Verification:
106
- verify <name|file.kdna> 3-layer: structure + trust + judgment
107
- verify <name|file.kdna> --i18n I18N verification: locales, overlays, card completeness
108
- verify <name|file.kdna> --governance Governance verification: risk_level, KDNA_CARD, provenance
109
- verify <name|file.kdna> --judgment --run-tests Judgment validation with eval cases
110
- compare <name|file.kdna> --input "..." With/without KDNA reasoning diff
111
- compare <name|file.kdna> --input "..." --report-md Markdown report format
112
- compare <name|file.kdna> --input "..." --report-json JSON report with scoring
113
- diff <name>@<v1> <name>@<v2> Judgment-level diff between versions
114
- test run <name> --input <file> Record test result against domain
115
- test import <run> --as-eval Convert test result to eval card
116
- changelog <name> --from --to Generate judgment changelog
101
+ function showHelpAdvanced() {
102
+ const v = require('../package.json').version;
103
+ console.log(`kdna v${v} Advanced commands
117
104
 
118
- Cluster Composition:
119
- cluster lint <path> Validate cluster manifest
120
- cluster match <path> --input ".." Match input to cluster domains
121
- cluster compose <path> --input Compose context with source attribution
122
- cluster conflicts <path> --input Detect inter-domain conflicts
123
- cluster graph <path> Output domain relationship graph (DOT/JSON)
105
+ Core v1:
106
+ inspect <path> Inspect v1 source dir or .kdna container
107
+ validate <path> Validate v1 source dir or .kdna container
108
+ pack <src> <out> Deterministic pack into .kdna container
109
+ unpack <in> <out> Extract .kdna container
110
+ demo minimal <dir> [--force] Create a minimal v1 fixture
124
111
 
125
- Work Pack (reusable AI work capabilities):
126
- workpack init <name> [--domain] Scaffold a new Work Pack from template
127
- workpack validate <path> Schema validation + structural completeness (L0→L1)
128
- workpack validate <path> --json Machine-readable validation output
129
- workpack inspect <path> Show Work Pack structure, KDNA refs, skills, gates
130
- workpack inspect <path> --json Machine-readable inspection output
131
- workpack explain <path> Natural-language explanation of what the Work Pack does
132
- workpack plan <path> [--input] Dry-run execution plan — what WOULD happen
133
- workpack run <path> --input <f> Execute Work Pack (--dry-run for simulation)
134
- workpack report <session-id> Display session report
112
+ Setup:
113
+ setup One-command setup: CLI + skill + data root
114
+ doctor [--agents] [--domains] [--json] System health check
135
115
 
136
- Governance & Release (Phase 6):
137
- proposal create --from-test <run> --domain <path> Create improvement proposal
138
- proposal validate <proposal.json> Validate proposal structure
139
- review accept <proposal> --by --reason Accept improvement proposal
140
- review reject <proposal> --by --reason Reject improvement proposal
141
- lock card <id> --by --reason Record human lock on a card
142
- evolution add-proposal <file> Add proposal to evolution record
143
- evolution add-lock <file> Add lock to evolution record
144
- evolution report <domain> Show domain evolution history
145
- regression <old> <new> --evals <dir> Detect judgment regression
116
+ Agent Runtime:
117
+ load <name|file> [--as=prompt|json|raw] Emit asset in agent-ready form
118
+ load <name|file> --profile=index|compact|scenario|full Load profiles
119
+ verify <name|file> [--structure|--trust|--judgment] 3-layer verification
120
+ compare <name|file> --input "..." With/without KDNA reasoning diff
121
+
122
+ Authoring (beta):
123
+ Studio authoring: npm install -g @aikdna/kdna-studio-cli
146
124
 
147
- Quality & Distribution (Phase 7):
148
- badge compute <domain> Compute quality badge (draft/tested/trusted)
149
- registry audit --scope <@scope> Audit registry scope health
125
+ Flags:
126
+ --json Structured JSON output
127
+ --quiet Suppress non-error output
150
128
 
151
- Registry & Distribution:
152
- install <name> Install domain from registry
153
- install <file.kdna> Install a local .kdna asset
154
- install <file.kdna> --trusted Install with mandatory trust verification
155
- remove <name> Uninstall a domain
156
- update <name> Update installed domain
157
- info <name> Show domain metadata and trust status
158
- list [--available] List installed or available domains
159
- search <keyword> Search registry
160
- registry refresh Refresh registry cache
129
+ More:
130
+ kdna help legacy Legacy / experimental commands
131
+ `);
132
+ }
161
133
 
162
- Identity & Signing:
163
- identity init Generate Ed25519 signing key
164
- identity show Display public key and buyer ID
165
- identity export [--out] Backup private key (encrypted)
166
- identity import <file> Restore identity from backup
134
+ function showHelpLegacy() {
135
+ const v = require('../package').version;
136
+ console.log(`kdna v${v} Legacy / experimental commands
167
137
 
168
- Setup:
169
- setup One-command setup: CLI + skill + data root
138
+ Not part of the current KDNA Core v1 first-run path. Preserved for
139
+ backward compatibility. These commands may change or be removed.
170
140
 
171
- Trace & Diagnostics:
172
- doctor [--agents] [--domains] [--json] System health check
173
- trace [--json] [--since 7d] [--export <file>] Agent judgment trace
174
- history [--stats] [--domain <name>] [--agent <name>] Recent usage
141
+ Registry (legacy — kdna-registry is a legacy experiment):
142
+ install <name> Install domain from legacy registry
143
+ remove <name> Uninstall a domain
144
+ update <name> Update installed domain
145
+ info <name> Show domain metadata
146
+ list [--available] List installed or available domains
147
+ search <keyword> Search legacy registry
148
+ registry refresh Refresh legacy registry cache
175
149
 
176
- License & Authorization:
177
- license generate <domain> --to <email> Generate signed license
178
- license install <license.json> Register license for auto-decrypt
179
- license activate <domain> --key --server Activate license from entitlement source
180
- license sync [domain] [--server] Refresh entitlement / revocation status
181
- license verify <license.json> Verify license signature
182
- license bind <license.json> Bind license to this machine
183
- license show <license.json> Display license details
184
- license status [domain] [--json] Show installed license activation status
150
+ Legacy dev source utilities:
151
+ dev validate <path> Validate a dev source directory
152
+ dev pack <path> Build a dev-only .kdna bundle
153
+ dev unpack <file> Unpack .kdna into a dev source directory
154
+ dev inspect <path> Inspect a dev source directory
185
155
 
186
- Protected Assets (RFC-0009):
187
- protect <file.kdna> --out <file.kdna> [--entries <list>] Encrypt entries with password
188
- unlock <file.kdna> [--profile compact|index|full] Decrypt and load protected asset
189
- recover <file.kdna> --out <file.kdna> [--code-stdin] Reset password with recovery code
156
+ Legacy operations:
157
+ badge compute <domain> Compute quality badge (pre-v1)
158
+ registry audit --scope <@scope> Audit registry scope health
159
+ license <subcommand> ... License management
160
+ protect / unlock / recover Protected assets (RFC-0009)
161
+ publish <file.kdna> Publish to legacy registry
162
+ identity <subcommand> ... Ed25519 signing key management
163
+ cluster <subcommand> ... Cluster composition
164
+ workpack <subcommand> ... Work Pack (experimental)
165
+ governance / proposal / review / evolution / regression
166
+ trace / history / route / match / select / postvalidate
167
+ test run / test import / changelog / diff / compare
168
+ explain / card / version bump
190
169
 
191
170
  Flags:
192
- --json Structured JSON output (machine-readable)
193
- --quiet Suppress non-error output
194
-
195
- Exit Codes:
196
- 0 OK 1 VALIDATION_FAILED 2 INPUT_ERROR 3 TRUST_FAILED
197
- 4 JUDGMENT_QUALITY_FAILED 5 REGISTRY_ERROR 6 PROVIDER_ERROR
198
- 7 POLICY_VIOLATION 8 HUMAN_LOCK_REQUIRED
171
+ --json Structured JSON output
172
+ --quiet Suppress non-error output
199
173
  `);
200
174
  }
201
-
202
175
  const cmd = args[0];
203
176
 
204
177
  switch (cmd) {