greenrun-cli 0.1.2 → 0.1.4

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/dist/cli.js CHANGED
@@ -15,6 +15,7 @@ function printHelp() {
15
15
 
16
16
  Usage:
17
17
  greenrun init Interactive setup wizard
18
+ greenrun update Update command templates to latest version
18
19
  greenrun serve Start MCP server
19
20
  greenrun --version, -v Print version
20
21
  greenrun --help, -h Print this help
@@ -42,6 +43,11 @@ async function main() {
42
43
  await runInit(args.slice(1));
43
44
  return;
44
45
  }
46
+ if (command === 'update') {
47
+ const { runUpdate } = await import('./commands/init.js');
48
+ runUpdate();
49
+ return;
50
+ }
45
51
  if (command === 'serve') {
46
52
  const { startServer } = await import('./server.js');
47
53
  await startServer();
@@ -1 +1,2 @@
1
+ export declare function runUpdate(): void;
1
2
  export declare function runInit(args: string[]): Promise<void>;
@@ -153,6 +153,12 @@ function installCommands() {
153
153
  console.log(` Installed /${cmd.replace('.md', '')}`);
154
154
  }
155
155
  }
156
+ export function runUpdate() {
157
+ console.log('\nGreenrun - Updating templates\n');
158
+ installCommands();
159
+ installClaudeMd();
160
+ console.log('\nDone! Templates updated to latest version.\n');
161
+ }
156
162
  export async function runInit(args) {
157
163
  const opts = parseFlags(args);
158
164
  const interactive = !opts.token;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "greenrun-cli",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
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",
@@ -40,7 +40,7 @@ Ask the user if they want to run the affected tests. If yes, execute them **in p
40
40
 
41
41
  Use the project's `concurrency` setting (default: 5) to determine batch size. Split affected tests into batches and launch each batch simultaneously using the **Task tool** with `run_in_background: true`.
42
42
 
43
- For each test in a batch, launch a background agent with this prompt:
43
+ For each test in a batch, launch a background agent with `max_turns: 30` and `model: "sonnet"`. Use this prompt:
44
44
 
45
45
  ```
46
46
  You are executing a single Greenrun browser test. You have access to browser automation tools and Greenrun MCP tools.
@@ -50,14 +50,19 @@ You are executing a single Greenrun browser test. You have access to browser aut
50
50
  Step 1: Call `get_test` with test_id "{test_id}" to get full instructions.
51
51
  Step 2: Call `start_run` with test_id "{test_id}" to begin - save the returned `run_id`.
52
52
  Step 3: Execute the test instructions using browser automation:
53
- - Create a new browser tab for this test
53
+ - Call `tabs_context_mcp` then create a new browser tab for this test
54
54
  - Follow each instruction step exactly as written
55
55
  - The instructions will tell you where to navigate and what to do
56
- - Observe results and take screenshots as needed for verification
56
+ - Only take a screenshot when you need to verify a visual assertion — not for every navigation or click
57
+ - When reading page content, prefer `find` or `read_page` with `filter: "interactive"` over full DOM reads
58
+ - NEVER trigger JavaScript alerts, confirms, or prompts — they block the browser extension entirely. Before clicking delete buttons or other destructive actions, use `javascript_tool` to override: `window.alert = () => {}; window.confirm = () => true; window.prompt = () => null;`
59
+ - If browser tools stop responding (no result or timeout), assume a dialog is blocking — report the error and stop. Do not keep retrying.
60
+ - If you get stuck or a step fails, record the failure and move on — do not retry more than once
57
61
  Step 4: Call `complete_run` with:
58
62
  - run_id: the run ID from step 2
59
63
  - status: "passed" if all checks succeeded, "failed" if any check failed, "error" if execution was blocked
60
- - result: a brief summary of what happened
64
+ - result: a brief summary of what happened (include the failure reason if failed/error)
65
+ Step 5: Close the browser tab you created to clean up.
61
66
 
62
67
  Return a single line summary: {test_name} | {status} | {result_summary}
63
68
  ```
@@ -33,6 +33,8 @@ For each batch, launch all tests simultaneously using the **Task tool** with `ru
33
33
  For each test in the current batch, call the Task tool with:
34
34
  - subagent_type: "general-purpose"
35
35
  - run_in_background: true
36
+ - max_turns: 30
37
+ - model: "sonnet"
36
38
  - prompt: (see below)
37
39
  ```
38
40
 
@@ -46,14 +48,19 @@ You are executing a single Greenrun browser test. You have access to browser aut
46
48
  Step 1: Call `get_test` with test_id "{test_id}" to get full instructions.
47
49
  Step 2: Call `start_run` with test_id "{test_id}" to begin - save the returned `run_id`.
48
50
  Step 3: Execute the test instructions using browser automation:
49
- - Create a new browser tab for this test
51
+ - Call `tabs_context_mcp` then create a new browser tab for this test
50
52
  - Follow each instruction step exactly as written
51
53
  - The instructions will tell you where to navigate and what to do
52
- - Observe results and take screenshots as needed for verification
54
+ - Only take a screenshot when you need to verify a visual assertion — not for every navigation or click
55
+ - When reading page content, prefer `find` or `read_page` with `filter: "interactive"` over full DOM reads
56
+ - NEVER trigger JavaScript alerts, confirms, or prompts — they block the browser extension entirely. Before clicking delete buttons or other destructive actions, use `javascript_tool` to override: `window.alert = () => {}; window.confirm = () => true; window.prompt = () => null;`
57
+ - If browser tools stop responding (no result or timeout), assume a dialog is blocking — report the error and stop. Do not keep retrying.
58
+ - If you get stuck or a step fails, record the failure and move on — do not retry more than once
53
59
  Step 4: Call `complete_run` with:
54
60
  - run_id: the run ID from step 2
55
61
  - status: "passed" if all checks succeeded, "failed" if any check failed, "error" if execution was blocked
56
- - result: a brief summary of what happened
62
+ - result: a brief summary of what happened (include the failure reason if failed/error)
63
+ Step 5: Close the browser tab you created to clean up.
57
64
 
58
65
  Return a single line summary: {test_name} | {status} | {result_summary}
59
66
  ```