@getripple/cli 1.0.5 → 1.0.7

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @getripple/cli Changelog
2
2
 
3
+ ## [1.0.6] - 2026-06-07
4
+
5
+ ### Fixed
6
+ - Depend on the `1.0.6` core engine so CLI readiness output explains blocked Git execution clearly.
7
+ - Keep install and release proofs aligned with the fixed package set.
8
+
3
9
  ## [1.0.5] - 2026-06-04
4
10
 
5
11
  ### Changed
package/README.md CHANGED
@@ -1,147 +1,569 @@
1
1
  # @getripple/cli
2
2
 
3
- Run Ripple's architecture checks in your terminal and CI pipeline without VS Code.
4
-
5
3
  Plan before edit. Check after edit. Catch drift. Tell the agent what to fix.
6
4
 
7
- ```bash
8
- npx -y @getripple/cli plan --file src/auth.ts --task "refactor token handling" --save
5
+ **Terminal and CI interface for Ripple's local drift-control gate for AI coding agents.**
6
+
7
+ `@getripple/cli` is the command-line interface for Ripple. Use it when you want to plan before an AI coding agent edits, check after edit, catch drift, and tell the agent what to fix.
8
+
9
+ Ripple helps agents work inside a human-approved boundary:
10
+
11
+ ```txt
12
+ plan before edit
13
+ save intent
14
+ check after edit
15
+ catch drift
16
+ tell the agent what to fix
17
+ continue / repair / human review
18
+ ```
19
+
20
+ The CLI is best for:
21
+
22
+ ```txt
23
+ terminal workflows
24
+ CI gates
25
+ release checks
26
+ local repo scanning
27
+ human-controlled agent workflows
9
28
  ```
10
29
 
11
- ## Quick Start
30
+ For MCP-compatible AI agents, use `@getripple/mcp`.
31
+
32
+ ---
12
33
 
13
- **Step 1 — Initialize Ripple in your repo:**
34
+ ## 60-Second Start
35
+
36
+ Initialize Ripple in a repo:
14
37
 
15
38
  ```bash
16
39
  npx -y @getripple/cli init
17
40
  ```
18
41
 
19
- Scans your project, builds the dependency graph, and writes `.ripple/` context
20
- files. Run this once per project.
21
-
22
- **Step 2 — Plan before editing a file:**
42
+ Create a saved intent before editing:
23
43
 
24
44
  ```bash
25
- npx -y @getripple/cli plan --file src/auth.ts --task "refactor token handling" --mode file --save
45
+ npx -y @getripple/cli plan \
46
+ --file src/auth.ts \
47
+ --task "refactor token handling" \
48
+ --mode file \
49
+ --agent \
50
+ --save
26
51
  ```
27
52
 
28
- Returns the files to read first, the risk level, the allowed boundary, and what
29
- to verify. `--save` records the intent so the next check can detect drift.
30
-
31
- **Step 3 — After editing and staging, check for drift:**
53
+ Let your AI coding agent edit the code, then stage the intended files:
32
54
 
33
55
  ```bash
34
- npx -y @getripple/cli check --staged --intent latest
56
+ git add src/auth.ts
35
57
  ```
36
58
 
37
- Compares your staged changes against the saved plan. Returns a verdict:
38
- intent drift, boundary drift, or clean.
39
-
40
- **Step 4 — Get the compact continue/stop decision:**
59
+ Ask Ripple whether work may continue:
41
60
 
42
61
  ```bash
43
62
  npx -y @getripple/cli gate --intent latest
