@ranger-testing/ranger-cli 1.0.13 → 1.1.0

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 (101) hide show
  1. package/README.md +72 -183
  2. package/build/cli.js +219 -278
  3. package/build/cli.js.map +1 -1
  4. package/build/commands/addEnv.js +1 -1
  5. package/build/commands/addEnv.js.map +1 -1
  6. package/build/commands/authEncrypt.js +7 -6
  7. package/build/commands/authEncrypt.js.map +1 -1
  8. package/build/commands/clean.js +1 -1
  9. package/build/commands/clean.js.map +1 -1
  10. package/build/commands/config.js +5 -4
  11. package/build/commands/config.js.map +1 -1
  12. package/build/commands/dataMcpServer.js +1 -1
  13. package/build/commands/dataMcpServer.js.map +1 -1
  14. package/build/commands/env.js +17 -10
  15. package/build/commands/env.js.map +1 -1
  16. package/build/commands/feature.js +277 -285
  17. package/build/commands/feature.js.map +1 -1
  18. package/build/commands/hook.js +27 -0
  19. package/build/commands/hook.js.map +1 -0
  20. package/build/commands/hooks/disable.js +25 -0
  21. package/build/commands/hooks/disable.js.map +1 -0
  22. package/build/commands/hooks/enable.js +44 -0
  23. package/build/commands/hooks/enable.js.map +1 -0
  24. package/build/commands/hooks/exitPlanMode.js +35 -0
  25. package/build/commands/hooks/exitPlanMode.js.map +1 -0
  26. package/build/commands/hooks/index.js +10 -0
  27. package/build/commands/hooks/index.js.map +1 -0
  28. package/build/commands/hooks/output.js +53 -0
  29. package/build/commands/hooks/output.js.map +1 -0
  30. package/build/commands/hooks/planReminder.js +46 -0
  31. package/build/commands/hooks/planReminder.js.map +1 -0
  32. package/build/commands/hooks/planStart.js +30 -0
  33. package/build/commands/hooks/planStart.js.map +1 -0
  34. package/build/commands/hooks/postEdit.js +41 -0
  35. package/build/commands/hooks/postEdit.js.map +1 -0
  36. package/build/commands/hooks/preCompact.js +30 -0
  37. package/build/commands/hooks/preCompact.js.map +1 -0
  38. package/build/commands/hooks/sessionStart.js +35 -0
  39. package/build/commands/hooks/sessionStart.js.map +1 -0
  40. package/build/commands/hooks/stopHook.js +54 -0
  41. package/build/commands/hooks/stopHook.js.map +1 -0
  42. package/build/commands/index.js +1 -0
  43. package/build/commands/index.js.map +1 -1
  44. package/build/commands/skillup.js +41 -77
  45. package/build/commands/skillup.js.map +1 -1
  46. package/build/commands/start.js +1 -1
  47. package/build/commands/start.js.map +1 -1
  48. package/build/commands/status.js +47 -65
  49. package/build/commands/status.js.map +1 -1
  50. package/build/commands/update.js +32 -40
  51. package/build/commands/update.js.map +1 -1
  52. package/build/commands/updateEnv.js +1 -1
  53. package/build/commands/updateEnv.js.map +1 -1
  54. package/build/commands/useEnv.js +1 -1
  55. package/build/commands/useEnv.js.map +1 -1
  56. package/build/commands/utils/browserSessionsApi.js +1 -1
  57. package/build/commands/utils/browserSessionsApi.js.map +1 -1
  58. package/build/commands/utils/claudePlugin.js +85 -0
  59. package/build/commands/utils/claudePlugin.js.map +1 -0
  60. package/build/commands/utils/cliSecret.js +1 -1
  61. package/build/commands/utils/environment.js +0 -6
  62. package/build/commands/utils/environment.js.map +1 -1
  63. package/build/commands/utils/featureApi.js +82 -15
  64. package/build/commands/utils/featureApi.js.map +1 -1
  65. package/build/commands/utils/featureReportGenerator.js +37 -3
  66. package/build/commands/utils/featureReportGenerator.js.map +1 -1
  67. package/build/commands/utils/git.js +44 -0
  68. package/build/commands/utils/git.js.map +1 -0
  69. package/build/commands/utils/keychain.js +1 -1
  70. package/build/commands/utils/keychain.js.map +1 -1
  71. package/build/commands/utils/localAgentInstallationsApi.js +1 -1
  72. package/build/commands/utils/rangerRoot.js +30 -0
  73. package/build/commands/utils/rangerRoot.js.map +1 -0
  74. package/build/commands/utils/sessionCache.js +133 -0
  75. package/build/commands/utils/sessionCache.js.map +1 -0
  76. package/build/commands/utils/settings.js +7 -5
  77. package/build/commands/utils/settings.js.map +1 -1
  78. package/build/commands/utils/skillContent.js +28 -0
  79. package/build/commands/utils/skillContent.js.map +1 -0
  80. package/build/commands/utils/skills.js +1 -1
  81. package/build/commands/utils/skills.js.map +1 -1
  82. package/build/commands/utils/userApi.js +32 -0
  83. package/build/commands/utils/userApi.js.map +1 -0
  84. package/build/commands/verifyFeature.js +450 -105
  85. package/build/commands/verifyFeature.js.map +1 -1
  86. package/build/commands/verifyInBrowser.js +1 -1
  87. package/build/commands/verifyInBrowser.js.map +1 -1
  88. package/build/skills/bug-bash.md +31 -10
  89. package/build/skills/ranger/SKILL.md +164 -0
  90. package/build/skills/ranger/create.md +151 -0
  91. package/build/skills/ranger/start.md +122 -0
  92. package/build/skills/{feature-tracker → ranger}/verify.md +43 -17
  93. package/package.json +5 -3
  94. package/scripts/postinstall.js +18 -0
  95. package/build/commands/utils/mcpConfig.js +0 -1
  96. package/build/commands/utils/mcpConfig.js.map +0 -1
  97. package/build/skills/feature-tracker/SKILL.md +0 -185
  98. package/build/skills/feature-tracker/create.md +0 -105
  99. package/build/skills/feature-tracker/manage.md +0 -145
  100. package/build/skills/feature-tracker/report.md +0 -159
  101. package/build/skills/feature-tracker/start.md +0 -93
