Hercules is an open-source QA engine by TestZeus. You write test steps in plain language; Hercules runs them in a real Chromium browser on your machine and tells you whether each step passed, with screenshots and evidence for every step. Language models read the steps and decide what to click; code carries out the actions and checks the results.
It is for developers and testers who want end-to-end tests without writing selectors, and for coding agents that need to check the change they just made in a real browser.
Get started in one line
uvx testzeus-hercules
It asks before each change: it installs the hercules command, sets up the browsers you want
(Chromium, Firefox, WebKit, Chrome, Edge), then
walks you through choosing a model (a server on your machine, OpenRouter, or any
OpenAI-compatible URL and key) and connecting your coding agents, so the tester UI opens
ready to run. No uv? Use
pipx run testzeus-hercules, or install uv
first. It needs Python 3.13 or newer, which uv downloads for you if needed.
Or let your coding agent set it up
Paste this into Claude Code, Codex, Cursor, GitHub Copilot or Gemini CLI, in your app's project folder. The agent asks you a few questions, sets up Hercules and runs a first test of your app. Your API key never goes through the agent.
Set up Hercules by TestZeus (open-source end-to-end testing) for this project.
1. Look first, don't ask yet: my OS and memory, whether `uv` is installed,
whether a local model server (Ollama, LM Studio, ...) is running, which
coding agents this project uses, and the URL this app runs on locally.
2. Then ask me, one question at a time, with your best guess as the default:
- Which URL should Hercules test?
- Which model: a local server, OpenRouter, or another OpenAI-compatible
endpoint (then also its URL and model id)?
- Which browsers to test in: Chromium (default), Firefox, WebKit, Chrome, Edge?
- Which coding agents should be connected to Hercules?
- Keep anonymous usage telemetry on?
3. Never ask me for an API key, and never put one in a command, file or chat.
4. If `uv` is missing, ask before installing it with its official installer.
Then run, with my answers filled in:
uvx testzeus-hercules --yes --project . --browsers <browsers> --agents <agents> --telemetry <on or off>
adding, for OpenRouter: --provider openrouter --egress hybrid
for another endpoint: --provider openai-compatible --base-url <URL> --model <id> --egress hybrid
for a local server only: --egress local
(`uvx testzeus-hercules setup --help` lists every setup flag.)
5. For OpenRouter or another endpoint, ask me to run the same `hercules setup`
flags (without --yes) in my own terminal: it asks for the key without
showing it, and Enter keeps the other answers. Wait until I say it's done.
6. Run `hercules doctor` and fix what it reports, asking me before any change.
If I chose a local server and none is running, help me install and start one.
7. Write one smoke test for my app's main page, run it with `hercules run`
(see `hercules run --help`), and show me the result and the evidence folder.
8. Tell me to restart you so the Hercules tools load. From then on, use
Hercules for every end-to-end test in this project.
More in Set up Hercules with your coding agent.
This is Hercules v2 (
2.0.2), a rewrite of v1. Coming from v1? See Migrating from v1.
Three ways to use it
- Command line:
hercules runa test case and get pass or fail, an exit code for CI,run.jsonandjunit.xml. - Tester UI: a local web UI served by the Hercules daemon. Watch runs live, pause and step through them, answer the questions a run asks, take over the browser, re-run. See Quick start: the tester UI.
- Coding agents: Claude Code, Codex, Cursor, GitHub Copilot and Gemini CLI call Hercules over MCP. The agent writes a case, runs it, reads the failing step and its screenshot, fixes the code and runs it again.
Quick start, step by step
uvx testzeus-hercules above does steps 1, 3 and 7 for you. To do them by hand: you need macOS or Linux, Python 3.13 or newer (3.13 to 3.15), and a model endpoint. The
quick start uses Gemma 4 on Ollama, which needs at least 16 GB of memory.
1. Install.
python3.13 -m venv .venv
source .venv/bin/activate
pip install testzeus-hercules
python -m playwright install chromium
hercules --help
(uv tool install testzeus-hercules also works; the one-line installer above does that and sets
up the browsers for you.) hercules export --check and cloud runs need the cloud extra; see
Optional extras.
Or run Hercules in Docker, with the tester UI, Chromium and the security scanner in one image; see Running in Docker:
# in your app's project folder:
docker run -d --name hercules --shm-size=1g -p 127.0.0.1:7373:7373 -v "$PWD:/work" testzeus/hercules
docker logs hercules # the one-time sign-in link
2. Start a model. A local model, for example:
ollama pull gemma4:26b-a4b-it-qat
OLLAMA_CONTEXT_LENGTH=16384 ollama serve # 32768 on 32 GB machines, 65536 on 48 GB+
Or use any other OpenAI-compatible endpoint (see Models).
3. Set up and check. In another terminal:
hercules setup # model server, optional OpenRouter key, egress policy, telemetry
hercules doctor # checks the settings and what the model server supports
4. Write a case. Go to your app's project folder (the virtual environment stays
active) and save this as .hercules/cases/sign-in.json:
{
"id": "sign-in",
"title": "User signs in",
"environment": {"base_url": "http://localhost:3000"},
"test_data": {
"email": "demo@example.com",
"password": {"secret": "APP_TEST_PASSWORD"}
},
"steps": [
{"action": "Open \"/login\""},
{"action": "Fill \"{{email}}\" in \"Email\""},
{"action": "Fill \"{{password}}\" in \"Password\""},
{"action": "Click the \"Sign in\" button", "expected": "I should see \"Welcome back\""}
]
}
5. Run it.
export APP_TEST_PASSWORD=...
hercules run .hercules/cases/sign-in.json
The evidence is in .hercules/runs/<run_id>/. Add --headed to watch the browser.
hercules plan .hercules/cases/sign-in.json shows what the run will do and check, and
any problem with the case, before you run it.
6. Open the tester UI.
hercules serve # leave it running
hercules ui # in another terminal: opens a one-time sign-in link
Quick start: the tester UI walks through writing, running and finishing a test case in the UI.
7. Connect a coding agent.
hercules init --agent claude # or codex, cursor, copilot, gemini, generic
Coming from v1
v2 replaces v1's engine, command line, configuration and test format. Your v1 test cases come over with one command:
hercules setup && hercules doctor # a model endpoint first
hercules import v1 path/to/v1-project --dry-run # see what would be converted
hercules import v1 path/to/v1-project # .feature files -> .hercules/cases/*.json
export PASSWORD=... # each secret the import lists
hercules run .hercules/cases/<id>.json
Each scenario (and each Examples row) becomes a case, test data becomes test_data,
credentials become secret references, and .env becomes a saved environment. v1 steps
that relied on the agent guessing may need small edits: open pages by quoted path
(Open "/login"), name test data as placeholders (Fill "{{email}}" in "Email"), and
quote the text you expect to see (I should see "Welcome back").
| v1 | v2 |
|---|---|
testzeus-hercules --input-file login.feature |
hercules run .hercules/cases/<id>.json |
--project-base DIR |
--project DIR |
--output-path, --test-data-path |
Runs go to .hercules/runs/<run_id>/; test data lives in each case |
--llm-model, --llm-base-url, --llm-model-api-key |
llm.model, llm.base_url, llm.api_key_env (the variable's name) in .hercules/config.yaml |
HEADLESS=false |
hercules run CASE --headed |
--guided --dry-run |
hercules plan CASE |
--bulk |
Loop over the cases, or queue them on the daemon |
testzeus-hercules-mcp |
hercules mcp (hercules init sets up your coding agent) |
hercules-dashboard |
hercules serve, then hercules ui |
Every command, flag and setting, a worked example, and what is not in v2 yet: Migrating from v1.
Models
Hercules talks to models through the OpenAI chat-completions API, so it works with any compatible endpoint:
| Endpoint | Example |
|---|---|
| A local server | Ollama, mlx-vlm, mlx-lm, LM Studio, llama.cpp, vLLM. Hercules picks Gemma 4 and its budgets from your machine's memory. |
| A hosted API | Any OpenAI-compatible service (llm.provider: openai-compatible with its base URL and model name) |
| A LiteLLM proxy | llm.provider: litellm, with any model the proxy routes to |
Extra request fields (llm.request_params), extra headers (llm.headers) and cache
control for caching proxies (llm.cache) are set per endpoint. Keys stay in environment
variables; configuration only names the variable. hercules doctor measures what the
endpoint supports (tool calling, JSON schema output, images, context size) and runs use
what it measured.
# A hosted OpenAI-compatible endpoint instead of a local server
export HERCULES_LLM_PROVIDER=openai-compatible
export HERCULES_LLM_BASE_URL=https://api.example.com/v1
export HERCULES_LLM_MODEL=<model name the endpoint lists>
export HERCULES_LLM_API_KEY_ENV=EXAMPLE_API_KEY # the variable that holds the key
hercules doctor --no-cache
See Getting started for each server and setting.
What it tests
-
Web UIs: clicks, typing, selects, checkboxes, hover, keys, waits, navigation; across iframes, shadow DOM, modals and single-page apps.
-
APIs: structured HTTP steps with status, JSON Schema, OpenAPI, JSONPath and header checks, and values saved for later steps.
hercules import openapiwrites a case per operation. -
Databases: one read-only
SELECTper step, with row and JSONPath checks. -
Mobile: web apps on an emulated phone or tablet (Playwright device profiles), and native Android and iOS apps through Appium, on a local emulator or device or on BrowserStack, Sauce Labs and TestMu AI. See Mobile testing.
-
Test clouds: send a passed test to BrowserStack, Sauce Labs or TestMu AI and run it in their browsers or on their real devices, from the tester UI or the command line. See Running tests on clouds.
-
Accessibility, visual and layout: axe-core (bundled) and Hercules' own checks, visual baselines and layout checks across viewport widths. Each finding comes with a concrete fix that was applied in the page and checked again before it is reported.
-
Exploratory testing:
hercules explorehunts for bugs nobody wrote a test for, for as long and with as many explorers as you choose. Every clue is reproduced from a fresh start before it is reported, with steps and a failing case to keep. See Exploratory testing.
Cases are JSON files or single-scenario Gherkin .feature files. hercules import also
converts v1 projects and drafts cases from requirement documents.
See every feature in action
Sixteen short videos, one per feature, with a spoken walkthrough and subtitles, recorded against the demo shop in bench/explore. Click a
picture to play the video; Feature videos plays them in the page, with the steps to do the same on your machine.
To watch them all in a row, open the Hercules learning playlist on YouTube.
See exploratory testing in action
Five short videos, with a spoken walkthrough and subtitles, recorded against the demo shop in bench/explore with its seeded bugs
switched on. Click a picture to play the video. The steps under each one do the same on your
machine; Exploratory testing has them in full. They are in the
Hercules learning playlist on YouTube too.
|
Start a session, watch it live. Run hercules ui, open
Explore → Start exploring, pick a start case, a mission and a time box, and watch
explorers work while each clue is reproduced.
|
Review findings in one click. Open Explore → Findings, open a finding, and click Real bug, Not a bug, Can't reproduce or Duplicate. Copy it as a GitHub, Jira, Linear or Markdown issue. |
|
Explore from the terminal. hercules explore start --from .hercules/cases/sign-in.json -t 3 -w 2, then
hercules explore findings, show and issue.
|
Fix, reverify, keep it fixed. After a fix, hercules explore reverify
reruns the kept bug cases. Close a verified fix with
hercules explore triage ID --state closed and its case becomes a regression test.
|
|
Explore from your coding agent. hercules init --agent claude (or
cursor, copilot, codex, gemini), then ask:
"Explore the shop for bugs for 3 minutes and tell me what you found."
|
Try it on the demo shop
# terminal 1: the shop, every seeded bug on
uv run python bench/explore/app.py --bugs all --port 8200
# terminal 2: the daemon, in your project
hercules serve
# terminal 3: a 5-minute session
hercules explore start --base-url http://127.0.0.1:8200 -t 5 -w 2
The videos start signed in, from a two-step sign-in case: see Walkthrough videos. |
How it decides
- Every step reading and decision comes from a model. There are no hand-written rules for reading steps or picking elements, so new apps and phrasings need no new code. Code only executes structured actions and checks what the page shows.
- Hybrid mode (the default when an OpenRouter key is configured): the model you configured (called the local model in Hercules' output) reads the steps, and JEV, a hosted decision model served through OpenRouter, picks tools and elements. Zero data retention is requested on every JEV call. If JEV cannot answer a decision, the local model answers it.
- Pure mode: the local model does everything, or a local Clef server makes the decisions. Without an OpenRouter key, runs are pure and say so in one line.
- Strict verdicts: every expected outcome is checked and recorded. A run passes only when every step passed and nothing stayed unverified.
- A plan before every run: the case becomes an explicit plan (each step's actions, success criteria from your words and inferred by the model, risks), audited for coverage and linted before the browser starts. Review and edit it, or run strict; the run checks each criterion on the page, recovers when an action did not take effect, and records every change it makes to the plan. See Plans.
See Modes and privacy and Architecture.
Running tests on clouds
Connect BrowserStack, Sauce Labs or TestMu AI (formerly LambdaTest) once, then run any passed test on it. Hercules exports the run as code, sends it to the cloud, follows it to the end and links to the cloud's session, with its video and logs.
- Install the runner tools:
pip install 'testzeus-hercules[cloud]'(andnpm i -g saucectlfor Sauce Labs web tests). - In the tester UI, open Integrations and paste your cloud user name and access key.
Hercules checks them and saves them in
~/.hercules/clouds.env, readable only by you. Environment variables (BROWSERSTACK_*,SAUCE_*,LT_*) work too. - On a passed run, choose Run on a cloud, pick the cloud and the browser and OS (or the device), and run it. The run page shows the cloud run's status and links.
From the command line:
echo "$BROWSERSTACK_ACCESS_KEY" | hercules cloud connect browserstack --username my_user
hercules cloud run <run-id> --cloud browserstack --browser chrome --os windows
hercules cloud bundle <run-id> --cloud saucelabs --out signin-sauce.zip # the project, with .sauce/config.yml, for CI
| Web tests | Native app tests | |
|---|---|---|
| BrowserStack | Hercules runs the test in a BrowserStack browser | BrowserStack devices |
| Sauce Labs | saucectl runs it in Sauce's cloud |
Sauce Labs devices |
| TestMu AI | Hercules runs the test in a TestMu browser | TestMu real devices |
Access keys are never shown, logged or written into exported files. See Running tests on clouds.
Privacy and telemetry
-
The egress policy says what may leave your machine:
hybrid(page text, and screenshots when JEV is unsure),hybrid-text(text only) orlocal(nothing; no hosted models). -
Secrets are referenced by environment variable name. Models see the placeholder, never the value, and values are masked in every evidence file.
-
Hercules sends anonymous usage telemetry to PostHog (versions, setting names, run counts and outcomes, whether a run came from the CLI, the tester UI or a coding agent and which agent, error class names, a random installation id), never test content, page content, URLs or secrets. No person profile is created and no location is derived from your IP address. Opt out with any of:
hercules --no-telemetry run case.json # one command export HERCULES_TELEMETRY=0 # or DO_NOT_TRACK=1 hercules setup --telemetry off # saved for every project
Telemetry is always off under the egress policy
local. Details: Modes and privacy.
Documentation
- User guide
- Quick start: the tester UI
- Feature videos
- Hercules learning playlist on YouTube: every feature and exploratory testing video
- Getting started
- Writing tests
- Exploratory testing
- Plans
- Running tests
- Modes and privacy
- Coding agents
- Importing
- Visual and accessibility checks
- Mobile testing
- Security scans
- Running in Docker
- Exporting runs as code
- Running tests on clouds
- Migrating from v1
- Troubleshooting
- Architecture: how Hercules is built, for contributors
- Changelog
Status
Security scans run the open-source nuclei scanner (installed separately) against your
app: hercules scan --base-url http://localhost:8000, or a security step in a test case
(see Security scans). Passed runs can be exported as
Playwright Test or pytest-playwright code (hercules export, see
Exporting runs as code). Cases run in Chromium, Chrome, Edge,
Firefox or WebKit, with any Playwright launch and context option: locale, time zone, a
signed-in auth JSON, headers, a proxy (see Browsers and browser options). Mobile web and native app testing are in v2 (see
Mobile testing).
Contributing
Read CONTRIBUTING.md and the Code of Conduct. Questions and ideas are welcome in our community Slack.
Made by TestZeus
Hercules is an open-source QA engine made by TestZeus. TestZeus logos are in docs/assets/brand/testzeus.
TestZeus Pro: end to end test management, creation, execution and reporting in the cloud. Start a free trial or see plans and pricing.
License
Hercules is licensed under the GNU Affero General Public License v3.0. See LICENSE. Bundled third-party code is listed in THIRD_PARTY_NOTICES.md.
Metadata
Release files for testzeus-hercules 2.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| testzeus_hercules-2.0.2.tar.gz | 2.8 MB | With provenance | Details for testzeus_hercules-2.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| testzeus_hercules-2.0.2-py3-none-any.whl | Python 3 | none | any | Details for testzeus_hercules-2.0.2-py3-none-any.whl |
Total release size: 5.3 MB
Release files / testzeus_hercules-2.0.2.tar.gz
| Download URL | testzeus_hercules-2.0.2.tar.gz |
|---|---|
| Size | 2.8 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
407748133985e2c8c7adb7bc4b640a686bac480ccfb41effc13d3764b782ad7d
|
|
BLAKE2b-256 checksum How to use checksums |
25b8d7c60ebdf7d0be04e946b76df03a46e1198736c63d765705a512c83c5a9c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.
Transparency logRelease files / testzeus_hercules-2.0.2-py3-none-any.whl
| Download URL | testzeus_hercules-2.0.2-py3-none-any.whl |
|---|---|
| Size | 2.4 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d343d0f7490dd2f40d2b93b7d2f5f12e637b5ba286fdd86cb8223554c0d9c8f3
|
|
BLAKE2b-256 checksum How to use checksums |
793730469579b44f9ca1d8ca0a19e8143022b7f145c5698e8a3e4b89119a270e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.
Transparency logSecurity for testzeus-hercules 2.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for testzeus_hercules-2.0.2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.