explorbot 0.2.3 → 0.2.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.
Files changed (156) hide show
  1. package/README.md +1 -1
  2. package/bin/explorbot-cli.ts +7 -1
  3. package/boat/api-tester/src/config.ts +4 -2
  4. package/boat/doc-collector/bin/doc-collector-cli.ts +2 -0
  5. package/boat/doc-collector/src/ai/documentarian.ts +61 -31
  6. package/boat/doc-collector/src/config.ts +4 -2
  7. package/boat/prima/bin/prima-cli.ts +0 -0
  8. package/boat/prima/src/activity-line.ts +33 -0
  9. package/boat/prima/src/cli.ts +115 -86
  10. package/boat/prima/src/envelope.ts +80 -52
  11. package/boat/prima/src/prima.ts +547 -128
  12. package/boat/prima/src/pw-parser.ts +11 -1
  13. package/boat/prima/src/pw-registry.ts +4 -5
  14. package/boat/prima/src/session-log.ts +126 -0
  15. package/dist/bin/explorbot-cli.js +7 -1
  16. package/dist/boat/api-tester/bin/apibot-cli.js +2 -0
  17. package/dist/boat/api-tester/src/config.js +4 -2
  18. package/dist/boat/doc-collector/bin/doc-collector-cli.js +2 -0
  19. package/dist/boat/doc-collector/src/ai/documentarian.js +44 -19
  20. package/dist/boat/doc-collector/src/config.js +4 -2
  21. package/dist/boat/prima/src/activity-line.js +30 -0
  22. package/dist/boat/prima/src/cli.js +97 -77
  23. package/dist/boat/prima/src/envelope.js +70 -44
  24. package/dist/boat/prima/src/prima.js +515 -119
  25. package/dist/boat/prima/src/pw-parser.js +13 -1
  26. package/dist/boat/prima/src/pw-registry.js +4 -5
  27. package/dist/boat/prima/src/session-log.js +108 -0
  28. package/dist/package.json +3 -2
  29. package/dist/rules/navigator/verification-actions.md +20 -0
  30. package/dist/src/action-result.d.ts +7 -0
  31. package/dist/src/action-result.js +4 -0
  32. package/dist/src/action.d.ts +2 -0
  33. package/dist/src/action.js +36 -1
  34. package/dist/src/ai/captain/web-mode.js +6 -3
  35. package/dist/src/ai/captain.js +2 -0
  36. package/dist/src/ai/navigator.d.ts +7 -0
  37. package/dist/src/ai/navigator.js +10 -6
  38. package/dist/src/ai/pilot.d.ts +4 -0
  39. package/dist/src/ai/pilot.js +48 -2
  40. package/dist/src/ai/provider.js +2 -2
  41. package/dist/src/ai/rerunner.js +2 -1
  42. package/dist/src/ai/researcher.js +1 -1
  43. package/dist/src/ai/rules.js +17 -10
  44. package/dist/src/ai/task-agent.js +4 -1
  45. package/dist/src/ai/tester.d.ts +1 -1
  46. package/dist/src/ai/tester.js +33 -33
  47. package/dist/src/ai/tools.d.ts +14 -0
  48. package/dist/src/ai/tools.js +113 -36
  49. package/dist/src/config.d.ts +1 -0
  50. package/dist/src/config.js +13 -4
  51. package/dist/src/execution-controller.d.ts +2 -0
  52. package/dist/src/execution-controller.js +6 -0
  53. package/dist/src/explorbot.d.ts +2 -1
  54. package/dist/src/explorbot.js +3 -1
  55. package/dist/src/explorer.js +2 -3
  56. package/dist/src/playwright-recorder.js +30 -0
  57. package/dist/src/remote.d.ts +54 -0
  58. package/dist/src/remote.js +229 -0
  59. package/dist/src/reporter.d.ts +1 -0
  60. package/dist/src/reporter.js +7 -1
  61. package/dist/src/state-manager.d.ts +2 -1
  62. package/dist/src/stats.d.ts +1 -0
  63. package/dist/src/stats.js +1 -0
  64. package/dist/src/test-plan.d.ts +2 -0
  65. package/dist/src/test-plan.js +7 -0
  66. package/dist/src/utils/aria.d.ts +2 -8
  67. package/dist/src/utils/aria.js +69 -40
  68. package/dist/src/utils/html.js +1 -0
  69. package/dist/src/utils/logger.d.ts +6 -0
  70. package/dist/src/utils/logger.js +24 -0
  71. package/dist/src/utils/page-readiness.js +18 -1
  72. package/dist/src/utils/url-matcher.js +3 -0
  73. package/dist/src/utils/web-element.d.ts +2 -0
  74. package/dist/src/utils/web-element.js +8 -0
  75. package/dist/src/utils/web-sandbox.d.ts +1 -1
  76. package/dist/src/utils/web-sandbox.js +2 -3
  77. package/docs/api-testing/basics.md +90 -0
  78. package/docs/api-testing/planning.md +57 -0
  79. package/docs/api-testing/running-tests.md +55 -0
  80. package/docs/assets/cloud-report.png +0 -0
  81. package/docs/assets/html-report.png +0 -0
  82. package/docs/assets/langfuse-trace.png +0 -0
  83. package/docs/assets/successful-explore-run.png +0 -0
  84. package/docs/basics/getting-started.md +140 -0
  85. package/docs/basics/prerequisites.md +63 -0
  86. package/docs/basics/providers.md +362 -0
  87. package/docs/basics/running.md +78 -0
  88. package/docs/contributing/ai-integration-tests.md +57 -0
  89. package/docs/contributing/contributing.md +90 -0
  90. package/docs/contributing/demo-videos.md +36 -0
  91. package/docs/contributing/npm-package.md +138 -0
  92. package/docs/contributing/observability.md +227 -0
  93. package/docs/contributing/regression-tests.md +103 -0
  94. package/docs/contributing/testing.md +95 -0
  95. package/docs/doc-collection/basics.md +128 -0
  96. package/docs/doc-collection/crawling.md +67 -0
  97. package/docs/doc-collection/interactive-mode.md +99 -0
  98. package/docs/index.json +86 -0
  99. package/docs/reference/commands.md +994 -0
  100. package/docs/reference/configuration.md +569 -0
  101. package/docs/reference/scripting.md +303 -0
  102. package/docs/superpowers/plans/2026-08-01-actor-boat.md +925 -0
  103. package/docs/superpowers/plans/2026-08-01-prima-boat.md +1120 -0
  104. package/docs/superpowers/reviews/2026-08-06-prima-vs-playwright-cli.md +268 -0
  105. package/docs/superpowers/specs/2026-08-01-actor-boat-design.md +204 -0
  106. package/docs/superpowers/specs/2026-08-01-prima-boat-design.md +242 -0
  107. package/docs/superpowers/specs/2026-08-03-global-config-design.md +138 -0
  108. package/docs/superpowers/specs/2026-08-07-prima-fixes-design.md +394 -0
  109. package/docs/web-testing/agents.md +158 -0
  110. package/docs/web-testing/automated-tests.md +134 -0
  111. package/docs/web-testing/basics.md +91 -0
  112. package/docs/web-testing/customization.md +131 -0
  113. package/docs/web-testing/hooks.md +238 -0
  114. package/docs/web-testing/page-interaction.md +84 -0
  115. package/docs/web-testing/planner.md +122 -0
  116. package/docs/web-testing/rerun.md +164 -0
  117. package/docs/web-testing/researcher.md +380 -0
  118. package/docs/workflow/agentic-usage.md +233 -0
  119. package/docs/workflow/application-spec.md +73 -0
  120. package/docs/workflow/ci.md +202 -0
  121. package/docs/workflow/knowledge.md +310 -0
  122. package/docs/workflow/planning-styles.md +67 -0
  123. package/docs/workflow/reporting.md +133 -0
  124. package/docs/workflow/test-plans.md +90 -0
  125. package/package.json +3 -2
  126. package/rules/navigator/verification-actions.md +20 -0
  127. package/src/action-result.ts +11 -0
  128. package/src/action.ts +38 -2
  129. package/src/ai/captain/web-mode.ts +6 -3
  130. package/src/ai/captain.ts +3 -0
  131. package/src/ai/navigator.ts +14 -8
  132. package/src/ai/pilot.ts +53 -2
  133. package/src/ai/provider.ts +2 -4
  134. package/src/ai/rerunner.ts +2 -1
  135. package/src/ai/researcher.ts +1 -1
  136. package/src/ai/rules.ts +17 -10
  137. package/src/ai/task-agent.ts +3 -1
  138. package/src/ai/tester.ts +32 -33
  139. package/src/ai/tools.ts +132 -36
  140. package/src/config.ts +15 -4
  141. package/src/execution-controller.ts +8 -0
  142. package/src/explorbot.ts +4 -2
  143. package/src/explorer.ts +2 -2
  144. package/src/playwright-recorder.ts +23 -0
  145. package/src/remote.ts +238 -0
  146. package/src/reporter.ts +7 -1
  147. package/src/state-manager.ts +2 -1
  148. package/src/stats.ts +1 -0
  149. package/src/test-plan.ts +9 -0
  150. package/src/utils/aria.ts +65 -45
  151. package/src/utils/html.ts +1 -0
  152. package/src/utils/logger.ts +24 -1
  153. package/src/utils/page-readiness.ts +24 -1
  154. package/src/utils/url-matcher.ts +3 -0
  155. package/src/utils/web-element.ts +9 -0
  156. package/src/utils/web-sandbox.ts +3 -4
