CLI Reference

Everything the Beryl web app can do, from your terminal and your CI — plus an MCP server that hands the same commands to coding agents.

CLI version 0.1.1 · Product docs

Install

One command does the whole setup — signs you in, pins this repo to a project, and wires the MCP server into Claude Code or Cursor.

npx @beryl-so/cli@latest init

The CLI is a Node.js package (Node 20.19+). One binary, beryl, is both the CLI and the MCP server.

npm install -g @beryl-so/cli
beryl --version

Authenticate

beryl login signs you in with an emailed one-time code and mints a personal access token, stored in ~/.config/beryl/config.json. Tokens can also be created in the web app under Account → API tokens and passed via the BERYL_API_KEY environment variable — the right approach for CI. A token has the same access as your account; revoke any token with beryl tokens revoke.

beryl login
beryl whoami

Everyday workflow

Point Beryl at a URL and watch the agent explore your app and author tests, live in your terminal. Then trigger runs whenever you like.

beryl projects create https://app.example.com --auth public --watch
beryl tests list
beryl runs trigger --watch
beryl projects report

For login-gated apps, capture a session once — beryl credentials capture opens a live cloud browser where you log in like a normal user; the captured session is encrypted and never shown to anyone, including Beryl staff.

CI integration

--watch streams progress and exits non-zero unless every test passed, so one line gates a deploy. Use --url-override to aim the suite at a preview deployment, and --json for machine-readable output (NDJSON while streaming).

env:
  BERYL_API_KEY: ${{ secrets.BERYL_API_KEY }}
run: |
  npx @beryl-so/cli runs trigger --url-override "$PREVIEW_URL" --watch --timeout 30

Exit codes: 0 success (all tests passed) · 1 failure · 2 usage error · 3 authentication error.

MCP for coding agents

beryl mcp serves every non-interactive command below as an MCP tool over stdio (spaces and dashes become underscores — runs trigger is the tool runs_trigger). Your coding agent can create projects, trigger runs, read failures, and edit test plans through exactly the same commands documented here.

# Claude Code
claude mcp add beryl --env BERYL_API_KEY=beryl_pat_… -- beryl mcp

# Cursor / other MCP clients
{ "command": "beryl", "args": ["mcp"], "env": { "BERYL_API_KEY": "beryl_pat_…" } }

Configuration

Most commands act on a workspace and a project. Every scoped command accepts --workspace and --project (by id, name, or URL); when omitted, the CLI resolves them from (in order): the BERYL_WORKSPACE / BERYL_PROJECT environment variables, a .beryl.json in your repo, defaults saved by beryl workspaces use / beryl projects use, or — when there is exactly one — your only workspace or project.

// .beryl.json — commit it so CI and teammates share defaults
{ "workspace": "<workspace-id>", "project": "<project-id>" }

Global flags on every command: --json · --api-url · --token · --help.

beryl init

beryl beryl init

Set up Beryl in this repo — sign in, pin a project, wire up your coding agent (interactive)

One-command onboarding: signs you in (emailed one-time code), pins this repo to a workspace and project via .beryl.json (offering to create the project — the agent starts exploring and authoring tests immediately), and writes the MCP server config for your coding agent (.mcp.json for Claude Code, .cursor/mcp.json for Cursor). Safe to re-run; every step skips what is already set up.

  • --editor-tools <claude-code|cursor|both|none> Which coding agent to write MCP config for (default: auto-detect)
  • --no-pin Skip writing .beryl.json
  • --local Also wire the Playwright MCP so your coding agent can drive a local browser (for authoring tests yourself). Default: on whenever a coding agent is wired; pass --no-local to skip it

Also accepts --workspace and --project — see Configuration.

npx @beryl-so/cli@latest init
beryl init --editor-tools claude-code
beryl init --project https://app.example.com --editor-tools none

beryl login

beryl beryl login

Authenticate the CLI with your Beryl account (interactive)

