@markdown-ai/cli 1.0.0-rc.2 → 1.1.0

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
@@ -1,18 +1,206 @@
1
1
  # @markdown-ai/cli
2
2
 
3
- Reference CLI for Markdown AI / MDA artifacts.
3
+ `@markdown-ai/cli` installs one command: `mda`.
4
+
5
+ It helps you create, validate, compile, sign, verify, and release Markdown AI
6
+ (MDA) artifacts. The main job is simple: keep the source clean, keep the output
7
+ predictable, and give humans or AI agents a clear next step when something is
8
+ wrong.
9
+
10
+ Most users start with one `.mda` source file. From that file, the CLI can emit
11
+ the Markdown files agent systems already understand: `SKILL.md`, `AGENTS.md`,
12
+ and `MCP-SERVER.md`.
13
+
14
+ ## Install
15
+
16
+ Run without installing:
4
17
 
5
18
  ```sh
6
19
  npx @markdown-ai/cli --help
7
20
  ```
8
21
 
22
+ Install globally:
23
+
24
+ ```sh
25
+ npm install -g @markdown-ai/cli
26
+ mda --help
27
+ ```
28
+
9
29
  The installed binary is `mda`.
10
30
 
31
+ Running `mda` with no arguments prints help. It does not write files, validate
32
+ files, sign anything, verify anything, or touch the network.
33
+
34
+ ## Quick Start
35
+
36
+ Create a source file:
37
+
11
38
  ```sh
12
39
  mda init hello-skill --out hello.mda
13
- mda validate hello.mda --json
14
- mda compile hello.mda --target SKILL.md AGENTS.md MCP-SERVER.md --out-dir out --integrity
15
- mda conformance --level V --json
16
40
  ```
17
41
 
