Skip to main content
Stably gives you multiple ways to auto-create tests, from a fully interactive conversation to a headless one-shot command for CI. Every approach uses the same AI agent under the hood — you just choose how much control you want.

Interactive Mode

The fastest way to start creating tests. Launch the interactive agent and have a conversation:
This opens a conversational interface where you work with the AI agent in real-time:
  • Describe what to test and the agent generates Playwright tests
  • Iterate on the output — ask for changes, add edge cases, refine selectors
  • Fix failing tests — paste error output and get fixes applied
  • Explore your suite — ask about coverage gaps, flaky tests, or test structure
  • Get guidance — learn best practices or troubleshoot problems
Interactive mode is ideal when you want a flexible, back-and-forth workflow — especially when you’re exploring a new feature, aren’t sure exactly what tests you need, or want to iterate quickly on the output.

stably create — Headless Test Generation

stably create is the headless counterpart to the interactive agent. It generates tests and exits — making it ideal for CI/CD workflows, shell scripts, and integration with AI coding agents.
For cloud browsers:
This runs the browser work in Stably’s cloud. It is fast to start, works well in CI and coding-agent environments, and can scale out across parallel agent workers. See Cloud Browsers for Stably CLI.

Self-Planning (No Prompt)

When you run stably create without a prompt, Stably automatically analyzes your changes and decides what tests to write:
  1. In CI with PR context — analyzes the pull request diff
  2. Locally — analyzes git changes against origin/HEAD
This is the simplest way to add test generation to your CI pipeline — no prompt engineering required. The agent reads your code changes, understands what’s new, and creates targeted tests.

From a Prompt

Pass a description of what you want to test:

From a Test Plan

Point the agent at a structured test plan for repeatable, comprehensive test generation:

Example Prompts

Here are prompts that work well with stably create:

Output Location

If --output is not specified, Stably automatically detects the output directory:
  1. playwright.config.ts — Uses testDir if defined
  2. Auto-detect — First existing: tests/e2e/__tests__/test/
  3. Fallback — Current working directory
The command prints created file paths, making it easy to parse in CI:

Use Cases


CI/CD Integration

stably create is designed for unattended execution. Here are common integration patterns.
Avoid infinite PR loops. If a PR created by npx stably create triggers the same workflow, it can create an endless cycle. Always add a precondition to skip the workflow when the PR author is stably-bot:

Monitoring Create Sessions

When stably create runs, it automatically creates an automation — a real-time view of the agent’s progress visible on the Stably web dashboard. This is especially useful in CI pipelines, Docker containers, and other non-interactive environments where you can’t see the terminal. From the dashboard you can:
  • Watch progress live — see the current phase, activity log, and files being created
  • Send messages to the agent — provide guidance or additional context while the agent works, even in CI
Create automations track these phases: initializinggeneratingtestingcomplete
Automation creation is best-effort and non-blocking. If the connection fails, the CLI continues normally — your commands are never interrupted.

Customizing Test Generation

Control how the AI agent generates tests using STABLY-CREATE.md — a markdown file in your project root with test-generation-specific rules.
STABLY-CREATE.md
See the full STABLY-CREATE.md reference for examples and best practices.

Next Steps

Run Tests

Execute your generated tests locally or in CI

Auto-fix Failures

Automatically diagnose and repair failing tests

STABLY-CREATE.md

Customize test generation rules and conventions

CLI Commands

Full command reference for the Stably CLI