Signs in with an emailed one-time code and mints a personal access token, which is stored in the CLI config. Pass --token to use an existing token from Account → API tokens instead. In CI, prefer the BERYL_API_KEY environment variable.

  • --token <string> Use an existing personal access token
  • --email <string> Email for the one-time code sign-in (default: your last sign-in, or your git user.email — offered as the prompt default)
  • --token-name <string> Name for the minted token (default: CLI on <hostname>)
beryl login
beryl login --token beryl_pat_…
beryl login --email [email protected]

beryl logout

beryl beryl logout

Remove the stored token from the CLI config

  • --revoke Also revoke the token server-side so it can never be used again

beryl whoami

beryl beryl whoami

Show the signed-in account and the CLI's resolved defaults

beryl tokens

beryl beryl tokens list

List your personal access tokens

beryl beryl tokens create <name>

Mint a new personal access token (shown once)

  • nameA label for the token
  • --expires-at <string> Expiry as an ISO timestamp (default: never)
beryl beryl tokens revoke <token-id>

Revoke a personal access token

  • token-idToken id from `beryl tokens list`

beryl workspaces

beryl beryl workspaces list

List workspaces you belong to

beryl beryl workspaces get

Show one workspace

Also accepts --workspace — see Configuration.

beryl beryl workspaces create <name>

Create a workspace

  • nameWorkspace name
  • --domain <string> Company domain to associate
  • --visible-to-org Let anyone on your email domain discover and join it
beryl beryl workspaces update

Rename a workspace or change its visibility

  • --name <string> New name
  • --visible-to-org Toggle org discoverability
  • --autofix Toggle autofix

Also accepts --workspace — see Configuration.

beryl beryl workspaces delete

Delete a workspace and everything in it

  • --force Skip the confirmation prompt

Also accepts --workspace — see Configuration.

beryl beryl workspaces use <workspace>

Set the default workspace for future commands

  • workspaceWorkspace id or name
beryl beryl workspaces history

Show the workspace's action history (who did what, when)

Also accepts --workspace — see Configuration.

beryl beryl workspaces leave

Leave a workspace you are a member of

  • --force Skip the confirmation prompt

Also accepts --workspace — see Configuration.

beryl members

beryl beryl members list

List workspace members

Also accepts --workspace — see Configuration.

beryl beryl members set-role <user-id> <role>

Change a member's role

  • user-idMember's user id
  • roleOWNER or USER

Also accepts --workspace — see Configuration.

beryl beryl members remove <user-id>

Remove a member from the workspace

  • user-idMember's user id
  • --force Skip the confirmation prompt

Also accepts --workspace — see Configuration.

beryl invites

beryl beryl invites send <email>

Invite someone to the workspace by email

  • emailInvitee email
  • --role <OWNER|USER> Role (default USER)

Also accepts --workspace — see Configuration.

beryl beryl invites list

List the workspace's outstanding invitations

Also accepts --workspace — see Configuration.

beryl beryl invites revoke <invitation-id>

Revoke a pending invitation

  • invitation-idInvitation id

Also accepts --workspace — see Configuration.

beryl beryl invites mine

List invitations sent to you

beryl beryl invites accept <invitation>

Accept an invitation (by id, or by the token from the invite email)

  • invitationInvitation id or emailed token
beryl beryl invites decline <invitation-id>

Decline an invitation

  • invitation-idInvitation id

beryl projects

beryl beryl projects list

List projects in the workspace

Also accepts --workspace — see Configuration.

beryl beryl projects get

Show one project, including its current exploration state

Also accepts --workspace and --project — see Configuration.

beryl beryl projects create <url>

Create a project — the agent starts exploring and authoring tests immediately

  • urlRoot URL of the site to test
  • --auth <public|gated> Whether the site needs a login (gated) or not (public). Default: detected from the site — only asked when detection is genuinely unsure
  • --allow-mutations Let the agent perform state-changing actions while exploring
  • --force-new-login Ignore any reusable saved login
  • --no-explore Create the project without starting the cloud exploration — author tests yourself via `beryl tests create` or your coding agent over MCP
  • --watch Stream the agent's exploration live
  • --timeout <number> With --watch: max minutes to wait

Also accepts --workspace — see Configuration.

