mdkg 0.0.6 → 0.0.7

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/README.md CHANGED
@@ -176,10 +176,13 @@ Current source behavior:
176
176
  - `mdkg skill show <slug>`
177
177
  - `mdkg skill validate [<slug>]`
178
178
  - `mdkg skill sync`
179
- - machine-readable skill discovery is available through:
179
+ - machine-readable skill discovery and inspection is available through:
180
180
  - `mdkg skill list --json`
181
181
  - `mdkg skill search "<query>" --json`
182
182
  - `mdkg skill show <slug> --json`
183
+ - `mdkg skill list --xml|--toon|--md`
184
+ - `mdkg skill search "<query>" --xml|--toon|--md`
185
+ - `mdkg skill show <slug> --xml|--toon|--md`
183
186
  - work items may reference `skills: [slug,...]`
184
187
  - packs may include skills with `--skills` and `--skills-depth`
185
188
  - mdkg indexes and discovers skills but does not execute skill scripts
@@ -201,11 +204,13 @@ This repo now dogfoods three internal skills:
201
204
  This release includes:
202
205
  - `init --agent`
203
206
  - default ignore updates with `--no-update-ignores` for `.mdkg/index/` and `.mdkg/pack/`
207
+ - root-only published init seed config
204
208
  - skills indexing and search/show/list support
205
209
  - optional `skills: [...]` on work items
206
210
  - pack-time skill inclusion
207
211
  - latest-checkpoint resolver + index hint
208
212
  - events JSONL validation
213
+ - XML / TOON / Markdown output for node and skill list/search/show
209
214
  - product-specific skill mirrors for Codex/OpenAI and Claude
210
215
  - shared `AGENT_START.md` startup guidance
211
216
 
package/dist/cli.js CHANGED
@@ -134,7 +134,7 @@ function printIndexHelp(log) {
134
134
  }
