CLI Reference

Manage your experiments from the terminal. Install in one command — no Node.js required.

Installation

Install the latest release for macOS or Linux (Apple Silicon or Intel/x64):

curl -fsSL http://runbandit.com/api/install.sh | bash

The installer detects your platform, downloads the matching binary, and installs it to /usr/local/bin/bandit. Windows is not supported natively — use WSL and follow the Linux instructions above.

bandit login

bandit login [options]Authenticate with the Bandit Platform. Opens an OAuth flow in your browser and stores the session locally.

Options

--dashboard-url <url>
Dashboard URL Defaults to https://app.runbandit.com.

Log in through your browser

bandit login

bandit logout

bandit logoutLog out, revoke the CLI token, and clear stored credentials

bandit whoami

bandit whoamiShow the current user and company

bandit switch

bandit switchSwitch the active company

bandit doctor

bandit doctor [options]Show how far setup has gotten, what to do next, and each active funnel model health. Exits 0 only when every setup stage passes.

Options

--json
Print the setup status and per-funnel model health as JSON

bandit init

bandit initInitialize the Bandit SDK in the current project

bandit funnels

Manage funnels, which hold experiments and learn from one reward per visitor

bandit funnels list [options]List all funnels

Options

--json
Print the funnels as JSON

Print the funnels as JSON for a script

bandit funnels list --json
bandit funnels create [options]Create an empty funnel. Prompts for the name when --name is not given. Add experiments with `bandit experiments create --funnel <id>`.

Options

--name <name>
Funnel name
--description <text>
Description
--payout-unit <unit>
count (each conversion is 1, the default), revenue (the order value you send) or margin (revenue minus cost, from orders)

Create a funnel that learns from order revenue

bandit funnels create --name "Checkout" --payout-unit revenue

bandit campaigns

Manage campaigns

bandit campaigns list [options]List all campaigns

Options

--json
Print the campaigns as JSON
bandit campaigns create [options]Create an empty campaign. Add experiments with `bandit experiments create --campaign <id>`.

Options

--name <name>
Campaign name
--description <text>
Description
bandit campaigns start <id> [options]Start sending: record the tracked links and move the campaign to sending

Arguments

id
Required.

Options

--link <url...>
Destination URL to track (repeatable); the list is fixed once sending starts

Start sending and track two destination links

bandit campaigns start <id> --link https://example.com/sale --link https://example.com/new
bandit campaigns sent <id>Mark the campaign sent, which unlocks fold-up in the dashboard

Arguments

id
Required.

bandit experiments

Manage experiments

bandit experiments list [options]List all experiments

Options

--json
Print the experiments as JSON
bandit experiments get <id>Get experiment details

Arguments

id
Required.
bandit experiments create [options]Create a new experiment inside a funnel or a campaign. Prompts for a funnel when neither --funnel nor --campaign is given. With --name nothing prompts, and unset flags take the defaults the prompts preselect.

Options

--funnel <id>
Funnel to add the experiment to
--campaign <id>
Campaign to add the experiment to
--name <name>
Experiment name
--description <text>
Description
--content-type <type>
Content type (one of text, code, file)
--content-subtype <subtype>
Content subtype, for example plain_text or html
--trial-on <rule>
When a trial counts: served (default) or exposure, once the visitor sees it. Fixed at creation (one of served, exposure)
--treatment <name=config>
Treatment created with the experiment, repeatable. Config is JSON or plain text. Weights are equal.

Create an experiment without prompts. Repeat --treatment for each variant

bandit experiments create --funnel <id> --name <name> --treatment 'Control={"headline":"..."}' --treatment 'Variant={"headline":"..."}'
bandit experiments update <id>Update an experiment

Arguments

id
Required.
bandit experiments start <id>Start an experiment (set status to active)

Arguments

id
Required.
bandit experiments pause <id>Pause an experiment

Arguments

id
Required.

bandit treatments

Manage treatments

bandit treatments list <experimentId> [options]List treatments for an experiment

Arguments

experimentId
Required.

Options

--json
Print the treatments as JSON
bandit treatments create <experimentId> [options]Create a new treatment. Prompts for anything not given when --name is absent. With --name nothing prompts, and --config is required.

Arguments

experimentId
Required.

Options

--name <name>
Treatment name
--config <config>
Config as JSON, or plain text stored as {"value": ...}
--weight <weight>
Weight, a positive number (default 1)

Add a treatment to an experiment

bandit treatments create <experimentId> --name Variant --config '{"headline":"..."}' --weight 1
bandit treatments update <id>Update a treatment

Arguments

id
Required.
bandit treatments close <id>Archive a treatment: stop serving it and keep its history

Arguments

id
Required.
bandit treatments reopen <id>Serve a closed treatment again

Arguments

id
Required.

bandit mcp

bandit mcpRun the Bandit MCP server on stdio for AI agents. It relays to your dashboard's hosted /mcp endpoint with your `bandit login` session and `bandit switch` company. See the MCP docs.

Configuration

Credentials and the active company are stored at ~/.bandit/config.json. Delete this file or run bandit logout to remove them.