Skip to Content
HeyBug docs
Concepts

Apply only or apply and run

A plan is the set of tests HeyBug proposes for your app.

A plan is the set of tests HeyBug proposes for your app. Approving it saves the plan as a new version. You can save it on its own, or save it and run it straight away.

What it is for

After an exploration, the agent proposes a plan as a pending card. Nothing changes until you apply it. Applying turns the card into the current plan, and each apply makes a new plan version, so you can always see what changed.

Apply only versus apply and run

Apply onlyApply and run
Saves the plan as a new versionYesYes
Starts a run nowNoYes
Shortcut in the web appCtrl+S (Cmd+S on Mac)Ctrl+Enter (Cmd+Enter on Mac)
Use it whenYou want to edit or review tests before runningThe plan looks right and you want results now

Apply only is enabled when you have changed something. Apply and run is always available when the plan has tests.

Steps in the web app

  1. Open your project and go to the plan page at /p/<project-id>/plan.
  2. Review the tests. Edit, add or remove tests as needed, or pick the ones you want to keep.
  3. Read the bar at the bottom. It shows how many tests are selected and how many are new, edited or removed.
  4. Choose Apply only, or choose Apply and run to run now.
  5. To run a subset, open the menu next to the primary button and pick Run all, Run edited and new only or Run selected only.
  6. Use Discard to drop your edits before applying.

A toast confirms the result, for example "Plan saved as version 3." or "Plan saved. Run #12 started."

Working example

Command line

The apply command approves the pending card for your project. Set the project once with HEYBUG_PROJECT, or pass --project.

# Save the plan only
heybug apply --project <project-id>

# Save the plan and run it
heybug apply --project <project-id> --run

# Save the plan, but only keep the cases you name, and run them
heybug apply --project <project-id> --only login-works,checkout-totals --run

Without --card, the command uses the first pending card. Pass --card <card-id> to pick one. --exclude takes the same comma-separated case keys as --only.

To read the proposed steps before you apply, ask for them with --steps. It works with heybug plan and heybug status:

heybug plan --project <project-id> --steps "Check that guest checkout completes"
heybug status --project <project-id> --wait --steps

Each case prints its title, then its numbered steps, and the expected outcome under the step that checks it. In JSON output the same cases are in the steps list.

MCP tool call

With the MCP server connected (see MCP), an assistant can call heybug_apply_plan. It applies the current plan as a new version and keeps every case. caseKeys limits the run, not the saved plan.

{
  "name": "heybug_apply_plan",
  "arguments": {
    "projectId": "<project-id>",
    "caseKeys": ["login-works"],
    "run": true
  }
}

The result reports the new plan version and, when run is true, a link to the run.

To apply the pending card and run its tests in one step, call heybug_generate_and_run instead.

When it fails

  • "The plan changed since you opened it." Someone else applied a newer version while you were editing. Reload the plan page, check what changed, and apply again.
  • "Pick at least one case to apply." Your selection is empty. Select at least one test.
  • "Plan saved. The run could not start." The plan is saved, but the run did not start. Open the plan page and choose Run all, or check the run history.
  • "No pending card for this project" (command line). There is nothing to approve. Ask the agent for a new plan with heybug plan, then apply it.
  • A card that was already applied. It is no longer pending, so applying it again fails. Reload the plan page to see the current version.

If none of these match, check Troubleshooting. For the exit codes the command returns, see CLI.

  • Getting started: from sign-up to your first plan.
  • Results: read what a run found.
  • CLI: every command and exit code.
  • MCP: connect an assistant to HeyBug.

On this page