@@ -0,0 +1,140 @@
1
+ # Getting Started
2
+
3
+ Explorbot explores your web app, plans tests, and runs them — no test scripts. This guide gets you from zero to your first test in about ten minutes.
4
+
5
+ The path is short: install, configure, tell it how to log in, then point it at one feature and let it work.
6
+
7
+ ## 1. Install
8
+
9
+ ```bash
10
+ npm i explorbot --save
11
+ npx playwright install
12
+ ```
13
+
14
+ You need Node.js 24+ (or Bun), an AI provider key, and a modern terminal — iTerm2, WARP, Kitty, Ghostty, or Windows Terminal with WSL. For the full compatibility checklist, see [Prerequisites](./prerequisites.md).
15
+
16
+ ## 2. Configure
17
+
18
+ Create the config files:
19
+
20
+ ```bash
21
+ npx explorbot init
22
+ ```
23
+
24
+ This writes `explorbot.config.js`, an `.env` file for your keys, and an `output/` folder.
25
+
26
+ Open `.env` and add your provider key:
27
+
28
+ ```bash
29
+ OPENROUTER_API_KEY=sk-...
30
+ ```
31
+
32
+ Then open `explorbot.config.js` and set your app's base URL — the host only, no path:
33
+
34
+ ```javascript
35
+ import { createOpenRouter } from '@openrouter/ai-sdk-provider';
36
+
37
+ const openrouter = createOpenRouter({
38
+ apiKey: process.env.OPENROUTER_API_KEY,
39
+ });
40
+
41
+ export default {
42
+ web: {
43
+ url: 'http://localhost:3000',
44
+ },
45
+ ai: {
46
+ model: openrouter('openai/gpt-oss-20b:nitro'),
47
+ visionModel: openrouter('google/gemma-4-31b-it'),
48
+ agenticModel: openrouter('minimax/minimax-m2.5:nitro'),
49
+ },
50
+ };
51
+ ```
52
+
53
+ Explorbot uses three models. Pick each one for speed and cost:
54
+
55
+ | Model | Config key | Used by | Pick |
56
+ |-------|-----------|---------|------|
57
+ | `model` | `ai.model` | Tester, Navigator, Researcher — they read HTML and ARIA on every step | a fast, cheap model (e.g. `openai/gpt-oss-20b:nitro`) |
58
+ | `visionModel` | `ai.visionModel` | screenshot analysis | a vision model (e.g. `google/gemma-4-31b-it`) |
59
+ | `agenticModel` | `ai.agenticModel` | Captain and Pilot — they read short action logs and make the big decisions | a smarter model (e.g. MiniMax 2.5, Grok Fast) |
60
+
61
+ Captain and Pilot barely use tokens, so a smarter `agenticModel` improves results for almost no extra cost. OpenRouter is the simplest start — one key, many models. To use OpenAI, Anthropic, Groq, or others, see [Providers](./providers.md). For every config option, see [Configuration](../reference/configuration.md).
62
+
63
+ ## 3. Tell Explorbot how to log in
64
+
65
+ Most apps need a login. Give Explorbot the credentials once, and it signs in on its own:
66
+
67
+ ```bash
68
+ npx explorbot learn "/login" "Use credentials: admin@example.com / secret123"
69
+ ```
70
+
71
+ This saves a knowledge file under `knowledge/`. Explorbot reads it whenever it opens the login page. Use `*` as the URL pattern for knowledge that applies to every page.
72
+
73
+ To skip the login on later runs, add `--session`. Explorbot logs in once and restores the saved cookies next time:
74
+
75
+ ```bash
76
+ npx explorbot start /login --session # logs in, saves the session
77
+ npx explorbot start /dashboard --session # restores it, skips login
78
+ ```
79
+
80
+ Keep real secrets in environment variables, and handle cookie banners, modals, and test data the same way — see [Customization](../web-testing/customization.md).
81
+
82
+ ## 4. Pick one feature to test
83
+
84
+ Don't point Explorbot at your homepage. Start it on a single focused feature — a page with a clear, visible CRUD interface it can work with. Good first targets:
85
+
86
+ - `/admin/projects`
87
+ - `/posts`
88
+ - `/admin/users`
89
+ - any list-and-edit or settings page
90
+
91
+ A page where you can create, edit, and delete items gives Explorbot an obvious job and a clear way to tell whether it worked.
92
+
93
+ ## 5. Run
94
+
95
+ ```bash
96
+ npx explorbot start /admin/projects
97
+ ```
98
+
99
+ The browser runs hidden by default. Add `--show` to watch it:
100
+
101
+ ```bash
102
+ npx explorbot start /admin/projects --show
103
+ ```
104
+
105
+ When the terminal UI opens, type `/explore`. Explorbot researches the page, plans tests, runs them, and repeats. To go one step at a time:
106
+
107
+ > [!WARNING]
108
+ > Run your first `/explore` against staging, a disposable workspace, or another isolated environment with non-production data. Explorbot can create, edit, and delete records while testing. Make sure the data is safe to change and easy to restore.
109
+
110
+ ```
111
+ /research # analyze the current page
112
+ /plan # propose test scenarios
113
+ /test # run the next test
114
+ ```
115
+
116
+ ### What a successful run looks like
117
+
118
+ A completed exploration shows the test totals, a session analysis, the covered features, and any execution issues that need review:
119
+
120
+ ![Successful Explorbot run with two completed tests](../assets/successful-explore-run.png)
121
+
122
+ ## The concepts
123
+
124
+ You have now touched everything Explorbot is built on. Here is the whole vocabulary, once:
125
+
126
+ - **State** — where the bot is: the page URL plus its main headings (`h1`, `h2`). States anchor navigation, learning, and loop detection.
127
+ - **Research** — reading a page. The Researcher agent maps forms, buttons, tables, and navigation into a UI map the other agents work from. Saved under `output/research/`. See [Researcher](../web-testing/researcher.md).
128
+ - **Plan** — test scenarios invented from research, with priorities and expected outcomes. Markdown you can read and edit, in `output/plans/`. See [Test plans](../workflow/test-plans.md).
129
+ - **Test** — one scenario executed step by step in the real browser. Passing tests are saved as runnable Playwright or CodeceptJS code in `output/tests/`. See [Automated tests](../web-testing/automated-tests.md).
130
+ - **Knowledge** — facts you teach Explorbot: credentials, quirks, hints. Markdown files in `knowledge/`, matched to pages by URL — you wrote your first one in step 3. See [Knowledge](../workflow/knowledge.md).
131
+ - **Experience** — what Explorbot learns by doing: failed attempts and the fixes that worked, saved in `experience/` and reused on every later run. Knowledge you write; experience it earns. See [Learning](../web-testing/basics.md#learning).
132
+ - **Agents** — the AI workers behind each step: Researcher, Planner, Tester, Pilot, and more, each with its own job and model. See [Agents](../web-testing/agents.md).
133
+ - **Report** — the end-of-session summary of defects, UX findings, and coverage in `output/reports/`. See [Reporting](../workflow/reporting.md).
134
+
135
+ ## Next steps
136
+
137
+ - [Running Explorbot](./running.md) — the TUI you just used, the headless CLI, and when to use each.
138
+ - [Customization](../web-testing/customization.md) — login, cookie bars, modals, and test data.
139
+ - [Commands](../reference/commands.md) — every command, in the terminal and on the CLI.
140
+ - [Knowledge](../workflow/knowledge.md) — teach Explorbot more about your app.
@@ -0,0 +1,63 @@
1
+ # Application prerequisites
2
+
3
+ ## Security
4
+
5
+ Give Explorbot an isolated environment that can never touch production data. This is your responsibility.
6
+
7
+ Explorbot logs in with a user session and predefined credentials. Give that user limited permissions so it cannot harm the environment.
8
+
9
+ Do not put real sensitive data in that environment. Explorbot has no secret redaction: anything the browser sees can end up in logs, AI prompts, and saved artifacts. Use disposable test data.
10
+
11
+ Explorbot runs with few privileges. Explorbot cannot:
12
+
13
+ - read or write local files (except the Captain agent, and only in the `knowledge/`, `experience/`, and `output/` folders)
14
+ - fetch content from external websites (it stays on the configured site)
15
+ - run Bash or CLI tools like `git` or `rm -rf` (except the Captain agent, for a limited set of actions)
16
+
17
+ Explorbot follows a predefined script and a plan. It does not act on its own. Its main actions are web and API requests, which you should restrict.
18
+
19
+ Run Explorbot on local, dev, or staging environments. You can still run it on production for regression testing, as long as its user has narrow access and works in a single project or workspace.
20
+
21
+ ## Data management
22
+
23
+ Run Explorbot against an isolated workspace: a separate project inside your app, a staging environment, or similar. Pre-populate it with data. Explorbot reads that data to learn what the application does and proposes more meaningful tests.
24
+
25
+ Explorbot can change or delete data through the web interface. Make sure you can reload that data if something breaks.
26
+
27
+ To prepare:
28
+
29
+ - Add a dataset to the pages Explorbot will visit, so it learns the app faster.
30
+ - Keep that data non-critical and easy to restore.
31
+
32
+ Explorbot works best on CRUD-heavy web applications:
33
+
34
+ - SaaS platforms
35
+ - ecommerce
36
+ - ERP
37
+ - admin panels
38
+ - internal tools
39
+
40
+ It is not a good fit for landing pages, blogs, CMS, or static sites.
41
+
42
+ ## Page management
43
+
44
+ Explorbot uses URLs as anchor points when it navigates. Each change in the URL or the `h1`/`h2` headings creates a new state. This is how Explorbot tracks where it is and analyzes each transition. The `title` and `h3`/`h4` headings are captured too, but they do not define state identity.
45
+
46
+ If your app does not change the URL on navigation, or skips `h1`/`h2` headings, navigation gets harder. Use URLs to identify your application states.
47
+
48
+ Set edge cases and domain rules in [Knowledge files](../workflow/knowledge.md). These attach to page URLs.
49
+
50
+ ## Web elements
51
+
52
+ Explorbot identifies elements through HTML, ARIA, and the screenshot. When one strategy fails, another usually works.
53
+
54
+ Avoid long scrolling pages. They make visual identification harder.
55
+
56
+ Explorbot reads ARIA attributes first, then falls back to HTML when ARIA elements are empty. An ARIA tree like this still works:
57
+
58
+ ```
59
+ - role: button
60
+ text:
61
+ ```
62
+
63
+ Following A11y standards across your site improves results. Explorbot makes fewer failed attempts on common elements.
@@ -0,0 +1,362 @@
1
+ # AI Provider Configuration
2
+
3
+ Explorbot connects to AI providers through the [Vercel AI SDK](https://sdk.vercel.ai/). Use any supported provider, and mix providers across different models.
4
+
5
+ > The `export default` config block inside each `<!-- START/END provider -->` marker is generated from [`models.json`](../../models.json). After editing that file, run `bunosh docs:sync`. Everything else — including the import blocks — is hand-written.
6
+
7
+ ## Requirements
8
+
9
+ Your model must support:
10
+ - Structured output (JSON mode)
11
+ - Tool use (function calling)
12
+
13
+ To analyze screenshots, you also need a vision-capable model.
14
+
15
+ Explorbot uses three roles:
16
+
17
+ - `model` for token-heavy page reading of ARIA & HTMLs (cheap & fast).
18
+ - `visionModel` for screenshot analysis
19
+ - `agenticModel` as advisor and planner.
20
+
21
+ Pick a fast, cheap model for the first two and a stronger one for the third. When a provider has no recommended model for one of these roles, combine it with another provider for that role.
22
+
23
+ ### OpenRouter
24
+
25
+ Start with OpenRouter. One key reaches [many providers and models](https://openrouter.ai/models).
26
+ Openrouter is an optimal solution as you can balance the models and provider for best price and speed.
27
+ So if your goal is to optimize costs, choose Openrouter.
28
+
29
+ > Openrouter is recommended to start as it serves best models
30
+
31
+ Install the provider package:
32
+
33
+ ```bash
34
+ npm i @openrouter/ai-sdk-provider
35
+ ```
36
+
37
+ Import it inside `explorbot.config.ts` and create the client from your API key:
38
+
39
+ ```javascript
40
+ import { createOpenRouter } from '@openrouter/ai-sdk-provider';
41
+
42
+ const openrouter = createOpenRouter({
43
+ apiKey: process.env.OPENROUTER_API_KEY,
44
+ });
45
+ ```
46
+
47
+ Set the recommended models in the exported config:
48
+
49
+ <!-- START provider:openrouter -->
50
+ ```javascript
51
+ export default {
52
+ ai: {
53
+ model: openrouter('openai/gpt-oss-20b:nitro'),
54
+ visionModel: openrouter('google/gemma-4-31b-it:nitro'),
55
+ agenticModel: openrouter('google/gemma-4-31b-it:nitro'),
56
+ },
57
+ };
58
+ ```
59
+ <!-- END provider:openrouter -->
60
+
61
+ Pick model IDs from [OpenRouter](https://openrouter.ai/) that support structured output and tools. The `:nitro` variants route to the fastest available host.
62
+
63
+ ### Groq
64
+
65
+ Install the provider package:
66
+
67
+ ```bash
68
+ npm i @ai-sdk/groq
69
+ ```
70
+
71
+ Import it inside `explorbot.config.ts` and create the client from your API key:
72
+
73
+ ```javascript
74
+ import { createGroq } from '@ai-sdk/groq';
75
+
76
+ const groq = createGroq({
77
+ apiKey: process.env.GROQ_API_KEY,
78
+ });
79
+ ```
80
+
81
+ Set the recommended models in the exported config:
82
+
83
+ <!-- START provider:groq -->
84
+ ```javascript
85
+ export default {
86
+ ai: {
87
+ model: groq('openai/gpt-oss-20b'),
88
+ visionModel: groq('qwen/qwen3.6-27b'),
89
+ agenticModel: groq('qwen/qwen3.6-27b'),
90
+ },
91
+ };
92
+ ```
93
+ <!-- END provider:groq -->
94
+
95
+ The gpt-oss models are fast and cheap; the larger 120B handles the agenticModel role.
96
+
97
+ ### OpenAI
98
+
99
+ Install the provider package:
100
+
101
+ ```bash
102
+ npm i @ai-sdk/openai
103
+ ```
104
+
105
+ Import it inside `explorbot.config.ts` and create the client from your API key:
106
+
107
+ ```javascript
108
+ import { createOpenAI } from '@ai-sdk/openai';
109
+
110
+ const openai = createOpenAI({
111
+ apiKey: process.env.OPENAI_API_KEY,
112
+ });
113
+ ```
114
+
115
+ Set the recommended models in the exported config:
116
+
117
+ <!-- START provider:openai -->
118
+ ```javascript
119
+ export default {
120
+ ai: {
121
+ model: openai('gpt-5.4-nano'),
122
+ visionModel: openai('gpt-5.4-nano'),
123
+ agenticModel: openai('gpt-5.6-luna'),
124
+ },
125
+ };
126
+ ```
127
+ <!-- END provider:openai -->
128
+
129
+ ### Anthropic
130
+
131
+ Claude Haiku is the only Anthropic model suited to Explorbot, and even it is too costly per token for the token-heavy roles, so we recommend it only for the low-volume agenticModel. Use a cheaper provider for `model` and `visionModel` (see [Multi-Provider Configuration](#multi-provider-configuration)).
132
+
133
+ Install the provider package:
134
+
135
+ ```bash
136
+ npm i @ai-sdk/anthropic
137
+ ```
138
+
139
+ Import it inside `explorbot.config.ts` and create the client from your API key:
140
+
141
+ ```javascript
142
+ import { createAnthropic } from '@ai-sdk/anthropic';
143
+
144
+ const anthropic = createAnthropic({
145
+ apiKey: process.env.ANTHROPIC_API_KEY,
146
+ });
147
+ ```
148
+
149
+ Set the recommended model in the exported config:
150
+
151
+ <!-- START provider:anthropic -->
152
+ ```javascript
153
+ export default {
154
+ ai: {
155
+ agenticModel: anthropic('claude-haiku-4-5-20251001'),
156
+ },
157
+ };
158
+ ```
159
+
160
+ > [!NOTE]
161
+ > This provider currently doesn't serve `model` and `visionModel`, which is required for Explorbot to run at optimal cost and speed.
162
+ > It is recommended to pair it with another AI provider.
163
+ <!-- END provider:anthropic -->
164
+
165
+ ### Azure OpenAI
166
+
167
+ Install the provider package:
168
+
169
+ ```bash
170
+ npm i @ai-sdk/azure
171
+ ```
172
+
173
+ Import it inside `explorbot.config.ts` and create the client from your resource name and API key:
174
+
175
+ ```javascript
176
+ import { createAzure } from '@ai-sdk/azure';
177
+
178
+ const azure = createAzure({
179
+ resourceName: process.env.AZURE_RESOURCE_NAME,
180
+ apiKey: process.env.AZURE_API_KEY,
181
+ });
182
+ ```
183
+
184
+ Set the models in the exported config, using the deployment names you created in your resource:
185
+
186
+ ```javascript
187
+ export default {
188
+ ai: {
189
+ model: azure('your-deployment-name'),
190
+ visionModel: azure('your-deployment-name'),
191
+ agenticModel: azure('your-deployment-name'),
192
+ },
193
+ };
194
+ ```
195
+
196
+ Azure addresses models by the deployment names you create in your resource, not by public model IDs. Use separate deployments if chat and vision run on different endpoints.
197
+
198
+ ### Google (Gemini)
199
+
200
+ An API key from [Google AI Studio](https://aistudio.google.com/apikey) already has the Gemini API enabled. A key from the Google Cloud console may need the API enabled first, and service-account (Vertex Express) keys use a different API surface than the one this provider targets.
201
+
202
+ Install the provider package:
203
+
204
+ ```bash
205
+ npm i @ai-sdk/google
206
+ ```
207
+
208
+ Import it inside `explorbot.config.ts` and create the client from your API key:
209
+
210
+ ```javascript
211
+ import { createGoogleGenerativeAI } from '@ai-sdk/google';
212
+
213
+ const google = createGoogleGenerativeAI({
214
+ apiKey: process.env.GOOGLE_API_KEY,
215
+ });
216
+ ```
217
+
218
+ Set the recommended models in the exported config:
219
+
220
+ <!-- START provider:google -->
221
+ ```javascript
222
+ export default {
223
+ ai: {
224
+ model: google('gemini-3.1-flash-lite'),
225
+ visionModel: google('gemini-3.1-flash-lite'),
226
+ agenticModel: google('gemini-3.5-flash'),
227
+ },
228
+ };
229
+ ```
230
+ <!-- END provider:google -->
231
+
232
+ The flash-lite tier is the cheapest current option for the token-heavy `model` and `visionModel` roles; the full flash is stronger for the low-volume `agenticModel`.
233
+
234
+ On a free (no-billing) key the `agenticModel` is heavily rate-limited and will fail with quota errors mid-session — keep every role on the flash-lite model or enable billing. Google also retires older models for new accounts: `gemini-2.5-flash` and `gemini-2.5-flash-lite` return a 404 for keys created after their cutoff, and enabling billing does not bring them back.
235
+
236
+ Note: Gemini models are slower than hosted OSS models on Groq or Cerebras. Everything works, sessions just take more wall-clock time.
237
+
238
+ ### Mistral
239
+
240
+ Install the provider package:
241
+
242
+ ```bash
243
+ npm i @ai-sdk/mistral
244
+ ```
245
+
246
+ Import it inside `explorbot.config.ts` and create the client from your API key:
247
+
248
+ ```javascript
249
+ import { createMistral } from '@ai-sdk/mistral';
250
+
251
+ const mistral = createMistral({
252
+ apiKey: process.env.MISTRAL_API_KEY,
253
+ });
254
+ ```
255
+
256
+ Set the recommended models in the exported config:
257
+
258
+ <!-- START provider:mistral -->
259
+ ```javascript
260
+ export default {
261
+ ai: {
262
+ model: mistral('mistral-small-latest'),
263
+ visionModel: mistral('mistral-small-latest'),
264
+ agenticModel: mistral('mistral-large-latest'),
265
+ },
266
+ };
267
+ ```
268
+ <!-- END provider:mistral -->
269
+
270
+ Mistral Small covers the token-heavy `model` and `visionModel` roles — it accepts image input, so it can read screenshots. Mistral Large, the larger multimodal flagship, handles the low-volume `agenticModel`. The `-latest` aliases track Mistral's newest release of each, so recommendations keep up as models ship.
271
+
272
+ ### Poolside
273
+
274
+ Poolside serves an OpenAI-compatible endpoint, so it uses the OpenAI provider package with a custom `baseURL`:
275
+
276
+ ```bash
277
+ npm i @ai-sdk/openai
278
+ ```
279
+
280
+ Import it inside `explorbot.config.ts` and point the client at the poolside endpoint:
281
+
282
+ ```javascript
283
+ import { createOpenAI } from '@ai-sdk/openai';
284
+
285
+ const poolside = createOpenAI({
286
+ apiKey: process.env.POOLSIDE_API_KEY,
287
+ baseURL: 'https://inference.poolside.ai/v1',
288
+ });
289
+ ```
290
+
291
+ Set the recommended models in the exported config:
292
+
293
+ <!-- START provider:poolside -->
294
+ ```javascript
295
+ export default {
296
+ ai: {
297
+ model: poolside('poolside/laguna-xs-2.1'),
298
+ },
299
+ };
300
+ ```
301
+
302
+ > [!NOTE]
303
+ > This provider currently doesn't serve `visionModel` and `agenticModel`, which is required for Explorbot to run at optimal cost and speed.
304
+ > It is recommended to pair it with another AI provider.
305
+ <!-- END provider:poolside -->
306
+
307
+ Laguna XS is an agentic coding model — fast, cheap, and reliable at tool calling, which makes it a good fit for the token-heavy `model` role that reads page HTML and drives the browser.
308
+
309
+ Keep `agenticModel` on another provider. Poolside's endpoint accepts `response_format: json_schema` but does not enforce it, so structured-output calls depend on the model volunteering valid JSON. Laguna XS usually does; Laguna S answers in prose instead, which makes it unusable for the Planner, Pilot, and Captain. Laguna S is also slow enough under page-sized prompts to hit Explorbot's request timeouts, so it is not a substitute for Laguna XS in the `model` role either.
310
+
311
+ ## Multi-Provider Configuration
312
+
313
+ Mix clients the same way you assign `model`, `visionModel`, and `agenticModel`. Each field can use a different provider instance — a fast provider does the token-heavy reading while a stronger one makes the decisions:
314
+
315
+ ```javascript
316
+ import { createGroq } from '@ai-sdk/groq';
317
+ import { createOpenRouter } from '@openrouter/ai-sdk-provider';
318
+
319
+ const groq = createGroq({ apiKey: process.env.GROQ_API_KEY });
320
+ const openrouter = createOpenRouter({ apiKey: process.env.OPENROUTER_API_KEY });
321
+
322
+ export default {
323
+ ai: {
324
+ model: groq('openai/gpt-oss-20b'),
325
+ visionModel: groq('meta-llama/llama-4-scout-17b-16e-instruct'),
326
+ agenticModel: openrouter('minimax/minimax-m2.5:nitro'),
327
+ },
328
+ };
329
+ ```
330
+
331
+ ## Per-Agent Model Configuration
332
+
333
+ Any agent can override the defaults. Add an `agents` block and set per-agent options — a different `model` (using any client shown above) or a `reasoning` level:
334
+
335
+ ```javascript
336
+ export default {
337
+ ai: {
338
+ // ...your model, visionModel, agenticModel...
339
+ agents: {
340
+ researcher: { reasoning: 'low' },
341
+ planner: { reasoning: 'none' },
342
+ tester: { reasoning: 'none' },
343
+ },
344
+ },
345
+ };
346
+ ```
347
+
348
+ See [Configuration](../reference/configuration.md) for every per-agent option.
349
+
350
+ ## Environment Variables
351
+
352
+ Set your API key as an environment variable, or use a `.env` file in your project root:
353
+
354
+ ```bash
355
+ export OPENROUTER_API_KEY=your-key-here
356
+ export GROQ_API_KEY=your-key-here
357
+ export CEREBRAS_API_KEY=your-key-here
358
+ export OPENAI_API_KEY=your-key-here
359
+ export ANTHROPIC_API_KEY=your-key-here
360
+ export GOOGLE_API_KEY=your-key-here
361
+ export MISTRAL_API_KEY=your-key-here
362
+ ```
@@ -0,0 +1,78 @@
1
+ # Running Explorbot: TUI and CLI
2
+
3
+ There are two ways to run Explorbot: an interactive terminal UI where you watch and steer, and plain CLI commands that do one job and exit. Same engine, same config, same artifacts — the difference is whether you are in the loop.
4
+
5
+ | Use | Choose it when | Start with |
6
+ |-----|----------------|------------|
7
+ | **TUI** | You are learning, steering, or debugging interactively | `npx explorbot start /path` |
8
+ | **CLI** | You want one repeatable task that prints a result and exits | `npx explorbot explore /path` |
9
+ | **Persistent browser** | You run several local commands and want to avoid starting a new browser process each time | `npx explorbot browser start --show` |
10
+ | **CI** | You need unattended, scheduled, or pipeline runs with saved reports | `npx explorbot explore /path --max-tests 10` |
11
+
12
+ Persistent browser is an optimization for local TUI or CLI work, while CI uses CLI commands. Each command still creates a fresh browser context; use `--session` when cookies and login state must carry over. See [Persistent Browser](../reference/commands.md#persistent-browser) and [Continuous Integration](../workflow/ci.md) for setup details.
13
+
14
+ ## TUI mode
15
+
16
+ `npx explorbot start` opens the interactive terminal UI. Pass a path to start on a specific page:
17
+
18
+ ```bash
19
+ npx explorbot start /admin/projects
20
+ ```
21
+
22
+ The screen splits into a log pane, where everything Explorbot does is printed as it happens, and an input line at the bottom. Type slash-commands to drive it:
23
+
24
+ ```
25
+ /explore # full loop: research, plan, test, repeat
26
+ /research # analyze the current page
27
+ /plan # propose test scenarios
28
+ /test # run the next test
29
+ ```
30
+
31
+ You can also type raw CodeceptJS commands — `I.click('Save')`, `I.amOnPage('/login')` — and they execute in the browser immediately. In interactive mode the bot asks you for help when it gets stuck, instead of giving up.
32
+
33
+ Use the TUI for:
34
+
35
+ - **First runs.** You see every step and every mistake as it happens.
36
+ - **Teaching Explorbot your app.** Watch it fail, add a knowledge file, retry — the tight loop is what the TUI is for.
37
+ - **Debugging a failing scenario.** Replay it step by step with slash-commands and raw `I.*` commands.
38
+
39
+ The TUI needs a modern terminal — iTerm2, WARP, Kitty, Ghostty, or Windows Terminal with WSL; see [Prerequisites](./prerequisites.md) for the compatibility notes.
40
+
41
+ ## CLI mode
42
+
43
+ Every other command runs without the TUI: it launches a browser (headless by default), does its job, prints the result, and exits.
44
+
45
+ | Command | What it does | Docs |
46
+ |---------|--------------|------|
47
+ | `explore <path>` | Research a page, plan tests, run them, move to sub-pages | [Web Testing Basics](../web-testing/basics.md) |
48
+ | `plan <path>` | Generate a test plan as markdown and exit | [Test Plans](../workflow/test-plans.md) |
49
+ | `test <planfile> [index]` | Run tests from a saved plan | [Test Plans](../workflow/test-plans.md) |
50
+ | `rerun <file>` | Re-run generated tests with AI healing | [Rerun](../web-testing/rerun.md) |
51
+ | `docs collect <url>` | Crawl pages and generate documentation | [Doc Collection](../doc-collection/basics.md) |
52
+ | `api plan` / `api test` / `api explore` | Plan and run API tests | [API Testing](../api-testing/basics.md) |
53
+
54
+ The full list, with every option, is in the [Commands reference](../reference/commands.md).
55
+
56
+ ### Exit codes
57
+
58
+ CLI commands follow one rule: exit `0` when the run completed, `1` when the run itself failed — a config error, an unreachable start page, a provider that won't respond. Before exiting, the CLI shows a short session summary if anything happened during the run.
59
+
60
+ For `explore` and `test`, a failing test does **not** change the exit code. The run completed; the failure is a result, printed in the console summary and recorded in the reports. So `npx explorbot explore / || echo broken` catches crashes, not bugs. To gate a pipeline on test results, read the reports — see [Continuous Integration](../workflow/ci.md).
61
+
62
+ A few commands have sharper semantics you can script against:
63
+
64
+ - `plan` exits `1` when no test scenarios could be generated.
65
+ - `navigate <url>` exits `0` when the page was reached, `1` when not — a cheap "is the app up and can we log in" probe.
66
+ - `api test` and `api explore` exit `1` when any test failed.
67
+
68
+ ## Flags that matter in both modes
69
+
70
+ The browser runs headless by default; `--show` opens a visible window and `--headless` forces it hidden. `--session [file]` saves and restores the browser session (cookies, localStorage) — the default file is `output/session.json` — so login happens once and later runs skip it. `--incognito` runs without recording experience, useful for throwaway runs. `--verbose` prints debug logs. See the [Commands reference](../reference/commands.md) for the rest.
71
+
72
+ ## Driving Explorbot from other tools
73
+
74
+ CLI mode makes Explorbot scriptable by anything that can run a shell command — including coding agents like Claude Code. Every input and output is plain markdown: plans land in `output/plans/`, reports in `output/reports/`, and hints live in `knowledge/`. An agent can run `explorbot plan /checkout`, read the generated plan, edit or extend it, run `explorbot test` on it, read the report, then write a knowledge file to fix what confused the bot — and iterate. No API or SDK needed; the files are the interface.
75
+
76
+ ## Running in CI
77
+
78
+ Because CLI commands exit cleanly and keep their learning in cacheable directories, Explorbot fits scheduled pipelines: run `explore` nightly with a test budget, cache `experience/` and `output/` between runs, and upload the reports. See [Continuous Integration](../workflow/ci.md) for worked examples.