package/README.md CHANGED
@@ -10,40 +10,45 @@ npm install -g @ranger-testing/ranger-cli
10
10
 
11
11
  ## Quick Start
12
12
 
13
- 1. Get your API token from [dashboard.ranger.net/settings](https://dashboard.ranger.net/settings)
13
+ Go to [dashboard.ranger.net/cli](https://dashboard.ranger.net/cli) to get started.
14
14
 
15
- 2. Initialize Ranger in your project:
16
- ```bash
17
- ranger start <your-api-token>
18
- ```
15
+ ## Claude Code Plugin
19
16
 
20
- 3. Add an environment (e.g., local, staging, prod):
21
- ```bash
22
- ranger add env local
23
- ```
17
+ The Ranger plugin for Claude Code is installed automatically when you run `ranger start`. You can choose to install it at the user level (available in all projects) or project level (shared with team via git).
18
+
19
+ The plugin provides:
20
+ - **Auto-firing hooks** - Automatically loads Ranger context at session start
21
+ - **Feature tracking** - Track feature development with verifiable checklist items
22
+
23
+ To check plugin status, run `ranger status`.
24
+
25
+ ### Manual Plugin Installation
26
+
27
+ If you need to install the plugin manually (e.g., skipped during setup or installing on a new machine):
24
28
 
25
- 4. Install skills for Claude Code (run this in the directory where you want to use Ranger):
26
29
  ```bash
27
- ranger skillup
28
- ```
30
+ # Add the marketplace (one-time)
31
+ claude plugin marketplace add ranger-testing/trailhead
29
32
 
30
- 5. Start using Ranger skills in Claude Code! For example:
31
- ```
32
- /bug-bash test the new feature on this branch
33
- /e2e-test-recommender recommend tests for this new feature
33
+ # Install to user scope (available in all projects)
34
+ claude plugin install ranger@trailhead --scope user
35
+
36
+ # Or install to project scope (shared with team via git)
37
+ claude plugin install ranger@trailhead --scope project
34
38
  ```
35
39
 
36
40
  ## Commands
37
41
 
38
42
  ### `ranger start <token>`
39
43
 
40
- Initialize Ranger in your project. Get your token from [dashboard.ranger.net/settings](https://dashboard.ranger.net/settings).
44
+ Initialize Ranger in your project. Get your token from [dashboard.ranger.net/cli](https://dashboard.ranger.net/cli).
41
45
 
42
46
  This command:
43
47
  - Validates your API token
44
- - Creates `.mcp.json` with the Ranger MCP server configuration
45
48
  - Creates the `.ranger/` directory for environment configs
46
49
  - Creates `.ranger/.gitignore` to exclude local environment (contains auth state)
50
+ - Prompts to install the Claude Code plugin (user or project scope)
51
+ - Prompts to add an environment and install skills
47
52
 
48
53
  ```bash
49
54
  ranger start rngr_abc123...
@@ -51,10 +56,9 @@ ranger start rngr_abc123...
51
56
 
52
57
  ### `ranger skillup`
53
58
 
54
- Install Ranger skills for Claude Code. This command installs AI agents that help with testing and bug hunting:
59
+ Install Ranger skills for Claude Code. This command installs AI agents that help with feature development:
55
60
 
56
- - **e2e-test-recommender** - Installed if you have an API token. Analyzes code changes and suggests end-to-end tests.
57
- - **bug-bash** - Installed if you have an API token AND an active environment. Explores new features via browser to find bugs.
61
+ - **ranger** - Installed if you have an API token AND an active environment. Tracks feature development with browser verification.
58
62
 
59
63
  Skills are installed to `.claude/skills/` and can be invoked in Claude Code conversations.
60
64
 
@@ -64,7 +68,7 @@ ranger skillup
64
68
 
65
69
  **Important:** Run this command in the directory where you want to use Ranger skills. Skills are installed relative to your current working directory.
66
70
 
67
- Run this command after `ranger start` and again after `ranger add env` to install all available skills.
71
+ Run this command after `ranger start` and `ranger add env` to install all available skills.
68
72
 
69
73
  ### `ranger add env <env-name>`
70
74
 
@@ -86,12 +90,20 @@ Switch to a different environment.
86
90
  ranger use staging
87
91
  ```
88
92
 
89
- ### `ranger update env <env-name>`
93
+ ### `ranger env update <env-name>`
90
94
 
91
95
  Update authentication for an existing environment (re-capture cookies/storage).
92
96
 
93
97
  ```bash
94
- ranger update env staging
98
+ ranger env update staging
99
+ ```
100
+
101
+ ### `ranger env ls`
102
+
103
+ List all configured environments.
104
+
105
+ ```bash
106
+ ranger env ls
95
107
  ```
96
108
 
97
109
  ### `ranger update`
@@ -104,6 +116,14 @@ ranger update
104
116
 
105
117
  This command updates the globally installed `@ranger-testing/ranger-cli` package and reinstalls skills to ensure compatibility.
106
118
 
119
+ ### `ranger status`
120
+
121
+ Show Ranger status including version, Claude Code plugin status, installed skills, and configured environments.
122
+
123
+ ```bash
124
+ ranger status
125
+ ```
126
+
107
127
  ### `ranger config`
108
128
 
109
129
  Manage browser configuration for environments (userAgent, headers, etc.).
@@ -124,7 +144,7 @@ ranger config set ci header.Authorization '${AUTH_TOKEN}'
124
144
  ranger config set ci headless true
125
145
  ```
126
146
 
127
- **Environment variable substitution**: Values like `${VAR_NAME}` are stored as-is and resolved at runtime when `verify-in-browser` runs.
147
+ **Environment variable substitution**: Values like `${VAR_NAME}` are stored as-is and resolved at runtime.
128
148
 
129
149
  #### `ranger config get <env> <key>`
130
150
 
@@ -156,16 +176,6 @@ Remove a config value.
156
176
  ranger config unset ci header.X-Test-Mode
157
177
  ```
158
178
 
159
- ### `ranger verify-in-browser --url <url> --task <task>`
160
-
161
- Verify a UI flow in an isolated browser session. Returns structured results with any issues found.
162
-
163
- ```bash
164
- ranger verify-in-browser \
165
- --url "http://localhost:3000/login" \
166
- --task "Enter valid credentials and verify successful login"
167
- ```
168
-
169
179
  ### Feature Tracking Commands
170
180
 
171
181
  Track feature development progress with verifiable checklist items. Each item can be verified in the browser with evidence (screenshots, traces, conversation logs).
@@ -177,17 +187,19 @@ Create a new feature with a checklist. Automatically captures git context (repo
177
187
  ```bash
178
188
  ranger feature create "User Authentication" \
179
189
  --description "Login, signup, and password reset flows" \
180
- --checklist "Login works,Signup creates account,Password reset sends email"
190
+ -c "Login works" \
191
+ -c "Signup creates account" \
192
+ -c "Password reset sends email"
181
193
  ```
182
194
 
183
195
  #### `ranger feature list`
184
196
 
185
- List all features with status.
197
+ List all features with session status.
186
198
 
187
199
  ```bash
188
200
  ranger feature list # All features
189
- ranger feature list --status in_progress
190
201
  ranger feature list --current-branch # Features for current git branch
202
+ ranger feature list --limit 20 # Show more results
191
203
  ```
192
204
 
193
205
  #### `ranger feature show [id]`
@@ -199,66 +211,22 @@ ranger feature show
199
211
  ranger feature show feat_abc123
200
212
  ```
201
213
 
202
- #### `ranger feature use <id>`
203
-
204
- Set the active feature.
205
-
206
- ```bash
207
- ranger feature use feat_abc123
208
- ```
209
-
210
- #### `ranger feature resume`
211
-
212
- Find and use a feature matching the current git context (repo + branch).
213
-
214
- ```bash
215
- ranger feature resume
216
- ```
217
-
218
- #### `ranger feature block [id]`
214
+ #### `ranger feature resume [id]`
219
215
 
220
- Mark a feature as blocked.
216
+ Resume a specific feature by ID. Use `ranger feature list` first to find features.
221
217
 
222
218
  ```bash
223
- ranger feature block --reason "Waiting for API changes"
219
+ ranger feature list # List features (filter with --current-branch)
220
+ ranger feature resume feat_abc123 # Resume the feature
224
221
  ```
225
222
 
226
- #### `ranger feature manage`
223
+ #### `ranger feature add-checklist-item <description>`
227
224
 
228
- Manage checklist items. Can be used interactively (for humans) or with flags (for agents/automation).
225
+ Add a checklist item to a feature.
229
226
 
230
- **Interactive mode** (no flags):
231
227
  ```bash
232
- ranger feature manage
233
- # Shows menu to add, edit, block, cancel, or reset items
234
- ```
235
-
236
- **Non-interactive mode** (with flags - agent-friendly):
237
- ```bash
238
- # Add a new checklist item
239
- ranger feature manage --add "New checklist item description"
240
-
241
- # Edit an item's description (1-based index)
242
- ranger feature manage --edit 1 --description "Updated description"
243
-
244
- # Block an item with reason
245
- ranger feature manage --block 2 --reason "Bug found in login flow"
246
-
247
- # Cancel an item with reason
248
- ranger feature manage --cancel 3 --reason "Descoped to v2"
249
-
250
- # Reset an item to pending
251
- ranger feature manage --reset 2
252
- ```
253
-
254
- #### `ranger feature report [id]`
255
-
256
- Generate a markdown report with all verification evidence.
257
-
258
- ```bash
259
- ranger feature report # Uses active feature
260
- ranger feature report feat_abc123
261
- ranger feature report --output ./my-report.md
228
+ ranger feature add-checklist-item "User can reset password"
229
+ ranger feature add-checklist-item "Admin can view all users" --id feat_abc123
262
230
  ```
263
231
 
264
232
  ### `ranger verify-feature`
@@ -267,15 +235,15 @@ Verify a checklist item in the browser. Requires an active feature.
267
235
 
268
236
  ```bash
269
237
  ranger verify-feature \
270
- --url "http://localhost:3000/login" \
271
238
  --task "Log in with valid credentials and verify redirect to dashboard"
272
239
  ```
273
240
 
241
+ The URL is derived from your active environment's `baseUrl` setting.
242
+
274
243
  Options:
275
- - `--url` (required): URL to navigate to
244
+ - `--env`: Environment to use (defaults to active environment)
276
245
  - `--task`: Task description (defaults to checklist item description)
277
246
  - `--item <index>`: Verify specific item by index (1-based)
278
- - `--new-item <description>`: Create and verify a new item
279
247
 
280
248
  ### `ranger clean`
281
249
 
@@ -285,6 +253,15 @@ Remove all Ranger artifacts from the project (`.ranger/`, `.mcp.json` entries).
285
253
  ranger clean
286
254
  ```
287
255
 
256
+ ### `ranger auth encrypt <env>`
257
+
258
+ Encrypt auth.json for an environment to allow safe git storage.
259
+
260
+ ```bash
261
+ ranger auth encrypt local # Encrypts .ranger/local/auth.json -> auth.json.enc
262
+ ranger auth encrypt ci # Encrypts .ranger/ci/auth.json -> auth.json.enc
263
+ ```
264
+
288
265
  ## Configuring agents.md
289
266
 
290
267
  Create or update `.claude/agents.md` in your project to help Claude Code understand your environment setup. This file should include:
@@ -309,90 +286,6 @@ Example `.claude/agents.md`:
309
286
 
310
287
  This helps Ranger skills understand where to test and what each environment represents.
311
288
 
312
- ## Using with Claude Code
313
-
314
- Once Ranger is set up, you can use it with Claude Code in several ways:
315
-
316
- ### 1. Ranger MCP Tools
317
-
318
- After running `ranger start`, the Ranger MCP server is configured in your project. Claude Code can use these tools:
319
-
320
- - `mcp__ranger__get_product_docs` - Get your product's sitemap and entity documentation
321
- - `mcp__ranger__get_test_suite` - List all tests in your test suite
322
- - `mcp__ranger__get_test_details` - Get details for a specific test
323
- - `mcp__ranger__create_draft_test` - Create a new draft test
324
- - `mcp__ranger__generate_test_plan` - Generate a test plan with steps
325
-
326
- ### 2. Browser Tools (after `ranger add env`)
327
-
328
- Once you add an environment, Claude Code can interact with your app via browser:
329
-
330
- - `mcp__ranger-browser__browser_navigate` - Navigate to a URL
331
- - `mcp__ranger-browser__browser_snapshot` - Get page accessibility snapshot
332
- - `mcp__ranger-browser__browser_click` - Click an element
333
- - `mcp__ranger-browser__browser_type` - Type text
334
- - `mcp__ranger-browser__browser_fill_form` - Fill form fields
335
- - And more...
336
-
337
- ### 3. Bug Bash Skill
338
-
339
- The **bug-bash** skill explores new features to find bugs. Invoke it in Claude Code:
340
-
341
- ```
342
- /bug-bash
343
- ```
344
-
345
- Or ask Claude to explore your changes:
346
-
347
- > "Explore the new settings page I just built and look for bugs"
348
-
349
- The bug-bash skill will:
350
- 1. Analyze your git diff to understand what changed
351
- 2. Generate exploration ideas based on the changes
352
- 3. Systematically test flows using `ranger verify-in-browser`
353
- 4. Report any issues found with severity levels
354
-
355
- ### 4. E2E Test Recommender Skill
356
-
357
- The **e2e-test-recommender** skill analyzes your code changes and suggests end-to-end tests. Invoke it:
358
-
359
- ```
360
- /e2e-test-recommender
361
- ```
362
-
363
- Or ask Claude:
364
-
365
- > "What e2e tests should I add for my recent changes?"
366
-
367
- ### 5. Direct Browser Verification
368
-
369
- Use the `verify-in-browser` command directly for quick UI checks:
370
-
371
- ```bash
372
- # Verify login works
373
- ranger verify-in-browser \
374
- --url "http://localhost:3000/login" \
375
- --task "Log in with test@example.com / password123, verify dashboard loads"
376
-
377
- # Verify form validation
378
- ranger verify-in-browser \
379
- --url "http://localhost:3000/signup" \
380
- --task "Submit form with empty email, verify error message appears"
381
- ```
382
-
383
- The command returns:
384
- - `success`: Whether the flow completed without issues
385
- - `summary`: Description of what happened
386
- - `issues`: Array of problems found (BLOCKER, MAJOR, MINOR)
387
- - Exit code 0 for success, 1 for issues found
388
-
389
- ## Environment Variables
390
-
391
- | Variable | Description |
392
- |----------|-------------|
393
- | `MCP_SERVER_URL` | Override the default Ranger MCP server URL |
394
- | `ANTHROPIC_API_KEY` | Required for publishing skills to Anthropic API |
395
-
396
289
  ## Example Workflow
397
290
 
398
291
  ```bash
@@ -421,12 +314,8 @@ ranger clean
421
314
 
422
315
  ### "No active environment" error
423
316
 
424
- Run `ranger use <env-name>` to set an active environment before using `verify-in-browser`.
425
-
426
- ### "Ranger Browser MCP not configured" error
427
-
428
- Run `ranger add env <name>` to configure browser access for an environment.
317
+ Run `ranger use <env-name>` to set an active environment.
429
318
 
430
319
  ### Authentication expired
431
320
 
432
- Run `ranger update env <env-name>` to refresh authentication cookies/storage.
321
+ Run `ranger env update <env-name>` to refresh authentication cookies/storage.