npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

keepgreen

v0.5.0

Published

Free, self-hosted AI test agent: explores your app and writes new Playwright tests, and fixes the ones that break, with your own AI key. Built on playwright-e2e-mcp and AutoHeal.

Readme

npm npm downloads CI npm provenance License: MIT 100% free GaaS

KeepGreen runs on your own CI runner or laptop, with your own AI key: Anthropic, OpenAI, OpenRouter, or any OpenAI-compatible endpoint including local models. There is no KeepGreen server, no account and no telemetry. You pay only your AI provider, and one spend cap covers every run.

🚀 GaaS: AI testing as a service, without the service

GaaS means Generative and Agentic AI as a Service. KeepGreen gives you the "as a service" part, an AI agent that does a QA engineer's job on every red build and every week, without the parts you don't want: no vendor, no account, no seat price, no platform holding your code.

| | Typical hosted AI testing tools | KeepGreen GaaS | | --- | --- | --- | | Setup | sign-up, SDK or app install, dashboard | npx keepgreen init, then merge its PR | | Who runs the agent | their cloud | your GitHub Actions runner | | Your code and app | sent to their cloud | stays in your CI (only your AI provider sees the prompts) | | Price | per seat or per test run | free (MIT), you pay only your AI key | | A real run on our demo shop | | 2 new tests, about $0.04 | | What lands in your repo | depends on the tool | only tests that passed every run and the anti-cheat guard |

One command turns your repository into a self-driving test team:

  • 🔍 It explores. It opens your app, finds the important flows nobody tested, and writes the tests.
  • 🩹 It heals. When a UI change breaks a test, it opens a fix PR with proof. Real app bugs are reported, not hidden.
  • 🔐 It signs in. Flows behind a login are covered too. Passwords stay in your CI secrets.
  • 🛡️ It can't cheat. Tests that can't fail, skips, fake network answers and deleted assertions are thrown away.
  • 💸 It can't overspend. One max-usd cap per run, on your own key.

⚡ Start in 60 seconds

In your project folder, with your AI key in the shell (Anthropic, OpenAI or OpenRouter):

export ANTHROPIC_API_KEY=sk-ant-...     # or OPENAI_API_KEY, or OPENROUTER_API_KEY
npx keepgreen init                      # 1. sets everything up and opens a setup PR
# 2. merge that PR
npx keepgreen run                       # 3. start it (or Actions > KeepGreen explore > Run workflow)

A few minutes later you get one PR with new, proven tests. npx keepgreen status shows how runs are going and which PRs wait for your review.

What init does for you:

  • finds where your app runs (playwright.config webServer or baseURL, or your dev/start script and its port) and how CI installs it (npm, pnpm, yarn or pip),
  • writes .keepgreen.yml, the explore workflow and AutoHeal's heal workflow, set to your AI provider (no key in the shell? it asks which provider),
  • fixes your test setup so healing works: adds a JSON report and traces on failure to playwright.config, lets its webServer reuse the app KeepGreen starts, and adds workflow_dispatch and a report upload to your test workflow. Every edit is listed and is in the PR for review; --no-fix leaves your files alone,
  • with the GitHub CLI signed in, it asks once, then adds your key as a repository secret, lets Actions open PRs and opens a PR with exactly the files it wrote or edited (branch keepgreen/setup; nothing else you have changed goes in). The key goes straight to GitHub and is never printed. --no-pr skips the PR; without gh, it prints the links to click and the one git command to run.

Want to see it first? npx keepgreen explore --dry-run plans the flows on your machine and writes nothing.

❌ Without it / ✅ With it

Without it, the checkout page ships with no end-to-end test because nobody had time to write one. When a test does exist, a renamed button turns CI red and someone spends an hour patching selectors, or an AI "fixes" it by deleting the assertion that mattered.

With it, KeepGreen opens your app, sees which important flows have no test, writes one for each and opens one pull request with only the tests that passed every run. When the UI changes, it fixes the broken test and proves the fix. When the app is really broken, it tells you it's an app bug instead of "fixing" the test.

