@markdown-ai/cli 1.0.0-rc.3 → 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
@@ -2,13 +2,14 @@
2
2
 
3
3
  `@markdown-ai/cli` installs one command: `mda`.
4
4
 
5
- Use it to create, validate, compile, canonicalize, and integrity-check Markdown AI
6
- (MDA) artifacts before humans, AI agents, CI jobs, or publishing pipelines use
7
- them.
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.
8
9
 
9
- The CLI is most useful at design time and CI time. It helps you write one `.mda`
10
- source file, then produce the Markdown files that agent systems already know how
11
- to read: `SKILL.md`, `AGENTS.md`, and `MCP-SERVER.md`.
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`.
12
13
 
13
14
  ## Install
14
15
 
@@ -27,8 +28,8 @@ mda --help
27
28
 
28
29
  The installed binary is `mda`.
29
30
 
30
- Running `mda` with no arguments prints complete help. That is intentional. A
31
- human or an AI agent can discover the command surface quickly without guessing.
31
+ Running `mda` with no arguments prints help. It does not write files, validate
32
+ files, sign anything, verify anything, or touch the network.
32
33
 
33
34
  ## Quick Start
34
35
 
@@ -58,14 +59,49 @@ mda validate out/AGENTS.md --target AGENTS.md
58
59
  mda integrity verify out/SKILL.md --target SKILL.md
59
60
  ```
60
61
 
61
- That is the main flow. Start there.
62
+ That is the everyday flow. Create the source. Check it. Compile it. Check what
63
+ came out.
62
64
 
63
- ## For AI Agents
65
+ ## Release Quick Path For LLMix Registry
64
66
 
65
- Use `--json` almost every time.
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.
66
71
 
67
- Human output is for eyes. JSON output is for code. It gives agents stable fields
68
- such as `ok`, `command`, `exitCode`, and `diagnostics`.
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`
69
105
 
70
106
  Recommended agent flow:
71
107
 
@@ -82,25 +118,56 @@ Agent rules:
82
118
 
83
119
  - Treat exit code `0` and `ok: true` as success.
84
120
  - Treat any non-zero exit as a stop signal.
85
- - Read `diagnostics[0].code` before scraping human text.
86
- - Pass `--target` when the filename is not exact.
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.
87
124
  - Write generated files into a temp or staging directory first.
88
125
 
89
- This keeps the CLI useful as an external gate. Application runtime loaders should
90
- keep their own verifier hooks instead of shelling out to `mda`.
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.
91
150
 
92
151
  ## Common Commands
93
152
 
94
- | Command | Use it for |
95
- | --- | --- |
96
- | `mda` | Print full help. |
97
- | `mda init <name> --out <file.mda>` | Create a source scaffold. |
98
- | `mda validate <file> [--target <target>]` | Validate source or generated Markdown. |
99
- | `mda compile <file.mda> --target SKILL.md AGENTS.md --out-dir out --integrity` | Compile source into agent-readable artifacts. |
100
- | `mda canonicalize <file> --target <target>` | Produce deterministic canonical bytes. |
101
- | `mda integrity compute <file> --target <target>` | Compute a stable digest. |
102
- | `mda integrity verify <file> --target <target>` | Check the declared digest against current content. |
103
- | `mda conformance --level V --json` | Run the conformance suite. |
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. |
104
171
 
105
172
  Allowed targets:
106
173
 
@@ -120,9 +187,9 @@ Auto-detection is exact:
120
187
 
121
188
  ## Full Manual
122
189
 
123
- Read [HOW-TO-USE.md](./HOW-TO-USE.md) for the complete command manual, including
124
- all parameters, exit codes, MCP sidecar handling, integrity examples, and
125
- agent-oriented usage patterns.
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.
126
193
 
127
194
  For the broader project context, read the repository
128
195
  [README](https://github.com/sno-ai/mda#readme) and the
@@ -130,8 +197,10 @@ For the broader project context, read the repository
130
197
 
131
198
  ## Status
132
199
 
133
- This is the reference CLI for the Markdown AI / MDA artifact format.
200
+ This is the 1.1 reference CLI for the Markdown AI / MDA artifact format.
134
201
 
135
- The useful path today is clear: author `.mda`, validate it, compile it, validate
136
- the outputs, and run integrity checks before publishing or handing files to an
137
- agent.
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.