badgr-cli

Badgr supports many GPU workloads through two commands: serve for persistent endpoints, run for jobs.
Safety promise: every run has --max-cost, live logs, automatic teardown, and a receipt. Run badgr down <id> any time to stop billing immediately.
npm install -g badgr-cli
Jump to: Quick start · Coding agents (badgr launch) · Image generation · badgr doctor · badgr diagnose · Commands · serve options · run options · Receipts · OpenAI compatibility · GPU options · Advanced · Requirements
Quick start
# 1. Authenticate once
badgr login
# 2. Verify the stack end-to-end
badgr test
# 3. Run a project folder on a GPU
badgr run . --cmd "python train.py" --max-cost 5
# 4. Serve an OpenAI-compatible inference endpoint
badgr serve meta-llama/Llama-3.1-8B-Instruct --max-cost 10
# 5. Stop billing
badgr down <deployment-id>
# 6. View cost, route, and retry receipts
badgr receipts
badgr serve prints a URL you can point any OpenAI SDK client at — see OpenAI compatibility.
Coding & testing agents: badgr launch
Run a coding agent or a test suite on a CPU VM with one command — no image, source, or --max-cost required for the four built-in workloads. Three separate things are going on here, worth keeping straight: which agent CLI runs (cline, claude, codex, playwright), who pays for model usage (Badgr, or your own Anthropic/OpenAI account), and who provisions the VM and runs the command (always Badgr).
badgr launch cline "Fix the checkout bug" # Badgr provides model access — no account to connect
badgr launch claude "Fix the checkout bug" # runs Claude Code — connect your Anthropic account
badgr launch codex "Write tests" # runs the Codex CLI — connect your OpenAI account
badgr launch playwright "Test the checkout flow" # no model account involved at all
Authentication model:
| Workload |
CLI that runs |
Who pays for model usage |
cline |
Cline |
Badgr provides and pays for model access |
claude |
Claude Code |
Your Anthropic account — Badgr only provides the VM |
codex |
Codex CLI |
Your OpenAI/ChatGPT account — Badgr only provides the VM |
playwright |
Playwright |
No model account required |
Installing/running the claude or codex CLI doesn't by itself give a disposable Badgr VM model access — the CLI still needs to authenticate, and a VM's sign-in doesn't inherit from your laptop. badgr launch claude/badgr launch codex prompt inline the first time to connect your account and store it for next time; cline and playwright need nothing. Each workload picks its own VM size automatically (small, or browser for playwright's preinstalled Chromium) — override with --size small|medium|browser. A $2 default --max-cost applies unless you pass your own.
Today, "connect your account" means securely storing an API key (ANTHROPIC_API_KEY / OPENAI_API_KEY) — both Claude Code and the Codex CLI also support signing in via a Claude.ai/ChatGPT account, and a future version of badgr connect may add that OAuth flow instead of a pasted key; the one-time-connection UX is the same either way.
badgr connect anthropic --key sk-ant-... # connect your Anthropic account ahead of time (optional — badgr launch prompts inline if missing)
badgr connect # list what's already connected
badgr connect anthropic --remove # disconnect
Retrieve results after a run finishes:
badgr pull <deployment-id> # pull a code-editing agent's patch as a local git diff/branch
badgr artifacts <deployment-id> # download everything else — test reports, screenshots, traces
Bare-task form — no agent name, no repo flags
For a quick "go fix this" against a repo you're already sitting in, skip the agent name and let Badgr resolve everything else:
badgr launch "Fix the checkout bug"
This resolves a repo (explicit --repo → the current local git repo → the last repo a bare-task launch verified against), infers an acceptance/"done" command from the repo's own evidence (package.json scripts.test, pytest, a Makefile target, or CI config — never a guessed shell command), and runs it as the verification gate by default instead of trusting the agent's own "done" claim. Result is reported as ✓ Verified (with the commit/PR it produced) or NOT VERIFIED — never inferred from the agent's own text.
badgr launch "Fix the checkout bug" --repo https://github.com/org/repo # explicit repo, skips resolution
badgr launch "Fix the checkout bug" --check "npm test" # explicit acceptance command, skips inference
If no repo can be resolved, or no acceptance command can be inferred, launch fails and asks for --repo/--check rather than launching unverified. A repo only gets remembered for next time once a launch against it actually verifies.
Advanced escape hatch — any other command
For anything beyond the four built-in workloads, run an arbitrary command on a CPU VM the same way badgr run does for GPU jobs:
badgr launch . --max-cost 1 -- npm test
badgr launch https://github.com/user/repo --max-cost 1 -- python narrgo.py
Everything before -- is a badgr launch flag; everything after -- is passed to your command verbatim, including anything that looks like a flag (badgr launch . -- claude --max-cost 1 sends --max-cost 1 to claude, not to Badgr). The default runner image has no Node.js/npm — use --image <image> for anything that needs it.
| Flag |
Default |
Description |
--cmd "<command>" |
— |
Quoted command form, equivalent to -- <command> |
--image <image> |
CPU runtime default |
Custom image instead of the default |
--detach / --no-detach |
detach |
launch detaches by default; --no-detach streams logs and waits |
--env KEY=VALUE |
— |
Environment variable (repeatable) — Badgr warns if a value looks like a secret |
--artifacts <path> |
— |
Extra path to capture and upload (repeatable), e.g. --artifacts playwright-report. Retrieve with badgr artifacts <id> |
--max-cost <$> |
$2 |
Auto-stop when spend reaches this amount |
--max-runtime <min> |
60 |
Auto-stop after N minutes |
--region US\|EU\|AU |
— |
Region preference |
--size small\|medium\|browser |
per-workload default |
VM class override |
badgr job — a tracked coding-agent job
badgr job cline "Run the Chromium tests and tell me what failed" --check "npm run test:chromium" --max-cost 1
Submits via POST /v1/jobs (type: "agent") — the same Jobs API used by every other job type. Requires --check <command> (verifies success); tracked at /jobs with a job_id, status, logs, output, cost, and time.
Also try: image generation
badgr comfyui batch --workflow sdxl-basic --prompt "a cat on a beach" --max-cost 5
Runs a blessed ComfyUI workflow, no setup, and prints image URLs when done. No manual teardown needed — it stops itself. Details in badgr comfyui batch options.
Apps: badgr apps
badgr apps list --available
badgr apps deploy ollama --target local
badgr apps deploy vllm --target cloud --model Qwen/Qwen2.5-7B-Instruct --max-cost 5
badgr apps list | status | logs | stop | start | down <app-id>
Seven pinned apps (ComfyUI, OpenClaw, Hermes Agent, vLLM, Ollama, OpenHands, Open WebUI), run on your Docker engine or on Badgr cloud where supported. Full reference: docs/badgr-apps.md.
Something not working? badgr doctor
Read-only diagnosis for GPU workload failures — checks your GPU, drivers,
CUDA, PyTorch, and disk, then tells you what's likely wrong and what to try
next. No login, no setup, never mutates your machine.
badgr doctor
# A model won't fit / you're not sure it'll fit before you try
badgr doctor --model meta-llama/Llama-3.1-8B-Instruct
# You have an error from a crashed job — save it to a file first
badgr doctor --logs error.log
# A ComfyUI workflow is failing or referencing something missing
badgr doctor --workflow my-workflow.json
# You started a server and it's not responding (ComfyUI, llama.cpp, and
# generic health formats are recognized too, not just OpenAI-style)
badgr doctor --url http://localhost:8000/v1/models
# Splitting a big model across multiple GPUs (tensor parallel)
badgr doctor --model meta-llama/Llama-3.1-70B-Instruct-AWQ --serve --gpu-count 2
# Machine-readable output for scripts/CI
badgr doctor --json
Run badgr doctor --help for the full flag list. Details in
docs/gpu-doctor.md.
Badgr Smoke Test: badgr diagnose
Paste a GitHub issue, a Docker image, a repo URL, a log file, a ComfyUI
workflow, or a raw conversation — Badgr auto-detects the input, redacts
secrets, and runs free static checks as part of a Badgr Smoke Test.
Nothing runs on a GPU without explicit --approve.
# Free Badgr Smoke Test — no login required
badgr diagnose "https://github.com/org/repo/issues/123"
badgr diagnose ajayrajtp/vllm_gemma412b:latest
badgr diagnose ./vllm-error.log
badgr diagnose "https://github.com/org/repo"
badgr diagnose workflow.json
# Free mechanical validation of the produced command — still no GPU, no login
badgr diagnose "https://github.com/org/repo/issues/123" --smoke
# Approve a capped smoke test after diagnosis (login required)
badgr diagnose "https://github.com/org/repo/issues/123" --approve
# Resume an existing case, e.g. one shared via a case link
badgr diagnose repro_xxxxxxxx --approve
badgr diagnose "https://aibadgr.com/repro/repro_xxxxxxxx" --approve
# Machine-readable output
badgr diagnose "https://github.com/org/repo/issues/123" --json