Skip to Content
HeyBug docs
CLI

Manage projects from the command line

The `@@CLI@@ project` command lists, creates, shows and archives projects.

The heybug project command lists, creates, shows and archives projects. Use it from a terminal or a script when you do not want to open the web app. Every command talks to the same server as the web app, so it shows the same projects for the same workspace.

What it is for

A project is one website you test, with its address, its test plan and its runs. Use the command to:

  • see which projects exist, and their IDs;
  • add a site before you start a run on it;
  • check one project's address, plan and case count;
  • archive a project you no longer test.

Before you start

Set two environment variables. The command never prompts for them.

VariableWhat to set it to
HEYBUG_TOKENAn API token. Create one in Settings > API tokens.
HEYBUG_SERVERYour server's address. If you leave it out, the command uses http://localhost:8080.

To save the token for later sessions, pipe it into heybug auth login --token-stdin. Check the saved sign-in with heybug auth status. Browser sign-in with heybug login is not in this build, so use a token.

The steps

  1. List your projects to find an ID: heybug project list.
  2. Create a project for a new site: heybug project create --url <address>. Add --name to set a display name; without it, the host name is used.
  3. Look at one project: heybug project get <id>. The ID can come before or after the flags.
  4. Archive a project you no longer test: heybug project archive <id>. An archived project leaves the list.

For scripts, add --output json to any command. The output is then JSON, which you can read with jq.

Example

The output below is a real run of the command against a test server, with made-up data. Your IDs and counts will differ.

export HEYBUG_SERVER=https://opentest.nagara.cloud
export HEYBUG_TOKEN=<your token>

heybug project create --url https://shop.example.com --name Shop
heybug project list
heybug project get prj_9f2c
heybug project archive prj_9f2c
Created project Shop (prj_new1)

ID        NAME  URL                       CASES  STATE
prj_9f2c  Shop  https://shop.example.com  12     active

Shop  active
id: prj_9f2c
url: https://shop.example.com
plan: plan_41
cases: 12
description:

Archived project prj_9f2c

For a script, pass --output json. Archive prints this:

{
  "archived": true,
  "id": "prj_9f2c"
}

Exit codes

CodeWhen it happens
0The command worked.
2A flag or argument is missing, or --output is not text or json. Nothing is sent to the server.
3HEYBUG_TOKEN is not set, or the server rejected the token.
4No project has that ID.
5The server rejected the input, for example an address it does not accept.
6The server could not be reached, or it failed.

Every code is listed in CLI exit codes.

The same actions in MCP

Your coding agent can use the same actions through MCP. heybug_list_projects lists projects, and heybug_create_project adds one. Getting and archiving a project are CLI commands only for now.

When it fails

MessageWhat it meansWhat to do
project create needs --urlThe site address is missing.Add --url https://....
project get needs a project idNo ID was given.Pass the ID as an argument or with --id. Get it from heybug project list.
--output must be text or jsonThe output value is wrong.Use --output text or --output json.
HEYBUG_TOKEN is not set (exit 3)The command has no token.Create a token and export it.
Exit 3 with a rejected tokenThe token is wrong, expired or revoked.Create a new token and export it again.
A "not found" message (exit 4)The ID is wrong, or the project belongs to another workspace.Run heybug project list and copy the ID again.
Exit 5The server did not accept a value, such as an address it refuses.Read the message, fix the value and run the command again.
Exit 6The server is not reachable, or it failed.Check HEYBUG_SERVER, then run heybug doctor.

On this page