Real run, real cost. On our demo shop, one KeepGreen run inspected 3 pages, planned 2 untested flows and opened a PR with 2 new tests. Each passed 3 runs in a row and the anti-cheat guard. Total AI spend: about $0.04.

✨ What you get

| Recipe | What it does | Command | | --- | --- | --- | | 🔍 Explore | Looks at your app, picks the most important user flows that have no test yet, and writes a test for each. A test is kept only if it makes real assertions and passes every run (5 by default). | npx keepgreen explore | | 🎯 Explore one flow | Skip the planning: name the flow, get the test. | npx keepgreen explore --flow "..." | | 🔐 Behind a login | Signs in once (2FA too), plans and writes tests as that user. Secrets stay in your environment. | login-steps: in .keepgreen.yml | | 🩹 Heal | Runs your tests, finds what broke, fixes it and proves the fix. App bugs are reported, not "fixed". | npx keepgreen heal (local) · AutoHeal workflow (CI) |

  • Anti-cheat guard. Tests without real assertions, or with skips, faked network answers, fixed waits, forced clicks or retries, are thrown away.
  • Proven, not hoped. A new test must pass runs times in a row before it's kept.
  • Your style. Tests follow your project's imports, fixtures and locator style.
  • One PR, only new files. In CI, the publish step accepts nothing but new test files.
  • One spend cap. max-usd covers planning plus every flow. OpenRouter prices are looked up for you.
  • Works with Playwright Test and pytest-playwright. Healing also covers Cypress and WebdriverIO.

KeepGreen joins two XSignOn projects into one agent: playwright-e2e-mcp is the toolbox (opens pages, finds stable locators, runs tests, reads failures) and AutoHeal is the guarded fixer and test writer.

💻 On your machine

npm install -D keepgreen              # or use npx keepgreen ... without installing
export ANTHROPIC_API_KEY=sk-ant-...   # your own key
npx keepgreen explore                 # uses the app found by init (.keepgreen.yml)

Explore prints a table of the flows it tried and which tests it kept. New files are named after the flow, such as tests/keepgreen-adds-coffee-mug-cart-count-shows.spec.ts. Review them with git diff and commit the ones you like.

# Plan only: show the flows it would test, write nothing
npx keepgreen explore --url http://localhost:3000 --dry-run

# Test the flows you name (repeat --flow for more)
npx keepgreen explore --url http://localhost:3000 \
  --flow "A shopper adds the coffee mug to the cart and the cart count shows 1"

# Let KeepGreen start your app
npx keepgreen explore --start-command "npm run dev" --start-url http://localhost:3000

# A deployed staging or preview app works too (use a test environment, not production)
npx keepgreen explore --url https://staging.example.com

# Fix broken tests; changes stay in your working tree for review
npx keepgreen heal

🤖 GitHub Actions

npx keepgreen init writes two workflows:

  • .github/workflows/keepgreen-explore.yml runs from Actions > KeepGreen explore > Run workflow, or weekly if you uncomment the schedule. It opens one PR with the new tests that passed. The explore job runs the AI-written tests with a read-only token. The publish job accepts the result only if it just adds test files, then opens the PR. A scheduled run skips itself while an earlier KeepGreen PR is still open.
  • .github/workflows/autoheal.yml is written by AutoHeal's own init. It runs after your test workflow fails and opens a fix PR.

init sets both to your package manager and AI provider. With gh it also adds the key secret and the PR permission and opens the setup PR. Then, from your terminal:

npx keepgreen run                                     # start explore on GitHub
npx keepgreen run --flow "A shopper checks out" --watch   # name the flow, wait, print the PR
npx keepgreen status                                  # key, setting, latest runs, PRs to review