18
- See [HOW-TO-USE.md](./HOW-TO-USE.md) for the command manual.
42
+ Validate it:
43
+
44
+ ```sh
45
+ mda validate hello.mda
46
+ ```
47
+
48
+ Compile it into agent-readable Markdown:
49
+
50
+ ```sh
51
+ mda compile hello.mda --target SKILL.md AGENTS.md --out-dir out --integrity
52
+ ```
53
+
54
+ Validate the output:
55
+
56
+ ```sh
57
+ mda validate out/SKILL.md --target SKILL.md
58
+ mda validate out/AGENTS.md --target AGENTS.md
59
+ mda integrity verify out/SKILL.md --target SKILL.md
60
+ ```
61
+
62
+ That is the everyday flow. Create the source. Check it. Compile it. Check what
63
+ came out.
64
+
65
+ ## Release Quick Path For LLMix Registry
66
+
67
+ For LLMix releases, most teams should start with the GitHub Actions profile. It
68
+ matches the CI identity shape people already expect from package provenance:
69
+ GitHub Actions OIDC identity, explicit Sigstore/Rekor evidence, and a local
70
+ policy pinned to repository, workflow, and ref.
71
+
72
+ ```sh
73
+ mda init --template llmix-preset --module search_summary --preset openai_fast --provider openai --model gpt-5-mini --out authoring/search_summary/openai_fast.mda
74
+ mda validate authoring/search_summary/openai_fast.mda --target source
75
+ mda integrity compute authoring/search_summary/openai_fast.mda --target source --write
76
+ mda release trust policy --target llmix-registry --profile github-actions --repo owner/repo --workflow release.yml --ref refs/heads/main --out gha-policy.json
77
+ mda sign authoring/search_summary/openai_fast.mda --profile github-actions --repo owner/repo --workflow release.yml --ref refs/heads/main --rekor --offline-sigstore-fixture sigstore-evidence.json --out authoring/search_summary/openai_fast.signed.mda
78
+ mda verify authoring/search_summary/openai_fast.signed.mda --policy gha-policy.json --offline-sigstore-fixture sigstore-evidence.json --json
79
+ mda release prepare --target llmix-registry --source authoring --registry-dir registry --policy gha-policy.json --offline-sigstore-fixture sigstore-evidence.json --out release-plan.json
80
+ # Run the LLMix publisher with trustedRuntime: true. mda does not publish registry files.
81
+ mda release finalize --target llmix-registry --registry-dir registry --registry-root registry/snapshots/current/registry-root.json --release-plan release-plan.json --policy gha-policy.json --derive-root-digest --out release/llmix-trust.json --offline-sigstore-fixture sigstore-evidence.json
82
+ mda release finalize --target llmix-registry --registry-dir registry --manifest release/llmix-trust.json --snippet-format json --snippet-out release/llmix-trust-snippet.json
83
+ mda doctor release --target llmix-registry --source authoring --registry-dir registry --release-plan release-plan.json --manifest release/llmix-trust.json --offline-sigstore-fixture sigstore-evidence.json
84
+ ```
85
+
86
+ The `--offline-sigstore-fixture` option is the CLI 1.1 deterministic evidence
87
+ input for local and CI gates. Production release automation can keep using
88
+ GitHub Actions keyless signing and Sigstore/Rekor evidence; this CLI gate makes
89
+ that evidence explicit and repeatable.
90
+
91
+ ## AI Agent Usage
92
+
93
+ Use `--json` when another program is driving the CLI.
94
+
95
+ Human output is meant to be read. JSON output is meant to be used. It gives
96
+ stable fields:
97
+
98
+ - `ok`
99
+ - `command`
100
+ - `exitCode`
101
+ - `summary`
102
+ - `artifacts`
103
+ - `diagnostics`
104
+ - `nextActions`
105
+
106
+ Recommended agent flow:
107
+
108
+ ```sh
109
+ mda validate task.mda --target source --json
110
+ mda compile task.mda --target SKILL.md AGENTS.md MCP-SERVER.md --out-dir out --integrity --json
111
+ mda validate out/SKILL.md --target SKILL.md --json
112
+ mda validate out/AGENTS.md --target AGENTS.md --json
113
+ mda validate out/MCP-SERVER.md --target MCP-SERVER.md --json
114
+ mda integrity verify out/SKILL.md --target SKILL.md --json
115
+ ```
116
+
117
+ Agent rules:
118
+
119
+ - Treat exit code `0` and `ok: true` as success.
120
+ - Treat any non-zero exit as a stop signal.
121
+ - Read `diagnostics[0].code` before parsing messages.
122
+ - Use `artifacts` and `nextActions` to decide the next command.
123
+ - Pass `--target` when a Markdown filename is not exact.
124
+ - Write generated files into a temp or staging directory first.
125
+
126
+ The CLI is a good external gate. Application runtime loaders should still keep
127
+ their own verifier hooks instead of shelling out to `mda`.
128
+
129
+ ## Secure Release Flow
130
+
131
+ For signed MDA and LLMix releases, the default path is GitHub Actions OIDC plus
132
+ Sigstore/Rekor evidence:
133
+
134
+ ```sh
135
+ mda release trust policy --target llmix-registry --profile github-actions --repo owner/repo --workflow release.yml --ref refs/heads/main --out gha-policy.json
136
+ mda sign release.mda --profile github-actions --repo owner/repo --workflow release.yml --ref refs/heads/main --rekor --offline-sigstore-fixture sigstore-evidence.json --out release.signed.mda
137
+ mda verify release.signed.mda --policy gha-policy.json --offline-sigstore-fixture sigstore-evidence.json --json
138
+ mda release prepare --target llmix-registry --source authoring --registry-dir registry --policy gha-policy.json --offline-sigstore-fixture sigstore-evidence.json --out release-plan.json
139
+ mda release finalize --target llmix-registry --registry-dir registry --registry-root registry/snapshots/current/registry-root.json --release-plan release-plan.json --policy gha-policy.json --derive-root-digest --out release/llmix-trust.json --offline-sigstore-fixture sigstore-evidence.json
140
+ mda release finalize --target llmix-registry --registry-dir registry --manifest release/llmix-trust.json --snippet-format json --snippet-out release/llmix-trust-snippet.json
141
+ mda doctor release --target llmix-registry --source authoring --registry-dir registry --release-plan release-plan.json --manifest release/llmix-trust.json --offline-sigstore-fixture sigstore-evidence.json
142
+ ```
143
+
144
+ Use did:web as an advanced or alternate signing profile when your team manages
145
+ release keys and DID documents directly.
146
+
147
+ Keep private keys and deployment trust manifests outside the registry directory.
148
+ Trust authority should live outside `config/llm/`. The CLI checks that because
149
+ it is the kind of mistake that looks fine until it matters.
150
+
151
+ ## Common Commands
152
+
153
+ | Command | Use it for |
154
+ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ |
155
+ | `mda` | Print help. |
156
+ | `mda init <name> --out <file.mda>` | Create a source scaffold. |
157
+ | `mda init --template llmix-preset ...` | Create an LLMix preset source scaffold. |
158
+ | `mda validate <file> [--target <target>]` | Validate source or generated Markdown. |
159
+ | `mda compile <file.mda> --target SKILL.md AGENTS.md --out-dir out --integrity` | Compile source into agent-readable artifacts. |
160
+ | `mda canonicalize <file> --target <target>` | Produce deterministic canonical bytes. |
161
+ | `mda integrity compute <file> --target <target>` | Compute a stable digest. |
162
+ | `mda integrity verify <file> --target <target>` | Check the declared digest against current content. |
163
+ | `mda sign <file> --profile did-web ...` | Sign an artifact with explicit did:web key material. |
164
+ | `mda sign <file> --profile github-actions ...` | Sign with explicit GitHub Actions Sigstore/Rekor evidence. |
165
+ | `mda verify <file> --policy <policy.json>` | Verify signatures against a local trust policy and explicit evidence. |
166
+ | `mda release prepare --target llmix-registry ...` | Verify signed LLMix presets and write a deterministic release plan. |
167
+ | `mda release finalize --target llmix-registry ...` | Verify signed registry-root evidence, write an external trust manifest, or snippets. |
168
+ | `mda doctor release --target llmix-registry ...` | Check release state before deployment. |
169
+ | `mda conformance --level V --json` | Run validation conformance. |
170
+ | `mda conformance --level C --json` | Run compile/equality conformance. |
171
+
172
+ Allowed targets:
173
+
174
+ - `source`
175
+ - `SKILL.md`
176
+ - `AGENTS.md`
177
+ - `MCP-SERVER.md`
178
+ - `auto`
179
+
180
+ Auto-detection is exact:
181
+
182
+ - `*.mda` means `source`
183
+ - `SKILL.md` means `SKILL.md`
184
+ - `AGENTS.md` means `AGENTS.md`
185
+ - `MCP-SERVER.md` means `MCP-SERVER.md`
186
+ - any other Markdown filename should pass `--target`
187
+
188
+ ## Full Manual
189
+
190
+ Read [HOW-TO-USE.md](./HOW-TO-USE.md) for the complete manual. It covers the
191
+ human flow, AI agent JSON flow, signing, verification, LLMix secure release,
192
+ MCP sidecars, integrity commands, global flags, exit codes, and conformance.
193
+
194
+ For the broader project context, read the repository
195
+ [README](https://github.com/sno-ai/mda#readme) and the
196
+ [MDA Open Spec](https://github.com/sno-ai/mda/blob/main/SPEC.md).
197
+
198
+ ## Status
199
+
200
+ This is the 1.1 reference CLI for the Markdown AI / MDA artifact format.
201
+
202
+ The useful path is covered: author `.mda`, validate it, compile it, validate the
203
+ outputs, run integrity checks, sign and verify release artifacts with explicit
204
+ GitHub Actions Sigstore/Rekor evidence or did:web key material, and use the
205
+ LLMix release/manifest/snippet/doctor commands before publishing or handing
206
+ files to an agent.