beryl projects create https://app.example.com --watch
beryl projects create https://app.example.com --auth gated
beryl projects create https://app.example.com --auth public --no-explore
beryl beryl projects rename <name>

Rename a project

  • nameNew name

Also accepts --workspace and --project — see Configuration.

beryl beryl projects delete

Delete a project and all its tests and runs

  • --force Skip the confirmation prompt

Also accepts --workspace and --project — see Configuration.

beryl beryl projects re-explore

Send the agent back in — run/heal existing tests and discover new flows

  • --watch Stream the agent's exploration live
  • --timeout <number> With --watch: max minutes to wait

Also accepts --workspace and --project — see Configuration.

beryl beryl projects report

Aggregate quality report across recent runs (pass rates, flaky tests, trend)

  • --runs <number> How many recent runs to aggregate
  • --env <string> Limit to one environment id

Also accepts --workspace and --project — see Configuration.

beryl beryl projects reusable-auth <url>

Check whether a saved login can be reused for a URL before creating a project

  • urlThe URL you plan to test

Also accepts --workspace — see Configuration.

beryl beryl projects use <project>

Set the default project for future commands

  • projectProject id, name, or URL

Also accepts --workspace — see Configuration.

beryl envs

beryl beryl envs list

List a project's environments

Also accepts --workspace and --project — see Configuration.

beryl beryl envs get <env-id>

Show one environment

  • env-idEnvironment id

Also accepts --workspace and --project — see Configuration.

beryl beryl envs create <name> <url>

Add an environment (e.g. staging) to a project

  • nameEnvironment name
  • urlRoot URL for this environment
  • --auth <public|gated> Whether this environment needs a login
  • --allow-mutations Allow state-changing actions

Also accepts --workspace and --project — see Configuration.

beryl beryl envs update <env-id>

Update an environment's name, URL, or auth settings

  • env-idEnvironment id
  • --name <string> New name
  • --url <string> New root URL
  • --auth <public|gated> New auth choice

Also accepts --workspace and --project — see Configuration.

beryl beryl envs delete <env-id>

Delete an environment

  • env-idEnvironment id
  • --force Skip the confirmation prompt

Also accepts --workspace and --project — see Configuration.

beryl schedule

beryl beryl schedule get

Show the project's daily/weekly run schedule

Also accepts --workspace and --project — see Configuration.

beryl beryl schedule set

Enable scheduled runs (daily, or weekly on a given day)

  • --frequency <daily|weekly> How often (default daily)
  • --day <number> Weekly only: day of week, 0=Monday … 6=Sunday
  • --hour <number> Hour of day 0-23
  • --minute <number> Minute 0-59
  • --tz <string> IANA timezone (e.g. America/Los_Angeles)

Also accepts --workspace and --project — see Configuration.

beryl schedule set --frequency daily --hour 6 --tz UTC
beryl beryl schedule disable

Turn scheduled runs off

Also accepts --workspace and --project — see Configuration.

beryl tests

beryl beryl tests lint

Validate a plan JSON file offline, before sending it to the server

Checks a plan against the published ActionPlan JSON Schema — every action's required fields, plus the two structural rules (the first EXECUTED step must be a goto, and at least one step across before + steps must be an expect). Runs entirely locally, so a malformed plan fails here instead of costing a server round-trip. Schema: https://api.beryl.so/api/v1/schemas/action-plan.schema.json

  • --file <string> Plan JSON file, or - for stdin (required)
beryl tests lint --file plan.json
beryl beryl tests list

List the project's tests with their latest result

  • --env <string> Filter by environment id

Also accepts --workspace and --project — see Configuration.

beryl beryl tests get <test-id>

Show one test

  • test-idTest id

Also accepts --workspace and --project — see Configuration.

beryl beryl tests plan <test-id>

Print a test's current step plan (JSON)

  • test-idTest id

Also accepts --workspace and --project — see Configuration.

beryl beryl tests create

Create a test case from a JSON action plan — for tests authored locally, e.g. by your coding agent

