@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.
- package/package.json +1 -1
- package/src/cli.js +86 -113
package/package.json
CHANGED
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] === '
|
|
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} —
|
|
80
|
+
console.log(`kdna v${v} — Runtime control plane for KDNA Core v1
|
|
72
81
|
|
|
73
|
-
|
|
82
|
+
Start here:
|
|
83
|
+
kdna demo minimal <dir> Create a minimal KDNA Core v1 demo
|
|
74
84
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
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
|
-
|
|
92
|
-
|
|
93
|
-
|
|
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
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
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
|
-
|
|
106
|
-
|
|
107
|
-
|
|
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
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
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
|
-
|
|
126
|
-
|
|
127
|
-
|
|
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
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
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
|
-
|
|
148
|
-
|
|
149
|
-
|
|
125
|
+
Flags:
|
|
126
|
+
--json Structured JSON output
|
|
127
|
+
--quiet Suppress non-error output
|
|
150
128
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
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
|
-
|
|
163
|
-
|
|
164
|
-
|
|
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
|
-
|
|
169
|
-
|
|
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
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
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
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
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
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
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
|
|
193
|
-
--quiet
|
|
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) {
|