milieu-cli 0.4.0-rc.10 → 0.4.1

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,5 +1,10 @@
1
1
  # milieu-cli
2
2
 
3
+ [![Total npm downloads](https://img.shields.io/badge/dynamic/xml.svg?url=https%3A%2F%2Fnpminsights.vercel.app%2Fpackage%2Fmilieu-cli&query=%2F%2Fh3%5B.%3D%22All-time+downloads%22%5D%2Ffollowing-sibling%3A%3Ap%5B1%5D%2Ftext%28%29&label=total+npm+downloads&color=blue)](https://npminsights.vercel.app/package/milieu-cli)
4
+ [![Stable npm version](https://img.shields.io/npm/v/milieu-cli/latest?label=npm+stable)](https://www.npmjs.com/package/milieu-cli?activeTab=versions)
5
+ [![License](https://img.shields.io/github/license/simplyarun/milieu-cli)](LICENSE)
6
+ [![CI status on main](https://github.com/simplyarun/milieu-cli/actions/workflows/ci.yml/badge.svg?branch=main&event=push)](https://github.com/simplyarun/milieu-cli/actions/workflows/ci.yml?query=branch%3Amain+event%3Apush)
7
+
3
8
  The API is the new product UI. Your customers are no longer just humans. They're AI agents, LLM pipelines, and automated workflows. These customers don't browse your marketing site or read your docs the way people do. They parse your machine-readable signals, probe your endpoints, and decide in milliseconds whether your product is usable.
4
9
 
5
10
  As an industry, we've spent decades perfecting UI & UX design for humans. Now we need the same rigor for the interface AI agents actually see: your product's **milieu**.
@@ -12,13 +17,13 @@ Use Node.js 22.19.0 or newer. Replace the example URL with your own public site.
12
17
  npx milieu-cli scan https://your-site.example
13
18
  ```
14
19
 
15
- You'll get a scored report showing what agents can discover about your product. Add `--verbose` to see the individual checks. No API key is required.
20
+ You'll get a scored report showing what agents can discover about your product. Add `--verbose` to see the individual checks. No API key is required. To see what happens when an agent tries to use a product, try the [Journeys demo](#journeys).
16
21
 
17
22
  ## Table of contents
18
23
 
19
24
  - [Quick start](#quick-start)
20
- - [Journeys](#journeys)
21
25
  - [What is milieu?](#what-is-milieu)
26
+ - [Journeys](#journeys)
22
27
  - [The 5 Bridges](#the-5-bridges)
23
28
  - [Install](#install)
24
29
  - [CI/CD integration](#cicd-integration)
@@ -30,26 +35,36 @@ You'll get a scored report showing what agents can discover about your product.
30
35
  - [Requirements](#requirements)
31
36
  - [License](#license)
32
37
 
38
+ ## What is milieu?
39
+
40
+ *Milieu* is the totality of machine-readable signals that surround your product — the environment an AI agent encounters when it tries to discover, understand, and integrate with what you've built. It's not any single file or endpoint. It's robots.txt and OpenAPI specs and llms.txt and JSON-LD and developer docs and SDK references, all working together. It's the difference between a product that AI agents can use and one they walk past.
41
+
42
+ Good design made products usable for humans. Good milieu design makes products usable for agents.
43
+
44
+ milieu-cli measures this. It scans your product surface and tells you what AI agents can actually see.
45
+
33
46
  ## Journeys
34
47
 
35
48
  **Can an agent follow your quickstart and retrieve its first catalog item?** A Journey tests a task like this against your docs and API. You define what success looks like. Milieu records the pages and responses the agent used and shows which checks passed or failed.
36
49
 
37
- **Try the demo.** [Install the 0.4 candidate](#install), then run this command. It uses a scripted agent and sample responses entirely offline.
50
+ **Try the demo.** Run a scripted agent through a sample quickstart.
38
51
 
39
52
  ```sh
40
- npx --no-install milieu journey demo
53
+ npx milieu-cli journey demo
41
54
  ```
42
55
 
43
- Look for `catalog-quickstart / docs-missing`. The guide is missing the `GET /v1/items` instruction, so the documentation check fails. Milieu also calls the endpoint directly and reports `Direct API control: pass`. The API still works. Restoring the instruction fixes the quickstart.
56
+ `npx` fetches Milieu if needed. The demo then runs offline. Look for `catalog-quickstart / docs-missing`. The agent gets stuck because the guide omits `GET /v1/items`. The line `Direct API control: pass` tells you the endpoint works. Adding the missing instruction fixes the guide.
57
+
58
+ [Star Milieu on GitHub](https://github.com/simplyarun/milieu-cli) to save it for your next API review, or [share this demo](https://github.com/simplyarun/milieu-cli#journeys) with a teammate.
44
59
 
45
60
  **Try it on your own product**
46
61
 
47
- 1. Create a case with `npx --no-install milieu journey init catalog.json --kind api_read`.
62
+ 1. Create a case with `npx milieu-cli journey init catalog.json --kind api_read`.
48
63
  2. Edit `catalog.json`. Write the task in `prompt`. Point `targets.baseline` and `startPath` at your public test deployment and its starting page. Set the permitted paths in `scope` and the expected result in `expect`. Use synthetic data.
49
64
  3. With [Ollama set up](docs/journeys.md#run-with-a-model), replace `YOUR_MODEL` with an installed model name and run the case. Rerun it after a docs or API change to see whether the task still passes.
50
65
 
51
66
  ```sh
52
- npx --no-install milieu journey run catalog.json --target baseline --provider ollama --model YOUR_MODEL
67
+ npx milieu-cli journey run catalog.json --target baseline --provider ollama --model YOUR_MODEL
53
68
  ```
54
69
 
55
70
  | Journey command | Purpose and options |
@@ -66,14 +81,6 @@ Every Journey command accepts `--json`. For example, `milieu journey run --help
66
81
 
67
82
  The [Journey guide](docs/journeys.md) covers case authoring and includes three credential-onboarding examples. The [maintainer qualification guide](docs/journey-qualification.md) covers fixture deployment, model runs and release checks.
68
83
 
69
- ## What is milieu?
70
-
71
- *Milieu* is the totality of machine-readable signals that surround your product — the environment an AI agent encounters when it tries to discover, understand, and integrate with what you've built. It's not any single file or endpoint. It's robots.txt and OpenAPI specs and llms.txt and JSON-LD and developer docs and SDK references, all working together. It's the difference between a product that AI agents can use and one they walk past.
72
-
73
- Good design made products usable for humans. Good milieu design makes products usable for agents.
74
-
75
- milieu-cli measures this. It scans your product surface and tells you what AI agents can actually see.
76
-
77
84
  ## The 5 Bridges
78
85
 
79
86
  Milieu evaluates your product through five progressive bridges. Each one represents a layer of machine legibility that AI agents need, from "can I reach you?" to "can I trust you?"
@@ -133,44 +140,21 @@ GPTBot and ClaudeBot collect training material. CCBot collects material for Comm
133
140
 
134
141
  ## Install
135
142
 
136
- ```bash
137
- npx milieu-cli scan https://your-site.example # one-off
138
- npm install -g milieu-cli # global install
139
- milieu scan https://your-site.example # installed alias
140
- ```
141
-
142
- Both `milieu` and `milieu-cli` work after global install. The unversioned npm commands use the `latest` channel.
143
-
144
- **Install the 0.4 candidate from npm.** For `diff`, Journeys, and CI completeness checks, use the candidate. Once `npm view milieu-cli dist-tags` lists RC10 under `next`, pin it in your project.
145
-
146
- ```sh
147
- npm install --save-dev --save-exact milieu-cli@0.4.0-rc.10
148
- ```
149
-
150
- **Install RC10 from GitHub.** From an empty directory, build the package at the current head of PR #15, then install its tarball in a scratch project. `npm pack` runs the production build.
143
+ For a one-off run, use `npx milieu-cli` as in the quick start. To use the same version for baseline scans, comparisons and CI, pin it in your project.
151
144
 
152
145
  ```sh
153
- git clone https://github.com/simplyarun/milieu-cli.git milieu-cli-source
154
- cd milieu-cli-source
155
- git fetch origin refs/pull/15/head
156
- git switch --detach FETCH_HEAD
157
- npm ci --engine-strict
158
- npm pack --pack-destination ..
159
- cd ..
160
- npm init -y
161
- npm install --save-dev --engine-strict ./milieu-cli-0.4.0-rc.10.tgz
162
- npx --no-install milieu --version
146
+ npm install --save-dev --save-exact milieu-cli@0.4.1
163
147
  ```
164
148
 
165
- The version should print `0.4.0-rc.10`. If you already have the candidate checkout, `npm ci --engine-strict` and `npm run build` let you run `node dist/cli/index.js` in place of `npx --no-install milieu` directly from that checkout.
149
+ After installation, `npx milieu-cli` uses the project’s copy. Commit the package manifest and lockfile, then run `npm ci` in CI. For a global install, use `npm install -g milieu-cli`. Both `milieu` and `milieu-cli` work as commands after installation.
166
150
 
167
151
  ## CI/CD integration
168
152
 
169
- Use the 0.4 candidate to capture a report and enforce a minimum score. Set `ORIGIN` to your public site and choose a threshold for your product.
153
+ After installing Milieu in your project, set `ORIGIN` to your public site and choose a minimum score for your product.
170
154
 
171
155
  ```bash
172
156
  ORIGIN=https://your-site.example
173
- npx --no-install milieu scan "$ORIGIN" --json --threshold 70 --require-complete > milieu-report.json
157
+ ./node_modules/.bin/milieu scan "$ORIGIN" --json --threshold 70 --require-complete > milieu-report.json
174
158
  ```
175
159
 
176
160
  Add `--require-complete` to fail the job if a scan exhausts its request budget, skips a bridge, or returns a check with status `error`. A `partial` check alone does not trigger this flag. A scan exits with code 1 on an input or scan error, an unmet score threshold, or an unmet completeness requirement. A fatal reachability failure such as DNS or TLS failure also exits 1, as does a scan in which Reachability was not evaluated. JSON output retains the report for these outcomes and for unmet requirements. Individual link observations can have incomplete coverage even when this flag passes. For decisions about published routes, inspect the Separation findings and their coverage in the diff.
@@ -197,10 +181,10 @@ For a before-and-after check, run the first command before deploying your change
197
181
 
198
182
  ```sh
199
183
  ORIGIN=https://your-site.example
200
- npx --no-install milieu scan "$ORIGIN" --json > base.json
184
+ npx milieu-cli scan "$ORIGIN" --json > base.json
201
185
  # Deploy the change to the same origin before continuing.
202
- npx --no-install milieu scan "$ORIGIN" --json > candidate.json
203
- npx --no-install milieu diff base.json candidate.json --json > diff.json
186
+ npx milieu-cli scan "$ORIGIN" --json > candidate.json
187
+ npx milieu-cli diff base.json candidate.json --json > diff.json
204
188
  ```
205
189
 
206
190
  Findings are grouped by bridge. Where the scanner observed the same protected operation on both runs, Context compares individual authentication signals, including changes that leave the grade at `partial`. Separation reports changes in documentation links and successful fetches as inventory. Its URL evidence keeps the origin and case-sensitive path and omits user information, queries, and fragments. A linked URL may be on a different host and may never have been fetched.
@@ -140,8 +140,13 @@ export async function executeJourney(name, args, opts) {
140
140
  case "demo": {
141
141
  const demo = await runDemo();
142
142
  emit(demo, demo.runs.map(run => renderRun(run)).join("\n\n"), opts.json);
143
- if (!demo.ok)
143
+ if (!demo.ok) {
144
144
  process.exitCode = 2;
145
+ }
146
+ else if (!opts.json && process.stdin.isTTY && process.stdout.isTTY && process.stderr.isTTY &&
147
+ process.env.CI === undefined && process.env.GITHUB_ACTIONS === undefined) {
148
+ process.stderr.write("Star Milieu for your next API review at https://github.com/simplyarun/milieu-cli\n");
149
+ }
145
150
  break;
146
151
  }
147
152
  case "init": {
package/docs/journeys.md CHANGED
@@ -4,12 +4,12 @@ A saved Journey run links each assertion to the document or API response the act
4
4
 
5
5
  ## Inspect one attempt offline
6
6
 
7
- Run the demo with the installed candidate and save its output. The demo contains several runs. Extract the one whose API returned HTTP 200 without the expected array.
7
+ Install Milieu in your project with `npm install --save-dev --save-exact milieu-cli@0.4.1`, then save the demo output. The demo contains several runs. Extract the one whose API returned HTTP 200 without the expected array.
8
8
 
9
9
  ```sh
10
10
  node -e "const fs=require('node:fs'),cp=require('node:child_process');fs.writeFileSync('demo.json',cp.execFileSync(process.execPath,['node_modules/milieu-cli/dist/cli/index.js','journey','demo','--json']))"
11
11
  node -e "const fs=require('node:fs');const d=JSON.parse(fs.readFileSync('demo.json','utf8').replace(/^\uFEFF/,''));const r=d.runs.find(r=>r.caseKind==='api_read'&&r.target.name==='broken');fs.writeFileSync('broken.json',JSON.stringify(r))"
12
- npx --no-install milieu journey inspect broken.json --verbose
12
+ npx milieu-cli journey inspect broken.json --verbose
13
13
  ```
14
14
 
15
15
  The `items-array` assertion shows the expected array, the missing observed value and the API event that supplied that evidence. The direct control shows its own evidence. In the `docs-missing` run, `api.docs_excerpt` fails and the control passes. A model that exhausts its one correction records `INVALID_DECISION`; inspect its final error event for the recorded reason. An inconclusive outcome means the available observations could not settle the assertion.
@@ -80,4 +80,4 @@ Cairn Ledger is a fictional product. Its sample workspace, persistent account an
80
80
  | Persistent account claim | Workspace owner | [Case](examples/onboarding/account-claim.json) and [claim page](examples/onboarding/pages/account-claim.html) |
81
81
  | Production activation | Identity review | [Case](examples/onboarding/production-activation.json) and [production page](examples/onboarding/pages/production-activation.html) |
82
82
 
83
- Try `npx --no-install milieu journey validate node_modules/milieu-cli/docs/examples/onboarding/account-claim.json` after installation. In the scripted verification, an actor citing the complete claim page passes with “Workspace owner.” Removing the claim sentence makes the passage assertion fail. Citing the production page leaves the required claim-page citation missing. These cases measure what the documentation says. Credential issuance, time to onboard and account activation require separate observations.
83
+ Try `npx milieu-cli journey validate node_modules/milieu-cli/docs/examples/onboarding/account-claim.json` after installation. In the scripted verification, an actor citing the complete claim page passes with “Workspace owner.” Removing the claim sentence makes the passage assertion fail. Citing the production page leaves the required claim-page citation missing. These cases measure what the documentation says. Credential issuance, time to onboard and account activation require separate observations.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "milieu-cli",
3
- "version": "0.4.0-rc.10",
3
+ "version": "0.4.1",
4
4
  "description": "Check if AI agents can discover, understand, and use your product",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -83,8 +83,8 @@
83
83
  "vitest": "^4.1.12"
84
84
  },
85
85
  "dependencies": {
86
- "chalk": "^5.6.2",
87
- "commander": "^14.0.3",
86
+ "chalk": "^6.0.1",
87
+ "commander": "^15.1.0",
88
88
  "js-yaml": "5.5.0",
89
89
  "ora": "^9.3.0",
90
90
  "parse5": "8.1.1",