44
63
  ```
45
64
 
46
- Returns one of four decisions the agent or CI pipeline acts on directly:
65
+ If the agent stayed inside the saved plan, Ripple returns:
66
+
67
+ ```txt
68
+ continue
69
+ ```
70
+
71
+ If the agent crossed the boundary, Ripple returns:
72
+
73
+ ```txt
74
+ repair
75
+ ```
76
+
77
+ or:
78
+
79
+ ```txt
80
+ human-review
81
+ ```
82
+
83
+ with the exact reason and next action.
84
+
85
+ ---
86
+
87
+ ## Why This Exists
88
+
89
+ AI coding agents can edit quickly.
90
+
91
+ The hard question is not only:
92
+
93
+ ```txt
94
+ Is the code good?
95
+ ```
96
+
97
+ The deeper question is:
47
98
 
99
+ ```txt
100
+ Was the agent allowed to make this change?
48
101
  ```
49
- open/continue
50
- closed/repair
51
- closed/human-review
52
- closed/restore-readiness
102
+
103
+ Ripple keeps a local record of what the human approved, then checks the actual staged changes against that approval.
104
+
105
+ Example:
106
+
107
+ ```txt
108
+ Approved:
109
+ - src/auth.ts
110
+
111
+ Agent changed:
112
+ - src/auth.ts
113
+ - src/payments/webhook.ts
114
+
115
+ Ripple:
116
+ human-review — agent changed a file outside the approved boundary
53
117
  ```
54
118
 
119
+ Ripple does not replace tests, code review, or human judgment.
120
+
121
+ Ripple checks whether the agent stayed inside the work it was trusted to do.
122
+
123
+ ---
124
+
55
125
  ## Install
56
126
 
127
+ Use with `npx`:
128
+
129
+ ```bash
130
+ npx -y @getripple/cli doctor
131
+ ```
132
+
133
+ Or install globally:
134
+
57
135
  ```bash
58
136
  npm install -g @getripple/cli
59
137
  ```
60
138
 
61
- Then use `ripple` directly:
139
+ Then run:
62
140
 
63
141
  ```bash
64
142
  ripple init
65
- ripple plan --file src/auth.ts --task "refactor token handling" --mode file --save
66
- ripple check --staged --intent latest
143
+ ripple doctor
144
+ ripple plan --file src/auth.ts --task "refactor token handling" --mode file --agent --save
145
+ ripple check --staged --agent --intent latest
67
146
  ripple gate --intent latest
68
147
  ```
69
148
 
70
- Check that the project is ready before running anything else:
149
+ ---
150
+
151
+ ## Core Workflow
152
+
153
+ ```txt
154
+ 1. Initialize Ripple
155
+ 2. Plan before edit
156
+ 3. Save the human-approved intent
157
+ 4. Let the agent edit
158
+ 5. Stage the intended files
159
+ 6. Check after edit
160
+ 7. Catch drift
161
+ 8. Tell the agent what to fix
162
+ 9. Continue, repair, or ask the human
163
+ ```
164
+
165
+ ---
166
+
167
+ ## 1. Initialize
71
168
 
72
169
  ```bash
73
- npx -y @getripple/cli doctor
170
+ ripple init
171
+ ```
172
+
173
+ Creates local workflow and CI files:
174
+
175
+ ```txt
176
+ .ripple/policy.json repo trust defaults
177
+ .github/workflows/ripple.yml GitHub Actions gate
178
+ .gitignore .ripple/.cache/ hygiene
179
+ .ripple/.cache/graph.cache.json local graph cache after scan
74
180
  ```
75
181
 
76
- Or, after global install:
182
+ Normal CLI `scan`, `check`, and `gate` runs stay lean. They do not dump broad agent files unless you ask.
183
+
184
+ Generate file-based agent instructions explicitly:
77
185
 
78
186
  ```bash