By hand, the GitHub side is:

  1. Add your key as a repository secret: ANTHROPIC_API_KEY, OPENAI_API_KEY (plus a repository variable AUTOHEAL_MODEL) or OPENROUTER_API_KEY.
  2. Go to Settings > Actions > General > Workflow permissions and tick "Allow GitHub Actions to create and approve pull requests".
  3. If your tests need services (a database, env vars), add them to the explore job like in your test workflow.
  4. Optional: add a fine-grained token (this repo only; Contents and Pull requests: read and write) as the secret KEEPGREEN_PR_TOKEN. GitHub runs no CI on PRs opened with the built-in token; with this one, your checks run on KeepGreen's PRs.

Or use the action directly:

- uses: xsignon-secure/[email protected]
  with:
    url: http://localhost:3000
    anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }}
    # flows: |                       # optional: skip planning
    #   A visitor logs in and sees the dashboard
# leaves keepgreen-out/ (report.md, summary.json, new-tests.patch); output `written` = tests kept

🔍 How explore works

flowchart LR
  A["👀 Look<br/>inspect your pages"] --> B["🧭 Plan<br/>flows with no test yet"]
  B --> C["✍️ Write<br/>one test per flow, your style"]
  C --> D{"🛡️ Prove<br/>guard + N green runs"}
  D -->|passes| E["✅ kept, in one PR"]
  D -->|fails or cheats| F["🗑️ thrown away"]
  1. Look. It opens your app's start page and every path in pages: with playwright-e2e-mcp's inspect-page, which lists the interactive elements and their locators.
  2. Plan. It reads the titles of your existing tests and asks your AI for the most important user flows that have no test yet. Flows that pay money, send email or delete data are skipped. With --flow, this step is skipped.
  3. Write. For each flow, AutoHeal's cover explores the pages, checks every locator, and writes one test in your project's own style.
  4. Prove. The new-test guard rejects tests that cannot fail, or that use skips, faked network answers, fixed waits, forced clicks or retries. The test must then pass every run in a row. Anything less is thrown away.

One max-usd cap covers the whole run. Each flow gets an even share of what is left, so money one flow saves goes to the next.

⚙️ Settings

.keepgreen.yml at the repo root. Command-line flags override it.

url: http://localhost:3000        # the running app (local, staging or preview), or:
# start-command: npm run dev
# start-url: http://localhost:3000
pages:                            # extra pages to look at when choosing flows
  - /login
  - /pricing
max-flows: 3                      # new tests per explore run (1-10)
max-usd: 3                        # AI spend cap for one explore run
runs: 5                           # passing runs in a row a new test needs (2-20)
framework: auto                   # auto | playwright | pytest | cypress | webdriverio

AI settings use AutoHeal's variables:

| Variable | Meaning | | --- | --- | | ANTHROPIC_API_KEY | Use Anthropic (default model claude-opus-5-5) | | OPENAI_API_KEY + AUTOHEAL_MODEL | Use OpenAI | | AUTOHEAL_BASE_URL + AUTOHEAL_MODEL (+ AUTOHEAL_API_KEY) | Any OpenAI-compatible endpoint: OpenRouter, or Ollama at http://localhost:11434/v1 | | AUTOHEAL_EFFORT | Anthropic effort: low … max (default medium) | | AUTOHEAL_PRICE_IN / AUTOHEAL_PRICE_OUT | USD per 1M tokens, for models without a known price |

OpenRouter (or any OpenAI-compatible endpoint)

export AUTOHEAL_BASE_URL=https://openrouter.ai/api/v1
export AUTOHEAL_API_KEY=sk-or-...            # your OpenRouter key; give it a credit limit
export AUTOHEAL_MODEL=anthropic/claude-sonnet-5.5
npx keepgreen explore --url http://localhost:3000

KeepGreen looks up the model's price in OpenRouter's public model list, so max-usd is enforced. For other endpoints, set AUTOHEAL_PRICE_IN and AUTOHEAL_PRICE_OUT.

In the Action: base-url: https://openrouter.ai/api/v1, api-key: ${{ secrets.OPENROUTER_API_KEY }} and model: ....

Flows behind a login

