Docs/Quickstart
#

Quickstart

Paste one prompt into your coding agent and get a running copy of your app and a first passing test.

Set up Cofactor with your agent

Paste this prompt into your coding agent in your app's repository. About 30 minutes later you have a Cofactor account, a live copy of your app with test logins (a sandbox), and one test that passes against it.

A terminal runs cofactor install, then sandbox claim, and ends on the sandbox URLs and logins
A terminal runs cofactor install, then sandbox claim, and ends on the sandbox URLs and logins

You need a code repository, a coding agent that can run a terminal (Claude Code, Codex, Cursor and OpenCode work), and Node 20 or later. If signup says it isn't open yet, join the waitlist at runcofactor.com or ask us for an invite.

Set up with your agent

Paste the prompt above into Claude Code, Codex, Cursor or any coding agent, from your app's repository. These are the steps it takes, and the points where it stops to ask you something.

  1. Install the CLI. The agent runs npm install -g @runcofactor/cli and then cofactor upgrade.

  2. Sign up from the terminal. The agent asks for your email, shows you the Terms and Privacy policy, and runs these. Cofactor emails you an 8-digit code.

    bash
    cofactor signup --email you@example.com --accept-terms --workspace "Acme"
    cofactor signup verify --code <8 digits>
    

    --workspace names your organization.

    The Free plan needs no credit card.

  3. Watch progress. The agent gives you a link to a progress page. Open it to see each step as it happens.

    The setup progress page listing each step, with analyze and plan done and the first sandbox in progress
  4. Connect your agents and your code. The agent runs cofactor install --all-detected. For GitHub it then runs cofactor github connect, and you approve the Cofactor GitHub App in your browser.

  5. Approve one plan. The agent reads your code and writes a single plan: how your app starts, which roles need a login, and what data to seed. You approve it once. The agent then writes cofactor.sandbox.yaml and claims your first sandbox. If you can't connect GitHub, it builds and pushes an image instead. See Build from a pushed image.

    bash
    cofactor sandbox claim --application "Acme App" --wait
    
    The claim output with the sandbox URLs, one login per role (passwords masked) and seed outputs
  6. Bring in your tests. Once the sandbox works, the agent looks for Playwright tests in your code and asks what you want first:

    • Your existing Playwright tests. The agent points them at the sandbox, runs one spec, then the whole suite. See Bring your own suite.
    • A first regression suite. The agent writes 3 to 5 tests of your core journeys, like signing in, and runs each on a fresh sandbox. See End-to-end tests.
    bash
    cofactor workflow run <workflow id> --stream
    
    A passed run. Every step reads Success, and the screenshot of the app is visible beside the steps.
  7. Run them every night. The agent asks which Slack channel or email should hear about failures. It schedules the suite nightly, adds the alert, and runs it once now so you see a first result. See Suites and schedules.

    bash
    cofactor schedule suite create --name "Acme Nightly" --suite-id <suite id> --at 02:00 --timezone America/New_York
    cofactor alert create --on-schedule <schedule id> --email you@example.com --when failure
    
  8. Open Cofactor. The agent reports what is connected and what is pending. Say yes when it offers cofactor open. It signs you in with a link that works once, for 5 minutes.

What just happened

You made an organization and an application. The sandbox is a copy of that application with its own data and logins. Your tests form a suite that runs every night on a fresh sandbox and alerts you when one fails. Each run is saved with every step and screenshot. How Cofactor works explains these terms.

Check it worked

bash
cofactor setup status --json
cofactor sandbox claims

In setup status, the checks CLI signed in, Source connected, Application created, Sandbox claimed and Sandbox running read done, and the sandbox shows ready. Each agent you registered has its own MCP line, and it reads done. Open the sandbox URL and sign in with a printed login. Your first run shows as passed.

Keep the sandbox until your agent has finished its report, because setup status counts it as running only while it is alive. Then run cofactor sandbox destroy <sandbox id>.

Go deeper

Advanced

Fixes for common setup errors.

ErrorWhat to do
TERMS_NOT_ACCEPTEDShow the Terms and Privacy links and ask again.
CLI_SIGNUP_CODE_COOLDOWNWait the number of seconds the error gives (up to 30 minutes after a locked code), then run signup again.
CLI_SIGNUP_INVALID_CODERun signup for a new code and use the newest email. Five wrong tries lock the code, and you can't get a new one for 30 minutes.
CLI_SIGNUP_WORKSPACE_REQUIREDAdd --workspace "<name>" to signup verify. The flag names your organization.
CLI_SIGNUP_MFA_REQUIREDRun cofactor login and approve it in your browser.
Unknown commandRun cofactor upgrade.
Proxy or TLS errorRun cofactor auth doctor.

To send us feedback, run cofactor feedback "<what happened>" --topic instructions. Leave out secrets and real names.