79
- ripple doctor
187
+ ripple workflow
188
+ ```
189
+
190
+ MCP-capable agents should prefer `@getripple/mcp` instead of reading generated files.
191
+
192
+ ---
193
+
194
+ ## 2. Plan Before Edit
195
+
196
+ ```bash
197
+ ripple plan \
198
+ --file src/auth.ts \
199
+ --task "refactor token handling" \
200
+ --mode file \
201
+ --agent \
202
+ --save
203
+ ```
204
+
205
+ This creates a saved intent.
206
+
207
+ The saved intent tells Ripple:
208
+
209
+ ```txt
210
+ what task was approved
211
+ which file or symbol may change
212
+ which files are context only
213
+ which tests should be verified
214
+ which human gate applies
215
+ ```
216
+
217
+ The saved intent becomes the trust boundary for the agent's work.
218
+
219
+ ---
220
+
221
+ ## 3. Check After Edit
222
+
223
+ After the agent edits code and you stage the intended files:
224
+
225
+ ```bash
226
+ git add src/auth.ts
227
+ ripple check --staged --agent --intent latest
228
+ ```
229
+
230
+ For the compact continue/stop decision:
231
+
232
+ ```bash
233
+ ripple gate --intent latest
234
+ ```
235
+
236
+ `ripple gate` answers one question:
237
+
238
+ ```txt
239
+ Can the agent continue?
240
+ ```
241
+
242
+ ---
243
+
244
+ ## 4. Catch Drift
245
+
246
+ Ripple checks two forms of drift:
247
+
248
+ ```txt
249
+ intent drift -> did the edit leave the saved task?
250
+ boundary drift -> did the edit cross the chosen freedom level?
251
+ ```
252
+
253
+ If the agent stayed inside the approved work, Ripple allows the workflow to continue.
254
+
255
+ If the agent crossed the approved work, Ripple returns a repair or human-review decision.
256
+
257
+ ---
258
+
259
+ ## 5. Tell the Agent What to Fix
260
+
261
+ When drift is found, Ripple gives the agent a concrete handoff:
262
+
263
+ ```txt
264
+ what changed
265
+ why it is risky
266
+ what must be undone
267
+ what needs verification
268
+ when to ask the human
269
+ ```
270
+
271
+ For detailed repair actions:
272
+
273
+ ```bash
274
+ ripple repair --agent --intent latest
275
+ ```
276
+
277
+ Repair may tell the agent to:
278
+
279
+ ```txt
280
+ unstage an unplanned file
281
+ undo a symbol outside the approved boundary
282
+ review a possible public contract change
283
+ run a verification target
284
+ create a wider intent if the task expanded
285
+ ask the human for approval
286
+ ```
287
+
288
+ ---
289
+
290
+ ## Trust Boundaries
291
+
292
+ Choose how much freedom the agent gets when you plan:
293
+
294
+ | Mode | Boundary |
295
+ | ------------ | -------------------------------------------- |
296
+ | `brainstorm` | No edits allowed. Suggest and explain only. |
297
+ | `function` | Only the approved symbol may change. |
298
+ | `file` | Only the selected file may change. |
299
+ | `task` | Files in the saved task plan may change. |
300
+ | `pr` | Full task scope. Human reviews before merge. |
301
+
302
+ Example function boundary:
303
+
304
+ ```bash
305
+ ripple plan \
306
+ --file src/auth.ts \
307
+ --symbol refreshToken \
308
+ --task "fix retry behavior" \
309
+ --mode function \
310
+ --agent \
311
+ --save
312
+ ```
313
+
314
+ If `function` mode approves only `refreshToken` but the agent also changes `login`, Ripple stops the workflow and tells the agent what to fix.
315
+
316
+ ---
317
+
318
+ ## Gate Decisions
319
+
320
+ `ripple gate` is the command an agent or CI system should obey:
321
+
322
+ ```bash
323
+ ripple gate --intent latest
324
+ ```
325
+
326
+ Example output:
327
+
328
+ ```txt
329
+ STOP: agent crossed approved function boundary.
330
+
331
+ Allowed:
332
+ - src/auth.ts::refreshToken
333
+
334
+ Changed outside boundary:
335
+ - src/auth.ts::login
336
+
337
+ Fix:
338
+ - undo src/auth.ts::login
339
+ - or create a wider human-approved intent
340
+ ```
341
+
342
+ Machine-readable output includes:
343
+
344
+ ```json
345
+ {
346
+ "status": "closed",
347
+ "decision": "human-review",
348
+ "canContinue": false,
349
+ "mustStop": true,
350
+ "needsHuman": true,
351
+ "why": ["Changed symbol outside approved boundary: src/auth.ts::login"],
352
+ "fixNow": ["Undo src/auth.ts::login or replan with human approval."]
353
+ }
354
+ ```
355
+
356
+ Agent rule:
357
+
358
+ ```txt
359
+ canContinue=true -> continue after required verification
360
+ mustStop=true -> stop and follow fixNow
361
+ needsHuman=true -> ask the human; do not self-approve
362
+ ```
363
+
364
+ ---
365
+
366
+ ## Check and Repair
367
+
368
+ For detailed drift information:
369
+
370
+ ```bash
371
+ ripple check --staged --agent --intent latest
372
+ ```
373
+
374
+ For concrete repair actions:
375
+
376
+ ```bash
377
+ ripple repair --agent --intent latest
80
378
  ```
81
379
 
380
+ Use `check` when you want evidence.
381
+
382
+ Use `gate` when you want a compact decision.
383
+
384
+ Use `repair` when the agent needs exact next actions.
385
+
386
+ ---
387
+
82
388
  ## CI Gate
83
389
 
84
- Generate a GitHub Actions workflow file:
390
+ Generate the workflow:
85
391
 
86
392
  ```bash
