greenrun-cli 0.2.0 → 0.2.1

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 (2) hide show
  1. package/README.md +54 -27
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,12 +1,8 @@
1
1
  # greenrun-cli
2
2
 
3
- Browser test management for Claude Code. Connects Claude to the [Greenrun](https://app.greenrun.dev) API via MCP, enabling Claude to run, create, and manage browser tests directly from your terminal.
3
+ Browser test management for Claude Code. Write tests in plain English, and Claude generates and runs Playwright scripts automatically.
4
4
 
5
- ## Prerequisites
6
-
7
- - **Node.js 18+**
8
- - **Claude Code CLI** - [Install guide](https://docs.anthropic.com/en/docs/claude-code)
9
- - **Claude in Chrome extension** - Required for browser test execution. [Install from Chrome Web Store](https://chromewebstore.google.com/detail/claude-in-chrome)
5
+ Greenrun is an [MCP server](https://modelcontextprotocol.io/) that connects Claude Code to the [Greenrun API](https://app.greenrun.dev). You describe what to test, Greenrun handles the rest — script generation, parallel execution, result tracking, and re-running only what's needed.
10
6
 
11
7
  ## Quick Start
12
8
 
@@ -14,47 +10,76 @@ Browser test management for Claude Code. Connects Claude to the [Greenrun](https
14
10
  npx greenrun-cli init
15
11
  ```
16
12
 
17
- This interactive wizard will:
18
- 1. Connect your Greenrun API token
19
- 2. Configure the MCP server for Claude Code
20
- 3. Optionally install slash commands and project instructions
13
+ The setup wizard will:
14
+
15
+ 1. Validate your Greenrun API token
16
+ 2. Configure the Greenrun and Playwright MCP servers for Claude Code
17
+ 3. Install `/greenrun` and `/greenrun-sweep` slash commands
18
+ 4. Add project instructions to your `CLAUDE.md`
19
+ 5. Set up tool permissions so tests run without prompts
20
+
21
+ Get an API token at [app.greenrun.dev/tokens](https://app.greenrun.dev/tokens).
22
+
23
+ ## Prerequisites
24
+
25
+ - **Node.js 18+**
26
+ - **Claude Code** — [install guide](https://docs.anthropic.com/en/docs/claude-code)
27
+ - **Playwright MCP** — configured automatically by `init`
21
28
 
22
29
  ## How It Works
23
30
 
24
- Greenrun CLI is an [MCP server](https://modelcontextprotocol.io/) that gives Claude Code access to the Greenrun API. Combined with the Claude in Chrome extension for browser automation, Claude can execute your browser tests end-to-end.
31
+ 1. **Define tests** in the [dashboard](https://app.greenrun.dev) or via Claude Code using MCP tools
32
+ 2. **Run `/greenrun`** — Claude fetches tests, generates Playwright scripts on first run, then executes them natively
33
+ 3. **Scripts are cached** — subsequent runs skip generation and execute instantly via `npx playwright test`
34
+ 4. **Results are tracked** — pass/fail status, duration, and summaries stored per run
35
+
36
+ ### Script Generation
37
+
38
+ On first run, Claude walks through each test's instructions in the browser (scouting pass), observes UI states, and generates a `.spec.ts` script using real selectors. Scripts are saved to the API and reused on future runs.
39
+
40
+ If a cached script fails, an AI agent re-executes the test manually to determine whether the script is stale or there's a real bug. Stale scripts are automatically cleared for regeneration.
25
41
 
26
- **Flow:** Claude Code -> MCP Server -> Greenrun API -> Test instructions -> Browser automation via Chrome extension
42
+ ### Authentication
43
+
44
+ Projects support named **credential sets** (name, email, password). Each test can reference a credential by name via `credential_name`. During execution, the matching credentials are used to authenticate before running the test.
45
+
46
+ ### Impact Analysis
47
+
48
+ After code changes, run `/greenrun-sweep` to find which tests are affected by the pages you changed. Only the relevant tests are re-run.
27
49
 
28
50
  ## Slash Commands
29
51
 
30
- After setup, two slash commands are available in Claude Code:
52
+ ### `/greenrun [filter]`
31
53
 
32
- ### `/greenrun`
54
+ Run tests for the current project. Supports filters:
33
55
 
34
- Runs all browser tests for the current project. Optionally pass a test name to run a single test.
56
+ - `/greenrun` run all active tests
57
+ - `/greenrun tag:smoke` — run tests tagged "smoke"
58
+ - `/greenrun /checkout` — run tests linked to pages matching "/checkout"
59
+ - `/greenrun login` — run tests with "login" in the name
35
60
 
36
61
  ### `/greenrun-sweep`
37
62
 
38
- Impact analysis - identifies which tests are affected by recent code changes and offers to run them.
63
+ Detect which tests are impacted by recent git changes and offer to run them.
39
64
 
40
65
  ## MCP Tools
41
66
 
42
- The server exposes these tools to Claude:
43
-
44
67
  | Tool | Description |
45
68
  |------|-------------|
46
69
  | `list_projects` | List all projects |
47
- | `create_project` | Create a new project |
70
+ | `create_project` | Create a project (with credentials, auth config) |
48
71
  | `get_project` | Get project details |
72
+ | `update_project` | Update project settings |
49
73
  | `list_pages` | List pages in a project |
50
74
  | `create_page` | Register a page URL |
51
- | `list_tests` | List tests (with latest run status) |
52
- | `get_test` | Get test details and instructions |
53
- | `create_test` | Create a new test case |
54
- | `update_test` | Update test instructions or status |
75
+ | `list_tests` | List tests with latest run status |
76
+ | `get_test` | Get full test details and instructions |
77
+ | `create_test` | Create a test (with credential_name, tags, pages) |
78
+ | `update_test` | Update test (auto-invalidates script on content change) |
79
+ | `prepare_test_batch` | Fetch, filter, and start runs for a batch of tests |
55
80
  | `sweep` | Find tests affected by specific pages |
56
81
  | `start_run` | Start a test run |
57
- | `complete_run` | Record test run result |
82
+ | `complete_run` | Record test result |
58
83
  | `get_run` | Get run details |
59
84
  | `list_runs` | List run history |
60
85
 
@@ -63,7 +88,8 @@ The server exposes these tools to Claude:
63
88
  If you prefer to configure manually instead of using `init`:
64
89
 
65
90
  ```bash
66
- claude mcp add --transport stdio -e GREENRUN_API_TOKEN=your_token greenrun -- npx -y greenrun-cli@latest
91
+ claude mcp add greenrun --transport stdio -e GREENRUN_API_TOKEN=your_token -- npx -y greenrun-cli@latest
92
+ claude mcp add playwright -- npx @playwright/mcp@latest --browser chrome --user-data-dir ~/.greenrun/browser-profile
67
93
  ```
68
94
 
69
95
  Or add to your project's `.mcp.json`:
@@ -80,11 +106,12 @@ Or add to your project's `.mcp.json`:
80
106
  }
81
107
  ```
82
108
 
83
- ## CLI Usage
109
+ ## CLI Commands
84
110
 
85
111
  ```
86
112
  greenrun init Interactive setup wizard
87
- greenrun serve Start MCP server explicitly
113
+ greenrun update Update templates and commands to latest version
114
+ greenrun serve Start MCP server directly
88
115
  greenrun --version Print version
89
116
  greenrun --help Print help
90
117
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "greenrun-cli",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "CLI and MCP server for Greenrun - browser test management for Claude Code",
5
5
  "type": "module",
6
6
  "main": "dist/server.js",