Skip to main content

Hercules by TestZeus

CI PyPI Python versions PyPI Total Downloads License: AGPL v3 YouTube playlist

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. Until v2 is released on PyPI, run uvx --from git+https://github.com/test-zeus-ai/testzeus-hercules.git testzeus-hercules.

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.0), a rewrite of v1. Coming from v1? See Migrating from v1.

Three ways to use it

  • Command line: hercules run a test case and get pass or fail, an exit code for CI, run.json and junit.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. v2 is not yet released on PyPI (pip install testzeus-hercules still installs v1), so install it from a clone:

git clone https://github.com/test-zeus-ai/testzeus-hercules.git
cd testzeus-hercules
uv sync --python 3.13
uv run python -m playwright install chromium
source .venv/bin/activate
hercules --help

Or run Hercules in Docker, with the tester UI, Chromium and the security scanner in one image; see Running in Docker:

docker build -t hercules .     # in the clone
# then, in your app's project folder:
docker run -d --name hercules --shm-size=1g -p 127.0.0.1:7373:7373 -v "$PWD:/work" 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 openapi writes a case per operation.

  • Databases: one read-only SELECT per 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 explore hunts 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.

One line to install and set up (1:28)
One line to install and set up. uvx testzeus-hercules in your app's folder installs the hercules command, sets up the browsers you pick, connects a model (local, OpenRouter or any OpenAI-compatible endpoint) and your coding agent, asking before each change.
From an empty project to a passing test (2:16)
From an empty project to a passing test. Start from an empty project in the tester UI: save an environment for the app, write a case the way a tester would, run it and watch it live, then read every step, decision and screenshot it kept.
Review the plan before the run starts (1:57)
Review the plan before it runs. Every case becomes a plan: the actions, the success criteria the page must meet after each one, risks and lint.
Debug a run: pause, take over, answer its questions (1:51)
Debug a run, take over the browser. Pause with Space, step with N, take over the run's own browser to do what the case forgot, fix a step that could not be done by editing its text, and approve an irreversible click before it happens.
Run tests from the terminal (1:51)
Run tests from the terminal. hercules run runs a case in a real browser, shows each step as it goes, and exits 0, 1 or 2 for scripts and CI.
Test from your coding agent (1:14)
Test from your coding agent. One command gives Claude Code (or Codex, Cursor, GitHub Copilot, Gemini CLI) the Hercules tools; then ask for a test in plain words and the agent writes the case, runs it in a real browser and reports the result.
Browsers and browser options (1:23)
Any browser, any Playwright option. Save an environment that runs WebKit in German, on Berlin time, already signed in from an auth JSON and sending an extra header, then run a case on it and see every option arrive.
Test your web app on a phone (1:32)
Test your web app on a phone. Give an environment a Playwright device profile such as iPhone 15, run any web case on it, and watch the phone-sized run live; every step keeps the phone's screenshot.
Export a passed run as code (1:36)
Export a passed run as code. Turn a passed run into a Playwright Test or pytest-playwright file with real locators and expects, then hercules export --check runs it once and tells you it passes, with no Hercules or model needed at test time.
Run a passed test on a cloud (1:53)
Run a passed test on a cloud. Connect BrowserStack, Sauce Labs or TestMu AI and run any passed test on the cloud's browsers from its run page, or download it as a ready-made project for that cloud's CI.
Import v1 projects, OpenAPI specs and requirement documents (1:33)
Import v1 projects, specs and documents. hercules import turns what you already have into test cases: a Hercules v1 project's Gherkin features, test data and .env; an OpenAPI spec, one API case per operation; and a requirements document, which your model drafts into cases marked draft for review.
Visual and accessibility checks (1:50)
Visual and accessibility checks. Turn on Accessibility and Visual when you start a run and every page the case reaches is audited: WCAG findings with a selector and a fix that was tried in the page, layout problems at phone width, and a baseline screenshot that the next run is compared against.
Security scans (1:20)
Security scans. hercules scan checks your app for known security issues with the open-source nuclei scanner, only against the app under test and without intrusive templates unless you ask.
Run Hercules in Docker (2:02)
Run it in Docker. Build the Hercules image, serve the tester UI from a container with your project mounted and the model key passed by name, then sign in and run a case: the same UI, runs and evidence as without Docker.
Test data and secrets (2:23)
Test data and secrets. Keep a case's values in its test data and use them in steps as {{name}}; a secret names an environment variable, so its value never lands in the case, never reaches the model and is masked as ****** in the evidence.
Upload and download files (1:53)
Upload and download files. Give a case files to upload in its steps, then download a file from your app and check its name, rows and columns in code. Files go only to the app under test, never to a model.

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 and watch it live (2:17)
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 (1:12)
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 (1:51)
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 (1:03)
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 (2:16)
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.

  1. Install the runner tools: pip install 'testzeus-hercules[cloud]' (and npm i -g saucectl for Sauce Labs web tests).
  2. 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.
  3. 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) or local (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

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

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.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for testzeus-hercules 2.0.0
File Size Uploaded Provenance Actions
testzeus_hercules-2.0.0.tar.gz 2.8 MB With provenance Details for testzeus_hercules-2.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for testzeus-hercules 2.0.0
File Interpreter ABI Platform Actions
testzeus_hercules-2.0.0-py3-none-any.whl Python 3 none any Details for testzeus_hercules-2.0.0-py3-none-any.whl

Total release size: 5.3 MB

Release files / testzeus_hercules-2.0.0.tar.gz

Download URL testzeus_hercules-2.0.0.tar.gz
Size 2.8 MB
Tags Source
SHA-256 checksum
How to use checksums
61814cd0f60f7f012d314c37c9db0f6cf2be18ca5aa3638f852569120d41996c
BLAKE2b-256 checksum
How to use checksums
616b4d056efd6e3d09415f42afb6136fae547e6f2bf6959e1a3036b39639fa73
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 23, 2026.

Transparency log

Release files / testzeus_hercules-2.0.0-py3-none-any.whl

Download URL testzeus_hercules-2.0.0-py3-none-any.whl
Size 2.4 MB
Tags Python 3
SHA-256 checksum
How to use checksums
745a64096b749daa497d45ff528b8042af4f72459077aa5d22422a4511579765
BLAKE2b-256 checksum
How to use checksums
7aa63df515dbf6386e7390319c2ea3ef0bb8d23e52d6a30610ccc0ab00a91576
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 23, 2026.

Transparency log

Security for testzeus-hercules 2.0.0

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.

Select from 2 files

Attestation for testzeus_hercules-2.0.0.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 23, 2026.

Transparency log

A 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.

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page