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 credentialsbandit whoami
bandit whoamiShow the current user and companybandit switch
bandit switchSwitch the active companybandit 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 projectbandit funnels
Manage funnels, which hold experiments and learn from one reward per visitor
bandit funnels list [options]List all funnelsOptions
- --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 campaignsOptions
- --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 sendingArguments
- 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 dashboardArguments
- id
- Required.
bandit experiments
Manage experiments
bandit experiments list [options]List all experimentsOptions
- --json
- Print the experiments as JSON
bandit experiments get <id>Get experiment detailsArguments
- 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 experimentArguments
- id
- Required.
bandit experiments start <id>Start an experiment (set status to active)Arguments
- id
- Required.
bandit experiments pause <id>Pause an experimentArguments
- id
- Required.
bandit treatments
Manage treatments
bandit treatments list <experimentId> [options]List treatments for an experimentArguments
- 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 1bandit treatments update <id>Update a treatmentArguments
- id
- Required.
bandit treatments close <id>Archive a treatment: stop serving it and keep its historyArguments
- id
- Required.
bandit treatments reopen <id>Serve a closed treatment againArguments
- 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.