87
393
  ripple init-ci
88
394
  ```
89
395
 
90
- Add Ripple as a pull-request gate in CI:
396
+ Run the gate in CI:
91
397
 
92
398
  ```bash
93
399
  ripple ci --base origin/main --intent latest --github-annotations
94
400
  ```
95
401
 
96
- The gate emits GitHub annotations for each drift finding and writes a summary
97
- to the Actions step summary panel. Exits non-zero when drift blocks merge.
402
+ The CI gate emits GitHub annotations for:
98
403
 
99
- ## Control Modes
404
+ ```txt
405
+ intent drift
406
+ boundary drift
407
+ contract drift
408
+ policy drift
409
+ readiness drift
410
+ ```
100
411
 
101
- Pass `--mode` to `ripple plan` to set the trust boundary:
412
+ It exits non-zero when work must not merge.
413
+
414
+ ---
415
+
416
+ ## Useful Commands
417
+
418
+ ```txt
419
+ ripple init initialize policy, CI, git hygiene, and graph cache
420
+ ripple doctor check project readiness
421
+ ripple scan refresh the local graph cache
422
+ ripple workflow generate .ripple/WORKFLOW.md for file-based agents
423
+ ripple plan plan context before editing and optionally save intent
424
+ ripple check check staged or changed files against saved intent
425
+ ripple audit audit a completed change for drift signals
426
+ ripple repair get concrete repair actions
427
+ ripple gate compact continue/stop decision
428
+ ripple approval check saved human gate status
429
+ ripple approve record human approval for a gate
430
+ ripple ci run the CI gate against a base ref
431
+ ripple agent print the agent workflow guide
432
+ ripple focus show focused context for a file
433
+ ripple blast show files affected by a target file
434
+ ripple imports show files imported by a target file
435
+ ripple importers show files that import a target file
436
+ ripple symbols show exported symbols for a file
437
+ ripple callers show callers of a symbol
438
+ ripple history show recent architectural history
439
+ ripple policy init create repo trust policy
440
+ ripple policy explain explain active policy for a file
441
+ ```
102
442
 
103
- | Mode | What the agent is allowed to touch |
104
- | ------------ | ---------------------------------------------------- |
105
- | `brainstorm` | No edits allowed — suggest and explain only |
106
- | `function` | Only the approved symbol |
107
- | `file` | Only the planned file |
108
- | `task` | All files listed in the saved intent |
109
- | `pr` | Full task scope — agent prepares PR for human review |
443
+ ---
110
444
 
111
- After staging, `ripple check --staged` detects whether the agent stayed inside
112
- the boundary and reports boundary drift separately from intent drift.
445
+ ## Example Agent Loop
113
446
 
114
- ## All Commands
447
+ A safe CLI-based agent workflow should look like this:
115
448
 
449
+ ```txt
450
+ 1. Run ripple doctor
451
+ 2. Run ripple plan with --save
452
+ 3. Read the suggested context
453
+ 4. Edit only inside the approved boundary
454
+ 5. Stage the intended files
455
+ 6. Run ripple check --staged
456
+ 7. Run ripple gate
457
+ 8. Continue, repair, or stop based on the gate
116
458
  ```
117
- ripple init Initialize Ripple in the current repo
118
- ripple doctor Check project readiness
119
- ripple scan Scan the repo and rebuild the graph
120
- ripple focus Show focused context for a file
121
- ripple blast Show files that depend on a target file
122
- ripple imports Show what a file imports
123
- ripple importers Show what imports a file
124
- ripple symbols Show exported symbols in a file
125
- ripple callers Show callers of a symbol
126
- ripple history Show recent architectural changes
127
- ripple plan Plan context before editing a file
128
- ripple check Check staged or changed files against saved intent
129
- ripple audit Audit a completed change for drift signals
130
- ripple repair Get repair actions when drift is detected
131
- ripple gate Compact continue/stop decision
132
- ripple agent Print the agent workflow guide
133
- ripple init-ci Generate a GitHub Actions workflow file
134
- ripple ci Run the CI gate against a base ref
459
+
460
+ If `mustStop=true`, the agent must stop.
461
+
462
+ If `needsHuman=true`, the agent must ask the human.
463
+
464
+ If `canContinue=true`, the agent may continue only after required verification passes.
465
+
466
+ ---
467
+
468
+ ## Local Files
469
+
470
+ Ripple may create local workflow state in the target repo:
471
+
472
+ ```txt
473
+ .ripple/policy.json
474
+ .ripple/history.json
475
+ .ripple/intents/latest.json
476
+ .ripple/approvals/
477
+ .ripple/.cache/
478
+ .github/workflows/ripple.yml
479
+ ```
480
+
481
+ Recommended git behavior:
482
+
483
+ ```txt
484
+ commit: .ripple/policy.json
485
+ commit: .github/workflows/ripple.yml
486
+ commit: .ripple/intents/ only if your team wants saved intent records
487
+ ignore: .ripple/.cache/
135
488
  ```
136
489
 
490
+ `.ripple/.cache/` is machine cache.
491
+
492
+ Policy, CI, intents, and approvals are workflow/audit state.
493
+
494
+ ---
495
+
496
+ ## MCP
497
+
498
+ For MCP-compatible AI agents, use:
499
+
500
+ ```bash
501
+ npx -y @getripple/mcp --workspace /absolute/path/to/your/repo
502
+ ```
503
+
504
+ The CLI is best for terminal, CI, scripts, and human-controlled workflows.
505
+
506
+ The MCP server is best when the agent should call Ripple tools directly.
507
+
508
+ ---
509
+
510
+ ## Language Support
511
+
512
+ Strongest today:
513
+
514
+ ```txt
515
+ JavaScript
516
+ TypeScript
517
+ ```
518
+
519
+ Basic support:
520
+
521
+ ```txt
522
+ Python imports
523
+ Python functions
524
+ Python classes
525
+ Python methods
526
+ file-level staged checks
527
+ ```
528
+
529
+ ---
530
+
137
531
  ## Privacy
138
532
 
139
- Ripple runs entirely on your machine. No account, telemetry, cloud indexing, or
140
- remote model call is required by the CLI.
533
+ Ripple runs locally.
534
+
535
+ ```txt
536
+ No account required
537
+ No telemetry
538
+ No cloud indexing
539
+ No code upload
540
+ No remote model call required
541
+ ```
542
+
543
+ Your repo is scanned on your machine.
544
+
545
+ ---
141
546
 
142
547
  ## Status
143
548
 
144
- Public alpha. The strongest current experience is JavaScript and TypeScript.
549
+ Public alpha.
550
+
551
+ Ripple is a strong local signal and gate.
552
+
553
+ It is not:
554
+
555
+ ```txt
556
+ a sandbox
557
+ a test replacement
558
+ a typechecker replacement
559
+ a code review replacement
560
+ a CI replacement
561
+ a human judgment replacement
562
+ ```
563
+
564
+ Ripple helps you check whether an AI coding agent stayed inside the work it was trusted to do.
565
+
566
+ ---
145
567
 
146
568
  ## License
147
569