The plan is a JSON object whose steps are {action, selector, url, value, ...}: the first EXECUTED step must be a goto, and at least one step must be an expect. By default the plan is verified in a real browser before the test is accepted. Optional `before` and `after` arrays hold setup and teardown steps: `after` runs even when a main step fails, which is how a create/update/delete test cleans up the record it made on the runs that go red.

  • --title <string> Title for the new test (required)
  • --file <string> Plan JSON file, or - for stdin (required)
  • --no-verify Skip the compile-time browser/AI verification — trust the authored plan as-is

Also accepts --workspace and --project — see Configuration.

beryl tests create --title "Checkout happy path" --file plan.json
beryl beryl tests set-plan <test-id>

Replace a test's step plan from a JSON file (creates a new version)

Accepts the same plan shape as `tests create`, including the optional `before` and `after` sections — `after` runs on pass and on fail, so cleanup happens even when the test goes red.

  • test-idTest id
  • --file <string> Plan JSON file, or - for stdin (required)

Also accepts --workspace and --project — see Configuration.

beryl tests plan 4f… > plan.json  # edit, then:
beryl tests set-plan 4f… --file plan.json
beryl beryl tests rename <test-id> <title>

Rename a test

  • test-idTest id
  • titleNew title

Also accepts --workspace and --project — see Configuration.

beryl tests rename 4f… "Checkout happy path"
beryl beryl tests quarantine <test-id> <state>

Mute a flaky test: it keeps running, but its failures stop failing the run

A quarantined test still executes and its result is still recorded and visible — its red just doesn't count towards the run's verdict, so it can't red-light a deploy. Use it on a persistently flaky test instead of deleting it (which destroys the history) or asking support to deactivate it (which stops it running at all). `off` un-quarantines.

  • test-idTest id
  • stateon | off

Also accepts --workspace and --project — see Configuration.

beryl tests quarantine 4f… on
beryl tests quarantine 4f… off
beryl beryl tests delete <test-id>

Delete a test, its version history, and its results

  • test-idTest id
  • --force Skip the confirmation prompt

Also accepts --workspace and --project — see Configuration.

beryl beryl tests recompile <test-id>

Validate + verify an edited plan against the live site before persisting

  • test-idTest id
  • --file <string> Plan JSON file, or - for stdin (required)

Also accepts --workspace and --project — see Configuration.

beryl beryl tests versions <test-id>

List a test's version history

  • test-idTest id
  • --limit <number> Page size
  • --cursor <number> Continue from a previous next_cursor

Also accepts --workspace and --project — see Configuration.

beryl beryl tests version <test-id> <version-no>

Show one specific version of a test (including its plan)

  • test-idTest id
  • version-noVersion number

Also accepts --workspace and --project — see Configuration.

beryl beryl tests diff <test-id> <from> <to>

Diff two versions of a test's plan

  • test-idTest id
  • fromFrom version number
  • toTo version number

Also accepts --workspace and --project — see Configuration.

beryl beryl tests restore <test-id> <version-no>

Restore a test to an earlier version

  • test-idTest id
  • version-noVersion number to restore

Also accepts --workspace and --project — see Configuration.

beryl beryl tests reset <test-id>

Discard user edits and return the test to its latest system-authored version

  • test-idTest id

Also accepts --workspace and --project — see Configuration.

beryl beryl tests heal <test-id> <state>

Turn self-healing on or off for a test

  • test-idTest id
  • stateon or off

Also accepts --workspace and --project — see Configuration.

beryl beryl tests history <test-id>

Pass/fail history, streak, and stability for a test

  • test-idTest id
  • --limit <number> How many runs of history
  • --env <string> Filter by environment id

Also accepts --workspace and --project — see Configuration.

beryl beryl tests script <test-id>

Print the rendered Playwright spec for a test

  • test-idTest id

Also accepts --workspace and --project — see Configuration.

beryl beryl tests export <test-ids...>

Export tests as Playwright .spec.ts files in a ZIP

  • test-ids...One or more test ids
  • --out <string> Output file (default beryl-tests.zip)

Also accepts --workspace and --project — see Configuration.

beryl runs

beryl beryl runs trigger

Trigger a test run (whole suite, a subset, or one environment)