Most important flows need a signed-in user. Add the login steps to .keepgreen.yml:

login-url: /login
login-steps:
  - fill getByLabel('Email') = {{env:E2E_USER}}
  - fill getByLabel('Password') = {{env:E2E_PASSWORD}}
  - click getByRole('button', { name: 'Sign in' })
login-check: getByRole('button', { name: 'Sign out' })   # only a signed-in user sees it
# login-totp-env: E2E_TOTP_SECRET                         # if a step types {{totp}} (2FA)
# session: playwright/.auth/user.json                     # where the session is saved

KeepGreen signs in once through playwright-e2e-mcp's save-login, looks at your pages as that user, plans flows that keep the session valid (no logging out or account changes), and every new test loads the same session with test.use({ storageState }) (pytest: browser_context_args).

  • Secrets stay out of everything. {{env:E2E_PASSWORD}} is filled in by the browser engine at the moment it is typed; the AI, the logs and the test files never see it. Only variables named E2E_*, TEST_*, PW_*, PLAYWRIGHT_* or LOGIN_* can be used, and a step that types a password as plain text is refused.
  • A failed login stops the run before any AI spend.
  • Already make a session in a Playwright setup project? Set just session: playwright/.auth/user.json and run the setup project first.
  • Your CI must create the same session before the new tests run, usually with that setup project. Keep the session file in .gitignore; KeepGreen never commits it.
  • In the Action, pass the secrets as env: on the KeepGreen step (E2E_USER: ${{ secrets.E2E_USER }}).
  • Steps: goto, fill <locator> = <value>, press <locator> = <key>, select <locator> = <option>, click, dblclick, hover, check, uncheck, wait <locator> or wait <ms>. Quote a step that has # in it (a CSS id), or YAML reads the rest as a comment.

The same works with flags: --login-url, --login-step (repeat it), --login-check, --login-totp-env, --session.

Playwright webServer

If your playwright.config starts the app with webServer, and KeepGreen starts it too (start-command), Playwright must reuse it during a KeepGreen run. init makes this edit for you:

webServer: { command: 'npm run start', url: 'http://127.0.0.1:3000/', reuseExistingServer: !process.env.CI || !!process.env.KEEPGREEN },

📖 All commands

keepgreen init [--provider anthropic|openai|openrouter] [--url <app> | --start-command <cmd>
               --start-url <url>] [--github | --no-github] [--no-pr] [--no-fix] [--force] [--dry-run]
keepgreen run [--url <app>] [--flow "<sentence>" ...] [--max-flows 3] [--ref <branch>] [--watch]
keepgreen status                        # AI key secret, PR setting, latest runs, PRs to review
keepgreen doctor
keepgreen explore [--url <app>] [--start-command <cmd> --start-url <url>] [--pages /a,/b]
                  [--flow "<sentence>" ...] [--max-flows 3] [--max-usd 3] [--runs 5]
                  [--dry-run] [--out <dir>]
keepgreen heal [AutoHeal fix options]
keepgreen autoheal <command> [...]      # any AutoHeal command: learn, metrics, dashboard, ...
keepgreen check-patch <file>            # CI publish step
keepgreen --version

🏠 Self-host bundle (optional)

KeepGreen needs no server. If you want test history across all CI runs (flaky ranking, the commit where a test went bad) and AutoHeal's dashboard (fixes, blocked cheats, AI spend), selfhost/ starts both servers with one command:

cd selfhost && sh make-env.sh your-org/your-repo && docker compose up -d --build

🔒 Security

See SECURITY.md. In short: your key goes only to your AI provider, AI-written tests never run with a write token or your AI key, the publish step only accepts new test files, and every change arrives as a PR for a person to review. Forks never get your secrets. Login passwords are typed by the browser engine from your environment and never reach the AI.

💚 Free forever

MIT licensed. Free for any use, with no paid tier, no account and no telemetry. Releases are published from CI with npm provenance.

Issues and pull requests are welcome. If KeepGreen helps you, ⭐ the repo so others can find it.