|
| 1 | +# @salt-ds/cli |
| 2 | + |
| 3 | +Salt Design System workflow CLI package. |
| 4 | + |
| 5 | +Use this package as the published fallback/support transport behind `salt-ds` when MCP is blocked or when you need direct manual support/debug access. |
| 6 | + |
| 7 | +Install options: |
| 8 | + |
| 9 | +```sh |
| 10 | +npx -y @salt-ds/cli@latest info . --json |
| 11 | +npm install -g @salt-ds/cli |
| 12 | +``` |
| 13 | + |
| 14 | +After global install, use the `salt-ds` binary directly. |
| 15 | + |
| 16 | +Primary workflow commands: |
| 17 | + |
| 18 | +- `salt-ds init [rootDir]` |
| 19 | + - supports `--json` |
| 20 | + - supports `--output <path>` |
| 21 | + - supports `--registry-dir <path>` |
| 22 | + - supports `--project <name>` |
| 23 | + - supports `--conventions-pack [<package[#export]>]` |
| 24 | + - bootstraps `.salt/team.json` plus repo-local instructions for a new or newly-adopting repo without changing the workflow model |
| 25 | + - can optionally scaffold a starter `.salt/stack.json` for repos using a shared conventions pack |
| 26 | +- `salt-ds info [rootDir]` |
| 27 | + - supports `--json` |
| 28 | + - supports `--output <path>` |
| 29 | + - supports `--registry-dir <path>` |
| 30 | + - reports detected repo context, declared Salt policy, runtime signals, and workflow capabilities |
| 31 | +- `salt-ds create <query>` |
| 32 | + - supports `--json` |
| 33 | + - supports `--output <path>` |
| 34 | + - supports `--registry-dir <path>` |
| 35 | + - supports `--include-starter-code` |
| 36 | + - creates Salt-first UI recommendations for new or existing repos without colliding with normal project build commands |
| 37 | +- `salt-ds review [target ...]` |
| 38 | + - supports `--url <url>` |
| 39 | + - supports `--migration-report <path>` |
| 40 | + - supports `--json` |
| 41 | + - supports `--output <path>` |
| 42 | + - supports `--registry-dir <path>` |
| 43 | + - supports `--timeout <ms>` |
| 44 | + - supports `--mode <auto|browser|fetched-html>` |
| 45 | + - supports `--output-dir <path>` |
| 46 | + - supports `--no-screenshot` |
| 47 | + - runs source-first Salt review for existing Salt code and can attach runtime evidence in the same pass when `--url` is provided |
| 48 | + - returns structured `confidence`, `raiseConfidence`, and `fixCandidates` in JSON output so the agent can judge whether to edit, inspect further, or ask follow-up questions without the CLI mutating files directly |
| 49 | + - can load a saved migration report to verify preserved landmarks, action hierarchy, and other migration-contract checks during `review --url` |
| 50 | +- `salt-ds migrate <query>` |
| 51 | + - supports `--url <url>` |
| 52 | + - supports `--json` |
| 53 | + - supports `--output <path>` |
| 54 | + - supports `--registry-dir <path>` |
| 55 | + - supports `--include-starter-code` |
| 56 | + - supports `--timeout <ms>` |
| 57 | + - supports `--mode <auto|browser|fetched-html>` |
| 58 | + - supports `--output-dir <path>` |
| 59 | + - supports `--no-screenshot` |
| 60 | + - translates non-Salt UI intent into Salt-first targets and implementation guidance |
| 61 | + - returns a familiarity contract, migration scope, post-migration verification guidance, delta categories, confidence signals, and optional runtime-scoping evidence so the agent can preserve important experience anchors without cloning the old visual system |
| 62 | +- `salt-ds upgrade` |
| 63 | + - supports `--package <name>` |
| 64 | + - supports `--component <name>` |
| 65 | + - supports `--from-version <version>` |
| 66 | + - supports `--to-version <version>` |
| 67 | + - supports `--include-deprecations` |
| 68 | + - supports `--json` |
| 69 | + - supports `--output <path>` |
| 70 | + - supports `--registry-dir <path>` |
| 71 | + - compares Salt versions and turns the result into upgrade-oriented workflow output |
| 72 | + |
| 73 | +Support commands: |
| 74 | + |
| 75 | +- `salt-ds doctor [rootDir]` |
| 76 | + - supports `--json` |
| 77 | + - supports `--output <path>` |
| 78 | + - supports `--bundle` and `--bundle-dir <path>` |
| 79 | + - supports `--storybook-url <url>` and `--app-url <url>` |
| 80 | + - supports `--check-detected-targets` |
| 81 | + - supports `--timeout <ms>` |
| 82 | + - can probe runtime target reachability for explicit or detected local targets |
| 83 | + - validates layered Salt policy sources from `.salt/stack.json`, including package-backed shared conventions packs |
| 84 | + - can write a support bundle containing the doctor report plus manifest, Salt config, and policy-layer summaries |
| 85 | +- `salt-ds runtime inspect <url>` |
| 86 | + - supports `--json` |
| 87 | + - supports `--output <path>` |
| 88 | + - supports `--output-dir <path>` |
| 89 | + - supports `--timeout <ms>` |
| 90 | + - supports `--mode <auto|browser|fetched-html>` |
| 91 | + - supports `--no-screenshot` |
| 92 | + - tries browser-session inspection by default, including screenshots, console and page errors, computed layout evidence, bounding boxes, and flex/grid ancestry when a browser runtime is available |
| 93 | + - falls back to `fetched-html` mode when browser-session inspection is unavailable, so consumers can still get structure, landmark, and accessible-name evidence even though computed layout evidence is unavailable |
| 94 | + |
| 95 | +Canonical Salt grounding now happens inside the public workflow commands and MCP tools. There is no second manual semantic CLI surface. |
| 96 | + |
| 97 | +The intended model is: |
| 98 | + |
| 99 | +- `salt-ds + MCP` when MCP is available |
| 100 | +- `salt-ds + CLI` when MCP is blocked |
| 101 | +- manual CLI use stays workflow-first |
| 102 | +- `review --url`, `doctor`, and `runtime inspect` are support and evidence tools, not the main consumer story |
| 103 | + |
| 104 | +Example workflow-oriented usage: |
| 105 | + |
| 106 | +```sh |
| 107 | +salt-ds init . --json |
| 108 | +salt-ds init . --conventions-pack @acme/salt-conventions#markets --json |
| 109 | +salt-ds info . --json |
| 110 | +salt-ds create "Link to another page from a toolbar action" --json |
| 111 | +salt-ds review src --json |
| 112 | +salt-ds review src --url http://127.0.0.1:3000/ --migration-report migration-plan.json --json |
| 113 | +salt-ds review src --url http://127.0.0.1:6006/?path=/story/example --json |
| 114 | +salt-ds migrate "Translate this external UI toolbar into Salt" --json |
| 115 | +salt-ds migrate "Translate this external UI toolbar into Salt" --url http://127.0.0.1:6006/legacy-toolbar --json --mode fetched-html |
| 116 | +salt-ds upgrade --package @salt-ds/core --from-version 1.1.0 --json |
| 117 | +``` |
| 118 | + |
| 119 | +Support-only examples: |
| 120 | + |
| 121 | +```sh |
| 122 | +salt-ds doctor . --check-detected-targets --bundle |
| 123 | +salt-ds runtime inspect http://127.0.0.1:6006/?path=/story/example --json --output .salt-support/runtime-report.json |
| 124 | +``` |
| 125 | + |
| 126 | +Interpreting runtime evidence: |
| 127 | + |
| 128 | +- `browser-session` |
| 129 | + - stronger local evidence for screenshots, runtime/page errors, hydrated titles, landmarks, roles, rendered structure, and computed layout evidence such as boxes, centering clues, and flex/grid ancestry |
| 130 | +- `fetched-html` |
| 131 | + - narrower fallback evidence for status, title, landmarks, roles, and coarse structure when browser-session inspection is unavailable |
| 132 | + - does not include computed layout evidence |
| 133 | +- neither mode should be treated as canonical Salt policy; they are evidence inputs for create, review, migration, and support workflows |
0 commit comments