@grum-os/cli 0.3.38 → 0.3.40

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.
Files changed (4) hide show
  1. package/README.md +30 -19
  2. package/content.md5 +1 -1
  3. package/grum.mjs +261 -261
  4. package/package.json +2 -2
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  Keep a repository on the design contract your team reviewed in [Grum](https://app.grum.so).
6
6
 
7
- Grum reads the tokens the repository declares (CSS custom properties, a Tailwind v4 `@theme`, SCSS variables) and the button looks it defines. The team can add tokens in Grum before the code has them, and move others outside the contract. That reviewed set is what `grum` checks against. It compares your working tree to the contract, lists only drift that is new on this branch, and can send a new item to the project's owners for review, with a picture of how it renders.
7
+ Grum reads the tokens the repository declares (CSS custom properties, a Tailwind v4 `@theme`, SCSS variables), and the button and text input designs it defines. The team can add tokens in Grum before the code has them, and move others outside the contract. That reviewed set is what `grum` checks against. It compares your working tree to the contract, lists only drift that is new on this branch, and can send a new item to the project's owners for review, with a picture of how it renders.
8
8
 
9
9
  Requires Node.js 22 or newer.
10
10
 
@@ -50,13 +50,17 @@ npx --yes --prefer-online @grum-os/cli@latest setup --agent cursor --json
50
50
 
51
51
  Use `codex`, `claude` (Claude Code) or `generic` instead of `cursor` for those agents. The command prints JSON. Exit 0 means ready, exit 2 means the agent should take the next action and run it again, and exit 1 is a fault. `grum doctor --agent cursor --json` reports the same checks and changes nothing.
52
52
 
53
+ Rerunning setup refreshes existing integration files while preserving your own hooks and settings. The agent finishes verification with `grum_doctor` through MCP, which confirms the connection in that chat. If a shell check cannot verify the tools, it asks the agent to discover and call the tool before sending you to settings. Codex is ready when its MCP connection is confirmed and a hook has successfully run. Changed hook commands require review in Codex; new Grum releases using the same commands keep their existing trust.
54
+
55
+ Agent setup asks where your app runs locally. Repository URLs and `index.html` are suggestions; the agent must ask before selecting one. An older saved address is confirmed once. A local HTTP page must return 200; redirects, 404, access denial, connection refusal and timeouts keep setup incomplete. After a successful probe, the agent opens the page in its visible browser (Codex uses its browser panel), checks rendering, and reports any problems. Setup returns `preview-local-app` until the agent acknowledges the shown URL with `localPreviewed` in `grum_setup`, or `--local-previewed <url>` in the CLI. If browser control is unavailable, the agent asks you to open the URL and confirm it renders. A new address requires a new preview. An explicitly chosen static HTML file also needs preview; file existence does not prove rendering. Choose `none` only if you want to skip the local app.
56
+
53
57
  The menu and the commands above stay as they are. `--agent` is an extra way in, not a replacement.
54
58
 
55
59
  ## Cursor
56
60
 
57
61
  Accepting Cursor in the menu puts Grum inside the agent. The agent follows the same contract a person sees in Grum, and it can ask the owners to allow something the contract does not have.
58
62
 
59
- **Before it writes UI**, it reads the contract: color, typography, spacing, and radius tokens, plus button components, each look, and the prop that selects it.
63
+ **Before it writes UI**, it reads the contract: color, typography, spacing, and radius tokens, plus button components and looks, approved text inputs, and the rules for using them.
60
64
 
61
65
  **Before it finishes**, it checks what it changed. Drift already on the default branch stays off the list. New drift comes back with a fix.
62
66
 
@@ -75,7 +79,7 @@ These are the files setup writes. They merge into what is already there, and a s
75
79
 
76
80
  | File | What it does |
77
81
  | ------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
78
- | `.cursor/mcp.json` | Tools the agent calls: `grum_contract`, `grum_check`, `grum_request_review`, `grum_review_status`. |
82
+ | `.cursor/mcp.json` | Tools the agent calls: `grum_contract`, `grum_check`, `grum_request_review`, `grum_add_to_contract`, `grum_snooze_review`, `grum_review_status`, `grum_setup`, and `grum_doctor`. |
79
83
  | `.cursor/rules/grum.mdc` | Tells the agent to read the contract before writing UI and to check before it stops. The contract itself stays in Grum, so this file does not go stale. |
80
84
  | `.cursor/hooks.json` | After an edit, checks that block. The stop hook sends the agent back on blocking drift. The shell hook can refuse `git commit` and `git push`. |
81
85
  | pre-commit | Optional. When you say yes, adds `grum check --staged`. Husky's hook is committed with the repo. Git's own pre-commit hook stays on this computer. A lefthook repo gets the snippet to paste. |
@@ -97,7 +101,7 @@ Without step 2 the tools still work and the agent still follows the guidance, bu
97
101
 
98
102
  | File | What it does |
99
103
  | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
100
- | `.codex/config.toml` | Adds the same four tools. Only Grum's own block is written; the rest of the file is left as it is, and a file that is not valid TOML stops setup. |
104
+ | `.codex/config.toml` | Adds the same eight tools. Only Grum's own block is written; the rest of the file is left as it is, and a file that is not valid TOML stops setup. |
101
105
  | `.codex/hooks.json` | Three hooks beside any of yours: after an edit, before a shell command, and at stop. They behave as Cursor's do, including [blocking](#fail-the-check). |
102
106
  | `AGENTS.md` | A marked block that tells the agent to read the contract, check before it stops, and ask before keeping an off-contract style. |
103
107
 
@@ -111,7 +115,7 @@ Claude Code runs a project's tools and hooks only in a folder you trust, so one
111
115
 
112
116
  | File | What it does |
113
117
  | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
114
- | `.mcp.json` | Adds the same four tools. Other servers in the file are left as they are. |
118
+ | `.mcp.json` | Adds the same eight tools. Other servers in the file are left as they are. |
115
119
  | `.claude/settings.json` | Three hooks beside any of yours: after an edit, before a shell command, and at stop. They behave as Cursor's do, including [blocking](#fail-the-check). Also approves the **grum** server. |
116
120
  | `CLAUDE.md` | A marked block that tells the agent to read the contract, check before it stops, and ask before keeping an off-contract style. |
117
121
 
@@ -152,6 +156,7 @@ A check prints the report and exits 0, including when you are signed out, offlin
152
156
  | Spacing | A margin, padding, or gap off the scale |
153
157
  | Radius | A radius off the scale |
154
158
  | Buttons | A look the contract does not have, a look whose state changed, a missing state, a raw `<button>` outside the button component, or a variant the component lacks |
159
+ | Inputs | A text input that does not match an approved input, or differs from one in structure, appearance, or states |
155
160
 
156
161
  ## Review one item yourself
157
162
 
@@ -179,7 +184,7 @@ Clears the capture-browser sign-in saved for this repository.
179
184
  grum contract
180
185
  ```
181
186
 
182
- Prints the packet the Cursor agent reads before writing styles: tokens by category (with a separate dark value when there is one), button components, each look and the prop that selects it, and the repository's written rules about those buttons.
187
+ Prints the contract packet agents read before writing UI: tokens by category (with a separate dark value when there is one), button components and looks, approved text inputs, team guidelines, and review decisions.
183
188
 
184
189
  ## Fail the check
185
190
 
@@ -237,19 +242,23 @@ Store it as a secret. Do not commit it. The token acts as you, in every workspac
237
242
 
238
243
  The menu covers check, setup, and sign-in. These are the same actions as flags, for scripts and CI.
239
244
 
240
- | Command | What it does |
241
- | ----------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
242
- | `grum` | The menu. Check, setup (including Cursor), or sign in. |
243
- | `grum login` / `grum logout` | Sign this computer in to Grum, or out. |
244
- | `grum setup [--root <dir>]` | Sign in, link this repository, and ask about Cursor and the pre-commit check. |
245
- | `grum check [flags]` | Check the working tree. See the flags below. |
246
- | `grum request <key> [<key>...] [--reason "..."] [--url <page>] [--live] [--browser chrome | safari] [--no-capture]` | Ask the owners to allow drift items; items on one page capture together. |
247
- | `grum uninstall [--yes]` | Remove Grum from this repository and this computer. See [Uninstall](#uninstall). |
248
- | `grum capture reset` | Clear this repository's saved capture-browser sign-ins. |
249
- | `grum contract` | Print the contract packet. |
250
- | `grum init cursor [--remove] [--force] [--local-only] [--pre-commit]` | Write or remove the Cursor files without the menu. `--pre-commit` adds the commit check. `--no-pre-commit` removes it. |
251
- | `grum init codex [--remove] [--force] [--local-only] [--pre-commit]` | The same for Codex: `.codex/config.toml`, `.codex/hooks.json` and the `AGENTS.md` block. |
252
- | `grum init claude [--remove] [--force] [--local-only] [--pre-commit]` | The same for Claude Code: `.mcp.json`, `.claude/settings.json` and the `CLAUDE.md` block. |
245
+ | Command | What it does |
246
+ | ----------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
247
+ | `grum` | The menu. Check, setup (including Cursor), or sign in. |
248
+ | `grum login` / `grum logout` | Sign this computer in to Grum, or out. |
249
+ | `grum setup [--root <dir>]` | Sign in, link this repository, and ask about Cursor and the pre-commit check. Use `--agent <agent> --json` for agent setup. |
250
+ | `grum doctor [--agent <agent> --json]` | Check setup readiness without changing anything. |
251
+ | `grum scan [--root <dir>]` | Start a fresh scan for the linked workspace and follow its progress. |
252
+ | `grum check [flags]` | Check the working tree. See the flags below. |
253
+ | `grum request <key> [<key>...] [--reason "..."] [--url <page>] [--live] [--browser chrome | safari] [--no-capture]` | Ask the owners to allow drift items; items on one page capture together. |
254
+ | `grum add-token ...` / `grum add-button ...` | For owners, add a token or approved button design to the contract. |
255
+ | `grum snooze <key> [<key>...]` | Pause questions about existing drift on this branch for the configured period. |
256
+ | `grum uninstall [--yes]` | Remove Grum from this repository and this computer. See [Uninstall](#uninstall). |
257
+ | `grum capture reset` | Clear this repository's saved capture-browser sign-ins. |
258
+ | `grum contract` | Print the contract packet. |
259
+ | `grum init cursor [--remove] [--force] [--local-only] [--pre-commit]` | Write or remove the Cursor files without the menu. `--pre-commit` adds the commit check. `--no-pre-commit` removes it. |
260
+ | `grum init codex [--remove] [--force] [--local-only] [--pre-commit]` | The same for Codex: `.codex/config.toml`, `.codex/hooks.json` and the `AGENTS.md` block. |
261
+ | `grum init claude [--remove] [--force] [--local-only] [--pre-commit]` | The same for Claude Code: `.mcp.json`, `.claude/settings.json` and the `CLAUDE.md` block. |
253
262
 
254
263
  ```sh
255
264
  grum check --staged # drift in the blocks staged for commit
@@ -268,6 +277,8 @@ grum check --strict # like --ci, and also fail while a review is
268
277
 
269
278
  `grum hook` and `grum mcp` are the entry points Cursor, Codex and Claude Code run. You do not call them yourself.
270
279
 
280
+ For `setup` and `doctor`, `<agent>` is `cursor`, `codex`, `claude` or `generic`.
281
+
271
282
  ## Uninstall
272
283
 
273
284
  ```sh
package/content.md5 CHANGED
@@ -1 +1 @@
1
- 3106fdfb601b20e9df95c8e127d60964
1
+ 62a2e64d1373e651dc499fce541a5d89