Runs execute in Beryl's cloud. With --watch the CLI streams live progress and exits 0 only if every test passed — wire it straight into CI.

  • --test <strings> Run only these test ids (repeatable)
  • --env <string> Environment id to run against
  • --url-override <string> Replace the base URL (preview deploys)
  • --watch Stream progress and exit non-zero on failure
  • --timeout <number> With --watch: max minutes to wait
  • --retries <number> Retry a failing test up to N times (0 disables); omit for the default

Also accepts --workspace and --project — see Configuration.

beryl runs trigger --watch
beryl runs trigger --url-override https://preview-123.example.com --watch --timeout 30
beryl runs trigger --test 4f… --test 9a…
beryl runs trigger --retries 0 --watch
beryl beryl runs list

List recent runs

  • --env <string> Filter by environment id

Also accepts --workspace and --project — see Configuration.

beryl beryl runs get <run-id>

Show one run with its per-test results

Over MCP the failure screenshots come back as viewable image content, so an agent can look at the page that broke instead of guessing from the error string. Set screenshots to false to skip fetching them. Ignored outside MCP — the terminal cannot show an image.

  • run-idRun id
  • --screenshots Attach failure screenshots as image content (MCP only; default true)

Also accepts --workspace and --project — see Configuration.

beryl beryl runs watch <run-id>

Attach to a run and stream progress until it finishes

Replays what already happened, then follows live. Exits 0 only if every test passed.

  • run-idRun id
  • --timeout <number> Max minutes to wait

Also accepts --workspace and --project — see Configuration.

beryl beryl runs cancel <run-id>

Cancel an in-flight run

  • run-idRun id

Also accepts --workspace and --project — see Configuration.

beryl beryl runs report <run-id>

Show the generated report for a run

  • run-idRun id

Also accepts --workspace and --project — see Configuration.

beryl beryl runs download <run-id>

Download a run's results, with its artifacts, to disk

With --dir, fetches the artifact bytes — screenshots, DOM snapshots, the Playwright trace zip, and the filmstrip frames of the failing tests — into <dir>/<test-result-id>/ alongside a run.json manifest. Artifact URLs are short-lived, so download rather than stash them. With --out (or neither), writes only the JSON manifest.

  • run-idRun id
  • --dir <string> Write run.json plus the artifact files into this directory
  • --all-frames With --dir: also fetch the filmstrip frames of passing tests
  • --out <string> Write the JSON to a file instead of stdout

Also accepts --workspace and --project — see Configuration.

beryl runs download 7c1… --dir ./beryl-run
beryl runs download 7c1… --out run.json
beryl beryl runs explain <result-id>

AI explanation of why a test result failed

  • result-idTest result id (from `beryl runs get`)

Also accepts --workspace and --project — see Configuration.

beryl explorations

beryl beryl explorations list

List the agent's exploration passes for a project

Also accepts --workspace and --project — see Configuration.

beryl beryl explorations get <exploration-id>

Show one exploration: authored tests, abandoned flows, coverage, frontier

  • exploration-idExploration id

Also accepts --workspace and --project — see Configuration.

beryl beryl explorations steps <exploration-id>

List every step the agent took in an exploration

  • exploration-idExploration id

Also accepts --workspace and --project — see Configuration.

beryl beryl explorations watch <exploration-id>

Stream an exploration live — watch the agent explore and author tests

Replays every recorded step on connect, then follows live until the exploration completes or fails.

  • exploration-idExploration id
  • --timeout <number> Max minutes to wait

Also accepts --workspace and --project — see Configuration.

beryl config

beryl beryl config vars list

List the project's config variables (visible to the agent during runs)

Also accepts --workspace and --project — see Configuration.

beryl beryl config vars set <key> <value>

Create or update a config variable

  • keyVariable name
  • valueVariable value
  • --env <string> Scope to one environment id

Also accepts --workspace and --project — see Configuration.

beryl beryl config vars delete <key>

Delete a config variable

  • keyVariable key or id

Also accepts --workspace and --project — see Configuration.

beryl beryl config secrets list

List the project's secrets (values are never returned)

Also accepts --workspace and --project — see Configuration.

beryl beryl config secrets set <key> <value>