135
135
  function printShowHelp(log) {
136
136
  log("Usage:");
137
- log(" mdkg show <id-or-qid> [--ws <alias>] [--meta] [--json]");
137
+ log(" mdkg show <id-or-qid> [--ws <alias>] [--meta] [--json|--xml|--toon|--md]");
138
138
  log("\nWhen to use:");
139
139
  log(" Inspect one mdkg node exactly. Use `mdkg skill show <slug>` for skills.");
140
140
  log("\nDefault behavior:");
@@ -144,7 +144,8 @@ function printShowHelp(log) {
144
144
  function printListHelp(log) {
145
145
  log("Usage:");
146
146
  log(" mdkg list [--type <type>] [--status <status>] [--ws <alias>] [--epic <id>]");
147
- log(" [--priority <n>] [--blocked] [--tags <tag,tag,...>] [--tags-mode any|all] [--json]");
147
+ log(" [--priority <n>] [--blocked] [--tags <tag,tag,...>] [--tags-mode any|all]");
148
+ log(" [--json|--xml|--toon|--md]");
148
149
  log("\nWhen to use:");
149
150
  log(" List mdkg nodes. Use `mdkg skill list` for skills.");
150
151
  printGlobalOptions(log);
@@ -152,7 +153,7 @@ function printListHelp(log) {
152
153
  function printSearchHelp(log) {
153
154
  log("Usage:");
154
155
  log(' mdkg search "<query>" [--type <type>] [--status <status>] [--ws <alias>]');
155
- log(" [--tags <tag,tag,...>] [--tags-mode any|all] [--json]");
156
+ log(" [--tags <tag,tag,...>] [--tags-mode any|all] [--json|--xml|--toon|--md]");
156
157
  log("\nWhen to use:");
157
158
  log(" Search mdkg nodes by metadata. Use `mdkg skill search` for skills.");
158
159
  printGlobalOptions(log);
@@ -210,21 +211,21 @@ function printSkillHelp(log, subcommand) {
210
211
  return;
211
212
  case "list":
212
213
  log("Usage:");
213
- log(" mdkg skill list [--tags <tag,tag,...>] [--tags-mode any|all] [--json]");
214
+ log(" mdkg skill list [--tags <tag,tag,...>] [--tags-mode any|all] [--json|--xml|--toon|--md]");
214
215
  log("\nWhen to use:");
215
216
  log(" Discover skills directly, including stage-tagged orchestrator lookups.");
216
217
  printGlobalOptions(log);
217
218
  return;
218
219
  case "show":
219
220
  log("Usage:");
220
- log(" mdkg skill show <slug> [--meta] [--json]");
221
+ log(" mdkg skill show <slug> [--meta] [--json|--xml|--toon|--md]");
221
222
  log("\nWhen to use:");
222
223
  log(" Inspect one skill body or metadata after discovery.");
223
224
  printGlobalOptions(log);
224
225
  return;
225
226
  case "search":
226
227
  log("Usage:");
227
- log(' mdkg skill search "<query>" [--tags <tag,tag,...>] [--tags-mode any|all] [--json]');
228
+ log(' mdkg skill search "<query>" [--tags <tag,tag,...>] [--tags-mode any|all] [--json|--xml|--toon|--md]');
228
229
  log("\nWhen to use:");
229
230
  log(" Search skills by trigger text, tags, and stage conventions like `stage:plan`.");
230
231
  printGlobalOptions(log);
@@ -244,9 +245,9 @@ function printSkillHelp(log, subcommand) {
244
245
  default:
245
246
  log("Usage:");
246
247
  log(' mdkg skill new <slug> "<name>" --description "<description>" [options]');
247
- log(" mdkg skill list [--tags <tag,tag,...>] [--tags-mode any|all] [--json]");
248
- log(" mdkg skill show <slug> [--meta] [--json]");
249
- log(' mdkg skill search "<query>" [--tags <tag,tag,...>] [--tags-mode any|all] [--json]');
248
+ log(" mdkg skill list [--tags <tag,tag,...>] [--tags-mode any|all] [--json|--xml|--toon|--md]");
249
+ log(" mdkg skill show <slug> [--meta] [--json|--xml|--toon|--md]");
250
+ log(' mdkg skill search "<query>" [--tags <tag,tag,...>] [--tags-mode any|all] [--json|--xml|--toon|--md]');
250
251
  log(" mdkg skill validate [<slug>]");
251
252
  log(" mdkg skill sync [--force]");
252
253
  log("\nNotes:");
@@ -528,6 +529,25 @@ function parseTagsModeFlag(value) {
528
529
  }
529
530
  throw new errors_1.UsageError("--tags-mode must be any or all");
530
531
  }
532
+ function parseQueryOutputFormat(parsed) {
533
+ const enabled = [];
534
+ if (parseBooleanFlag("--json", parsed.flags["--json"])) {
535
+ enabled.push("json");
536
+ }
537
+ if (parseBooleanFlag("--xml", parsed.flags["--xml"])) {
538
+ enabled.push("xml");
539
+ }
540
+ if (parseBooleanFlag("--toon", parsed.flags["--toon"])) {
541
+ enabled.push("toon");
542
+ }
543
+ if (parseBooleanFlag("--md", parsed.flags["--md"])) {
544
+ enabled.push("md");
545
+ }
546
+ if (enabled.length > 1) {
547
+ throw new errors_1.UsageError("choose at most one output flag: --json, --xml, --toon, or --md");
548
+ }
549
+ return enabled[0];
550
+ }
531
551
  function handleCommandError(err, command, runtime) {
532
552
  const message = err instanceof Error ? err.message : String(err);
533
553
  if (err instanceof errors_1.UsageError) {
@@ -622,12 +642,12 @@ function runSkillSubcommand(parsed, root) {
622
642
  const tagsMode = parseTagsModeFlag(parsed.flags["--tags-mode"]);
623
643
  const noCache = parseBooleanFlag("--no-cache", parsed.flags["--no-cache"]);
624
644
  const noReindex = parseBooleanFlag("--no-reindex", parsed.flags["--no-reindex"]);
625
- const json = parseBooleanFlag("--json", parsed.flags["--json"]);
645
+ const format = parseQueryOutputFormat(parsed);
626
646
  (0, skill_1.runSkillListCommand)({
627
647
  root,
628
648
  tags,
629
649
  tagsMode,
630
- json,
650
+ format,
631
651
  noCache,
632
652
  noReindex,
633
653
  });
@@ -639,14 +659,14 @@ function runSkillSubcommand(parsed, root) {
639
659
  throw new errors_1.UsageError("skill show requires <slug>");
640
660
  }
641
661
  const metaOnly = parseBooleanFlag("--meta", parsed.flags["--meta"]);
642
- const json = parseBooleanFlag("--json", parsed.flags["--json"]);
662
+ const format = parseQueryOutputFormat(parsed);
643
663
  const noCache = parseBooleanFlag("--no-cache", parsed.flags["--no-cache"]);
644
664
  const noReindex = parseBooleanFlag("--no-reindex", parsed.flags["--no-reindex"]);
645
665
  (0, skill_1.runSkillShowCommand)({
646
666
  root,
647
667
  slug,
648
668
  metaOnly,
649
- json,
669
+ format,
650
670
  noCache,
651
671
  noReindex,
652
672
  });
@@ -659,7 +679,7 @@ function runSkillSubcommand(parsed, root) {
659
679
  const query = parsed.positionals.slice(2).join(" ");
660
680
  const tags = parseCsvFlag("--tags", parsed.flags["--tags"]);
661
681
  const tagsMode = parseTagsModeFlag(parsed.flags["--tags-mode"]);
662
- const json = parseBooleanFlag("--json", parsed.flags["--json"]);
682
+ const format = parseQueryOutputFormat(parsed);
663
683
  const noCache = parseBooleanFlag("--no-cache", parsed.flags["--no-cache"]);
664
684
  const noReindex = parseBooleanFlag("--no-reindex", parsed.flags["--no-reindex"]);
665
685
  (0, skill_1.runSkillSearchCommand)({
@@ -667,7 +687,7 @@ function runSkillSubcommand(parsed, root) {
667
687
  query,
668
688
  tags,
669
689
  tagsMode,
670
- json,
690
+ format,
671
691
  noCache,
672
692
  noReindex,
673
693
  });
@@ -930,7 +950,7 @@ function runCommand(parsed, root, runtime) {
930
950
  }
931
951
  const ws = requireFlagValue("--ws", parsed.flags["--ws"]);
932
952
  const metaOnly = parseBooleanFlag("--meta", parsed.flags["--meta"]);
933
- const json = parseBooleanFlag("--json", parsed.flags["--json"]);
953
+ const format = parseQueryOutputFormat(parsed);
934
954
  const noCache = parseBooleanFlag("--no-cache", parsed.flags["--no-cache"]);
935
955
  const noReindex = parseBooleanFlag("--no-reindex", parsed.flags["--no-reindex"]);
936
956
  (0, show_1.runShowCommand)({
@@ -938,7 +958,7 @@ function runCommand(parsed, root, runtime) {
938
958
  id,
939
959
  ws,
940
960
  metaOnly,
941
- json,
961
+ format,
942
962
  noCache,
943
963
  noReindex,
944
964
  });
@@ -956,7 +976,7 @@ function runCommand(parsed, root, runtime) {
956
976
  const blocked = parseBooleanFlag("--blocked", parsed.flags["--blocked"]);
957
977
  const tags = parseCsvFlag("--tags", parsed.flags["--tags"]);
958
978
  const tagsMode = parseTagsModeFlag(parsed.flags["--tags-mode"]);
959
- const json = parseBooleanFlag("--json", parsed.flags["--json"]);
979
+ const format = parseQueryOutputFormat(parsed);
960
980
  const noCache = parseBooleanFlag("--no-cache", parsed.flags["--no-cache"]);
961
981
  const noReindex = parseBooleanFlag("--no-reindex", parsed.flags["--no-reindex"]);
962
982
  (0, list_1.runListCommand)({
@@ -969,7 +989,7 @@ function runCommand(parsed, root, runtime) {
969
989
  blocked,
970
990
  tags,
971
991
  tagsMode,
972
- json,
992
+ format,
973
993
  noCache,
974
994
  noReindex,
975
995
  });
@@ -985,7 +1005,7 @@ function runCommand(parsed, root, runtime) {
985
1005
  const status = requireFlagValue("--status", parsed.flags["--status"]);
986
1006
  const tags = parseCsvFlag("--tags", parsed.flags["--tags"]);
987
1007
  const tagsMode = parseTagsModeFlag(parsed.flags["--tags-mode"]);
988
- const json = parseBooleanFlag("--json", parsed.flags["--json"]);
1008
+ const format = parseQueryOutputFormat(parsed);
989
1009
  const noCache = parseBooleanFlag("--no-cache", parsed.flags["--no-cache"]);
990
1010
  const noReindex = parseBooleanFlag("--no-reindex", parsed.flags["--no-reindex"]);
991
1011
  (0, search_1.runSearchCommand)({
@@ -996,7 +1016,7 @@ function runCommand(parsed, root, runtime) {
996
1016
  status,
997
1017
  tags,
998
1018
  tagsMode,
999
- json,
1019
+ format,
1000
1020
  noCache,
1001
1021
  noReindex,
1002
1022
  });
@@ -53,13 +53,14 @@ function runListCommand(options) {
53
53
  tagsMode: options.tagsMode,
54
54
  });
55
55
  const sorted = (0, sort_1.sortNodesByQid)(filtered);
56
- if (options.json) {
57
- (0, query_output_1.writeJson)({
56
+ const format = options.format ?? (options.json ? "json" : undefined);
57
+ if (format) {
58
+ (0, query_output_1.writeStructuredOutput)({
58
59
  command: "list",
59
60
  kind: "node",
60
61
  count: sorted.length,
61
62
  items: sorted.map(query_output_1.toNodeSummaryJson),
62
- });
63
+ }, format);
63
64
  return;
64
65
  }
65
66
  (0, query_output_1.writeCount)(sorted.length, sorted.length === 0 ? "no nodes matched current filters" : undefined);
@@ -5,6 +5,7 @@ exports.toNodeDetailJson = toNodeDetailJson;
5
5
  exports.toSkillSummaryJson = toSkillSummaryJson;
6
6
  exports.toSkillDetailJson = toSkillDetailJson;
7
7
  exports.writeJson = writeJson;
8
+ exports.writeStructuredOutput = writeStructuredOutput;
8
9
  exports.writeCount = writeCount;
9
10
  function toNodeSummaryJson(node) {
10
11
  return {
@@ -76,6 +77,113 @@ function toSkillDetailJson(skill, body) {
76
77
  function writeJson(payload) {
77
78
  console.log(JSON.stringify(payload, null, 2));
78
79
  }
80
+ function escapeXml(value) {
81
+ return value
82
+ .replace(/&/g, "&amp;")
83
+ .replace(/</g, "&lt;")
84
+ .replace(/>/g, "&gt;")
85
+ .replace(/"/g, "&quot;")
86
+ .replace(/'/g, "&apos;");
87
+ }
88
+ function isPrimitive(value) {
89
+ return (value === null ||
90
+ typeof value === "string" ||
91
+ typeof value === "number" ||
92
+ typeof value === "boolean");
93
+ }
94
+ function objectToXml(tag, value, indent = "") {
95
+ if (value === undefined) {
96
+ return [];
97
+ }
98
+ if (Array.isArray(value)) {
99
+ const lines = [`${indent}<${tag}>`];
100
+ for (const item of value) {
101
+ lines.push(...objectToXml("item", item, `${indent} `));
102
+ }
103
+ lines.push(`${indent}</${tag}>`);
104
+ return lines;
105
+ }
106
+ if (isPrimitive(value)) {
107
+ return [`${indent}<${tag}>${escapeXml(value === null ? "" : String(value))}</${tag}>`];
108
+ }
109
+ const lines = [`${indent}<${tag}>`];
110
+ for (const [key, child] of Object.entries(value)) {
111
+ lines.push(...objectToXml(key, child, `${indent} `));
112
+ }
113
+ lines.push(`${indent}</${tag}>`);
114
+ return lines;
115
+ }
116
+ function formatMarkdownScalar(value) {
117
+ return value === null ? "null" : String(value);
118
+ }
119
+ function objectToMarkdown(value, lines, indent = "", key) {
120
+ if (value === undefined) {
121
+ return;
122
+ }
123
+ if (Array.isArray(value)) {
124
+ if (key) {
125
+ lines.push(`${indent}- ${key}:`);
126
+ }
127
+ const childIndent = key ? `${indent} ` : indent;
128
+ if (value.length === 0) {
129
+ lines.push(`${childIndent}- []`);
130
+ return;
131
+ }
132
+ for (const item of value) {
133
+ if (isPrimitive(item)) {
134
+ lines.push(`${childIndent}- ${formatMarkdownScalar(item)}`);
135
+ continue;
136
+ }
137
+ lines.push(`${childIndent}-`);
138
+ objectToMarkdown(item, lines, `${childIndent} `);
139
+ }
140
+ return;
141
+ }
142
+ if (isPrimitive(value)) {
143
+ if (!key) {
144
+ lines.push(`${indent}- ${formatMarkdownScalar(value)}`);
145
+ return;
146
+ }
147
+ lines.push(`${indent}- ${key}: ${formatMarkdownScalar(value)}`);
148
+ return;
149
+ }
150
+ if (key) {
151
+ lines.push(`${indent}- ${key}:`);
152
+ }
153
+ const childIndent = key ? `${indent} ` : indent;
154
+ for (const [childKey, childValue] of Object.entries(value)) {
155
+ objectToMarkdown(childValue, lines, childIndent, childKey);
156
+ }
157
+ }
158
+ function writeXml(payload) {
159
+ const lines = ['<?xml version="1.0" encoding="UTF-8"?>'];
160
+ lines.push(...objectToXml("response", payload));
161
+ console.log(lines.join("\n"));
162
+ }
163
+ function writeToon(payload) {
164
+ console.log(JSON.stringify(payload, null, 2));
165
+ }
166
+ function writeMarkdown(payload) {
167
+ const lines = ["# mdkg response"];
168
+ objectToMarkdown(payload, lines);
169
+ console.log(lines.join("\n"));
170
+ }
171
+ function writeStructuredOutput(payload, format) {
172
+ switch (format) {
173
+ case "json":
174
+ writeJson(payload);
175
+ return;
176
+ case "xml":
177
+ writeXml(payload);
178
+ return;
179
+ case "toon":
180
+ writeToon(payload);
181
+ return;
182
+ case "md":
183
+ writeMarkdown(payload);
184
+ return;
185
+ }
186
+ }
79
187
  function writeCount(count, note) {
80
188
  console.error(`count: ${count}`);
81
189
  if (note) {
@@ -71,13 +71,14 @@ function runSearchCommand(options) {
71
71
  tagsMode: options.tagsMode,
72
72
  }).filter((node) => matchesQuery(node, terms));
73
73
  const sorted = (0, sort_1.sortNodesByQid)(nodeResults);
74
- if (options.json) {
75
- (0, query_output_1.writeJson)({
74
+ const format = options.format ?? (options.json ? "json" : undefined);
75
+ if (format) {
76
+ (0, query_output_1.writeStructuredOutput)({
76
77
  command: "search",
77
78
  kind: "node",
78
79
  count: sorted.length,
79
80
  items: sorted.map(query_output_1.toNodeSummaryJson),
80
- });
81
+ }, format);
81
82
  return;
82
83
  }
83
84
  (0, query_output_1.writeCount)(sorted.length, sorted.length === 0 ? `no nodes matched query "${query}"` : undefined);
@@ -58,12 +58,13 @@ function runShowCommand(options) {
58
58
  const content = fs_1.default.readFileSync(filePath, "utf8");
59
59
  body = (0, frontmatter_1.parseFrontmatter)(content, filePath).body.trimEnd();
60
60
  }
61
- if (options.json) {
62
- (0, query_output_1.writeJson)({
61
+ const format = options.format ?? (options.json ? "json" : undefined);
62
+ if (format) {
63
+ (0, query_output_1.writeStructuredOutput)({
63
64
  command: "show",
64
65
  kind: "node",
65
66
  item: (0, query_output_1.toNodeDetailJson)(node, options.metaOnly ? undefined : body),
66
- });
67
+ }, format);
67
68
  return;
68
69
  }
69
70
  const lines = [];
@@ -205,13 +205,14 @@ function runSkillListCommand(options) {
205
205
  console.error("warning: skills index is stale; run mdkg index to refresh");
206
206
  }
207
207
  const skills = filterSkills(Object.values(index.skills), options.tags, options.tagsMode ?? "any").sort((a, b) => a.qid.localeCompare(b.qid));
208
- if (options.json) {
209
- (0, query_output_1.writeJson)({
208
+ const format = options.format ?? (options.json ? "json" : undefined);
209
+ if (format) {
210
+ (0, query_output_1.writeStructuredOutput)({
210
211
  command: "list",
211
212
  kind: "skill",
212
213
  count: skills.length,
213
214
  items: skills.map(query_output_1.toSkillSummaryJson),
214
- });
215
+ }, format);
215
216
  return;
216
217
  }
217
218
  (0, query_output_1.writeCount)(skills.length, skills.length === 0 ? "no skills matched current filters" : undefined);
@@ -243,12 +244,13 @@ function runSkillShowCommand(options) {
243
244
  }
244
245
  body = fs_1.default.readFileSync(skillPath, "utf8").trimEnd();
245
246
  }
246
- if (options.json) {
247
- (0, query_output_1.writeJson)({
247
+ const format = options.format ?? (options.json ? "json" : undefined);
248
+ if (format) {
249
+ (0, query_output_1.writeStructuredOutput)({
248
250
  command: "show",
249
251
  kind: "skill",
250
252
  item: (0, query_output_1.toSkillDetailJson)(skill, options.metaOnly ? undefined : body),
251
- });
253
+ }, format);
252
254
  return;
253
255
  }
254
256
  if (options.metaOnly) {
@@ -307,13 +309,14 @@ function runSkillSearchCommand(options) {
307
309
  const skills = filterSkills(Object.values(index.skills), options.tags, options.tagsMode ?? "any")
308
310
  .filter((skill) => matchesSkillQuery(skill, terms))
309
311
  .sort((a, b) => a.qid.localeCompare(b.qid));
310
- if (options.json) {
311
- (0, query_output_1.writeJson)({
312
+ const format = options.format ?? (options.json ? "json" : undefined);
313
+ if (format) {
314
+ (0, query_output_1.writeStructuredOutput)({
312
315
  command: "search",
313
316
  kind: "skill",
314
317
  count: skills.length,
315
318
  items: skills.map(query_output_1.toSkillSummaryJson),
316
- });
319
+ }, format);
317
320
  return;
318
321
  }
319
322
  (0, query_output_1.writeCount)(skills.length, skills.length === 0 ? `no skills matched query "${query}"` : undefined);
@@ -45,3 +45,9 @@ Conventions:
45
45
  - Prefer checkpoints for feat/epic closeout summaries; parent status edits remain manual.
46
46
  - If `events.jsonl` is missing, `mdkg task start` and `mdkg task done` will remind you how to recreate it.
47
47
  - Files outside mdkg-managed skill mirrors, such as local tool permission files, are not managed by mdkg unless documented explicitly.
48
+
49
+ Structured discovery/show exports:
50
+ - `--json`
51
+ - `--xml`
52
+ - `--toon`
53
+ - `--md`
@@ -21,9 +21,16 @@ Agent bootstrap:
21
21
  - `mdkg init --llm`
22
22
  - `mdkg init --agent`
23
23
  - `mdkg init --llm --agent`
24
+ - published bootstrap config is root-only by default
24
25
 
25
26
  Skill discovery:
26
27
  - `mdkg skill list --tags stage:plan --json`
27
28
  - `mdkg skill search "<query>" --json`
28
29
  - `mdkg skill show <slug> --json`
29
30
  - `mdkg skill sync`
31
+
32
+ Discovery/show export flags:
33
+ - `--json`
34
+ - `--xml`
35
+ - `--toon`
36
+ - `--md`
@@ -52,16 +52,6 @@
52
52
  "path": ".",
53
53
  "enabled": true,
54
54
  "mdkg_dir": ".mdkg"
55
- },
56
- "polish": {
57
- "path": "polish",
58
- "enabled": true,
59
- "mdkg_dir": ".mdkg"
60
- },
61
- "smoke": {
62
- "path": "smoke",
63
- "enabled": true,
64
- "mdkg_dir": ".mdkg"
65
55
  }
66
56
  }
67
- }
57
+ }
@@ -88,7 +88,7 @@ If a user provides an unqualified ID and it is ambiguous globally:
88
88
  - Commands should be script-friendly:
89
89
  - concise outputs for single items
90
90
  - predictable formatting
91
- - `--json` output for supported discovery/show commands
91
+ - `--json`, `--xml`, `--toon`, and `--md` output for supported discovery/show commands
92
92
  - when printing node summaries (e.g., `show`/list results), outputs SHOULD surface key searchable frontmatter fields such as `links` and `artifacts`
93
93
 
94
94
  ## Command set (v1 target)
@@ -164,18 +164,19 @@ Common flags:
164
164
  - `--template <set>` (default from config)
165
165
 
166
166
  ### Read/search
167
- - `mdkg show <id-or-qid> [--meta] [--json]`
167
+ - `mdkg show <id-or-qid> [--meta] [--json|--xml|--toon|--md]`
168
168
  - default behavior shows the full node body
169
169
  - `--meta` is the compact card-only view
170
- - `mdkg search "<query>" [--type <type>] [--status <status>] [--ws <alias>] [--tags <tag,tag,...>] [--tags-mode any|all] [--json]`
170
+ - `mdkg search "<query>" [--type <type>] [--status <status>] [--ws <alias>] [--tags <tag,tag,...>] [--tags-mode any|all] [--json|--xml|--toon|--md]`
171
171
  - search SHOULD match on IDs, titles, tags, path tokens, and searchable frontmatter lists (`links`, `artifacts`, `refs`, `aliases`)
172
- - `mdkg list [--type <type>] [--status <status>] [--ws <alias>] [--epic <id>] [--blocked] [--priority <n>] [--tags <tag,tag,...>] [--tags-mode any|all] [--json]`
172
+ - `mdkg list [--type <type>] [--status <status>] [--ws <alias>] [--epic <id>] [--blocked] [--priority <n>] [--tags <tag,tag,...>] [--tags-mode any|all] [--json|--xml|--toon|--md]`
173
173
  - skills are first-class under `mdkg skill ...` only:
174
- - `mdkg skill list [--tags <tag,tag,...>] [--tags-mode any|all] [--json]`
175
- - `mdkg skill show <slug> [--meta] [--json]`
176
- - `mdkg skill search "<query>" [--tags <tag,tag,...>] [--tags-mode any|all] [--json]`
174
+ - `mdkg skill list [--tags <tag,tag,...>] [--tags-mode any|all] [--json|--xml|--toon|--md]`
175
+ - `mdkg skill show <slug> [--meta] [--json|--xml|--toon|--md]`
176
+ - `mdkg skill search "<query>" [--tags <tag,tag,...>] [--tags-mode any|all] [--json|--xml|--toon|--md]`
177
177
  - `mdkg skill validate [<slug>]`
178
178
  - `mdkg skill sync [--force]`
179
+ - discovery/show output flags are mutually exclusive; text mode remains the default when none are supplied
179
180
 
180
181
  ### Task lifecycle mutation
181
182
  - `mdkg task start <id-or-qid> [--ws <alias>] [--run-id <id>] [--note "<text>"]`
@@ -15,3 +15,5 @@ First commands:
15
15
  - `mdkg pack <id>`
16
16
  - `mdkg skill list --tags stage:plan --json`
17
17
  - `mdkg validate`
18
+
19
+ Discovery and show commands also support `--xml`, `--toon`, and `--md` when JSON is not the desired interchange format.
@@ -79,6 +79,9 @@ const BOOLEAN_FLAGS = new Set([
79
79
  "--version",
80
80
  "--dry-run",
81
81
  "--json",
82
+ "--xml",
83
+ "--toon",
84
+ "--md",
82
85
  "--list-profiles",
83
86
  "--with-scripts",
84
87
  "--clear-blocked-by",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mdkg",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "Markdown Knowledge Graph",
5
5
  "license": "MIT",
6
6
  "bin": {