@grum-os/cli 0.3.12 → 0.3.14

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 +53 -8
  2. package/content.md5 +1 -1
  3. package/grum.mjs +253 -226
  4. package/package.json +2 -2
package/README.md CHANGED
@@ -34,6 +34,20 @@ Then choose **check**. New drift is listed with a one-line fix, and Grum offers
34
34
 
35
35
  Once you are signed in, the third row is **logout**. Run `grum` again and choose **setup** to change the link or turn Cursor off. Enter keeps each current setting.
36
36
 
37
+ ## Set up with your agent
38
+
39
+ A coding agent can do this setup. You paste one prompt into the chat and approve a code in the browser. You do not need to open a terminal.
40
+
41
+ The page you open is [app.grum.so/agent/human](https://app.grum.so/agent/human). The prompt there points the agent at [app.grum.so/agent](https://app.grum.so/agent), which is the instructions in markdown. The agent runs:
42
+
43
+ ```sh
44
+ npx --yes @grum-os/cli setup --agent cursor --json
45
+ ```
46
+
47
+ 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.
48
+
49
+ The menu and the commands above stay as they are. `--agent` is an extra way in, not a replacement.
50
+
37
51
  ## Cursor
38
52
 
39
53
  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.
@@ -83,7 +97,21 @@ Without step 2 the tools still work and the agent still follows the guidance, bu
83
97
  | `.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). |
84
98
  | `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. |
85
99
 
86
- `grum init codex --remove` takes out exactly these. A repository set up for both Cursor and Codex keeps the `.gitignore` line and the pre-commit check until both are removed.
100
+ `grum init codex --remove` takes out exactly these. A repository set up for more than one agent keeps the `.gitignore` line and the pre-commit check until the last one is removed.
101
+
102
+ ## Claude Code
103
+
104
+ `grum init claude` (or `grum setup`, when the repository has a `.claude` folder) puts the same contract inside Claude Code: the CLI, the desktop app and the IDE extensions, on this computer. The agent reads the contract before it writes UI, checks before it finishes, and asks you once when nothing in the contract fits, exactly as Cursor's does.
105
+
106
+ Claude Code runs a project's tools and hooks only in a folder you trust, so one step is yours: start a new Claude Code session in the repository and trust the folder when it asks. If it asks about the **grum** MCP server, approve it. A session that was already open keeps its old hooks and tools until you start a new one.
107
+
108
+ | File | What it does |
109
+ | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
110
+ | `.mcp.json` | Adds the same four tools. Other servers in the file are left as they are. |
111
+ | `.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. |
112
+ | `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. |
113
+
114
+ `grum init claude --remove` takes out exactly these; the rest of each file stays.
87
115
 
88
116
  ## What a check shows
89
117
 
@@ -168,12 +196,12 @@ The same rule can live in `.grum/config.json`:
168
196
  }
169
197
  ```
170
198
 
171
- | Field | Meaning |
172
- | -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
173
- | `root` | Directory to scan when the app is not at the repository root. `grum check --root` does the same for one run. |
174
- | `block` | `true` makes `grum check` fail on open or rejected drift, and makes Cursor and Codex refuse the git commands below while that drift is in what they would send. |
175
- | `denyGit` | `commit`, `push`, or both. With `block` and no `denyGit`, both are refused. |
176
- | `maxFollowups` | How many times the Cursor or Codex stop hook sends the agent back in one conversation. Default is 2. |
199
+ | Field | Meaning |
200
+ | -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
201
+ | `root` | Directory to scan when the app is not at the repository root. `grum check --root` does the same for one run. |
202
+ | `block` | `true` makes `grum check` fail on open or rejected drift, and makes Cursor, Codex and Claude Code refuse the git commands below while that drift is in what they would send. |
203
+ | `denyGit` | `commit`, `push`, or both. With `block` and no `denyGit`, both are refused. |
204
+ | `maxFollowups` | How many times the Cursor, Codex or Claude Code stop hook sends the agent back in one conversation. Default is 2. |
177
205
 
178
206
  `block` does not fail a check that is still waiting on review. Use `--strict` for that.
179
207
 
@@ -210,10 +238,12 @@ The menu covers check, setup, and sign-in. These are the same actions as flags,
210
238
  | `grum setup [--root <dir>]` | Sign in, link this repository, and ask about Cursor and the pre-commit check. |
211
239
  | `grum check [flags]` | Check the working tree. See the flags below. |
212
240
  | `grum request <key> [<key>...] [--reason "..."] [--url <page>] [--browser chrome | safari] [--no-capture]` | Ask the owners to allow drift items; items on one page capture together. |
241
+ | `grum uninstall [--yes]` | Remove Grum from this repository and this computer. See [Uninstall](#uninstall). |
213
242
  | `grum capture reset` | Clear this repository's saved capture-browser sign-ins. |
214
243
  | `grum contract` | Print the contract packet. |
215
244
  | `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. |
216
245
  | `grum init codex [--remove] [--force] [--local-only] [--pre-commit]` | The same for Codex: `.codex/config.toml`, `.codex/hooks.json` and the `AGENTS.md` block. |
246
+ | `grum init claude [--remove] [--force] [--local-only] [--pre-commit]` | The same for Claude Code: `.mcp.json`, `.claude/settings.json` and the `CLAUDE.md` block. |
217
247
 
218
248
  ```sh
219
249
  grum check --staged # drift in the blocks staged for commit
@@ -230,7 +260,22 @@ grum check --strict # like --ci, and also fail while a review is
230
260
 
231
261
  `--ci` and `--report` show up on the Drift page under Recent checks, one latest run per branch. CI, JSON, staged, and agent runs never open the menu and never prompt.
232
262
 
233
- `grum hook` and `grum mcp` are the entry points Cursor runs. You do not call them yourself.
263
+ `grum hook` and `grum mcp` are the entry points Cursor, Codex and Claude Code run. You do not call them yourself.
264
+
265
+ ## Uninstall
266
+
267
+ ```sh
268
+ npx @grum-os/cli uninstall
269
+ ```
270
+
271
+ Run it in the repository. It asks first (Enter means no), then removes:
272
+
273
+ - **From this repository:** Grum's Cursor, Codex and Claude Code entries (only Grum's; the rest of each file stays), the pre-commit check, the `.gitignore` line, and `.grum/`.
274
+ - **From this computer:** every sign-in, ended in Grum too so the token stops working, and `~/.config/grum` (sign-ins, capture browser data, the log).
275
+
276
+ Your workspace, contract and reviews stay in Grum. Other repositories you set up keep their files: run it in each. `--yes` skips the question, for scripts and agents.
277
+
278
+ If you installed the CLI globally, also run `npm uninstall -g @grum-os/cli`.
234
279
 
235
280
  ## Environment
236
281
 
package/content.md5 CHANGED
@@ -1 +1 @@
1
- 91072ef44363e75d825b32a6e9dedb31
1
+ b71376996348e1a5fdbf69d852b16fc5