Create a secret (write-only; re-setting a key replaces it)

  • keySecret name
  • valueSecret value (or - to read from stdin)
  • --env <string> Scope to one environment id

Also accepts --workspace and --project — see Configuration.

beryl beryl config secrets delete <key>

Delete a secret

  • keySecret key or id

Also accepts --workspace and --project — see Configuration.

beryl beryl config files list

List files uploaded for the agent to use (e.g. CSVs, upload fixtures)

Also accepts --workspace and --project — see Configuration.

beryl beryl config files upload <file>

Upload a file

  • filePath to the local file
  • --env <string> Scope to one environment id

Also accepts --workspace and --project — see Configuration.

beryl beryl config files download <file-id>

Get a short-lived download URL for a file

  • file-idFile id

Also accepts --workspace and --project — see Configuration.

beryl beryl config files delete <file-id>

Delete an uploaded file

  • file-idFile id
  • --force Skip the confirmation prompt

Also accepts --workspace and --project — see Configuration.

beryl credentials

beryl beryl credentials list

List the workspace's saved logins

Also accepts --workspace — see Configuration.

beryl beryl credentials get <credential-id>

Show one saved login (status and freshness — never the session itself)

  • credential-idCredential id
beryl beryl credentials projects <credential-id>

List the projects using a saved login

  • credential-idCredential id
beryl beryl credentials delete <credential-id>

Delete a saved login

  • credential-idCredential id
  • --force Skip the confirmation prompt
beryl beryl credentials attach <credential-id>

Attach a saved login to a project

  • credential-idCredential id

Also accepts --workspace and --project — see Configuration.

beryl beryl credentials detach

Detach the project's saved login

Also accepts --workspace and --project — see Configuration.

beryl beryl credentials recapture <credential-id>

Start a re-capture for an expiring saved login (returns a live browser URL)

  • credential-idCredential id
beryl beryl credentials capture

Capture a login for the project interactively: log in once in a real browser (interactive)

Opens a live cloud-browser session on the project's site. Log in there like a normal user, come back, and press Enter — Beryl captures the session (encrypted at rest, never shown to anyone) so the agent can test the authenticated app.

Also accepts --workspace and --project — see Configuration.

beryl auth-capture

beryl beryl auth-capture start

Start a login-capture browser session for the project (non-interactive)

Also accepts --workspace and --project — see Configuration.

beryl beryl auth-capture capture <session-id>

Capture the session after the user has logged in via the live-view URL

  • session-idSession id from auth-capture start

Also accepts --workspace and --project — see Configuration.

beryl beryl auth-capture refresh <session-id>

Capture a refreshed session for a project whose login is expiring

  • session-idSession id from auth-capture start

Also accepts --workspace and --project — see Configuration.

beryl beryl auth-capture release <session-id>

Release a login-capture browser session without capturing

  • session-idSession id from auth-capture start

Also accepts --workspace and --project — see Configuration.

beryl account

beryl beryl account get

Show your account profile

beryl beryl account update

Update your profile

  • --name <string> New display name
  • --newsletter Toggle the newsletter subscription
beryl beryl account deletion-preview

Preview what deleting your account would remove or leave

beryl feedback

beryl beryl feedback send <message>

Send product feedback to the Beryl team

  • messageYour feedback

beryl billing

beryl beryl billing usage

Show plan usage: services and weekly AI units

Also accepts --workspace — see Configuration.

beryl beryl billing subscription

Show the workspace's subscription

Also accepts --workspace — see Configuration.

beryl beryl billing invoices

List recent invoices

  • --limit <number> How many invoices

Also accepts --workspace — see Configuration.

beryl beryl billing portal

Get a Stripe billing-portal link for the workspace

Also accepts --workspace — see Configuration.

beryl mcp

beryl beryl mcp

Run the Beryl MCP server (stdio) — every CLI command as an agent tool

Exposes the CLI's commands as MCP tools over stdio, so coding agents (Claude Code, Cursor, …) can create projects, trigger runs, watch the agent, and edit tests. Authenticate via BERYL_API_KEY or a prior `beryl login`.

claude mcp add beryl -- beryl mcp