badgr-cli 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +126 -1
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -36,6 +36,76 @@ badgr receipts
36
36
 
37
37
  ---
38
38
 
39
+ ## Coding & testing agents: `badgr launch`
40
+
41
+ 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).
42
+
43
+ ```bash
44
+ badgr launch cline "Fix the checkout bug" # Badgr provides model access — no account to connect
45
+ badgr launch claude "Fix the checkout bug" # runs Claude Code — connect your Anthropic account
46
+ badgr launch codex "Write tests" # runs the Codex CLI — connect your OpenAI account
47
+ badgr launch playwright "Test the checkout flow" # no model account involved at all
48
+ ```
49
+
50
+ **Authentication model:**
51
+
52
+ | Workload | CLI that runs | Who pays for model usage |
53
+ |----------|---------------|---------------------------|
54
+ | `cline` | Cline | Badgr provides and pays for model access |
55
+ | `claude` | Claude Code | Your Anthropic account — Badgr only provides the VM |
56
+ | `codex` | Codex CLI | Your OpenAI/ChatGPT account — Badgr only provides the VM |
57
+ | `playwright` | Playwright | No model account required |
58
+
59
+ 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.
60
+
61
+ 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.
62
+
63
+ ```bash
64
+ badgr connect anthropic --key sk-ant-... # connect your Anthropic account ahead of time (optional — badgr launch prompts inline if missing)
65
+ badgr connect # list what's already connected
66
+ badgr connect anthropic --remove # disconnect
67
+ ```
68
+
69
+ Retrieve results after a run finishes:
70
+
71
+ ```bash
72
+ badgr pull <deployment-id> # pull a code-editing agent's patch as a local git diff/branch
73
+ badgr artifacts <deployment-id> # download everything else — test reports, screenshots, traces
74
+ ```
75
+
76
+ ### Advanced escape hatch — any other command
77
+
78
+ 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:
79
+
80
+ ```bash
81
+ badgr launch . --max-cost 1 -- npm test
82
+ badgr launch https://github.com/user/repo --max-cost 1 -- python narrgo.py
83
+ ```
84
+
85
+ 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.
86
+
87
+ | Flag | Default | Description |
88
+ |------|---------|-------------|
89
+ | `--cmd "<command>"` | — | Quoted command form, equivalent to `-- <command>` |
90
+ | `--image <image>` | CPU runtime default | Custom image instead of the default |
91
+ | `--detach` / `--no-detach` | detach | `launch` detaches by default; `--no-detach` streams logs and waits |
92
+ | `--env KEY=VALUE` | — | Environment variable (repeatable) — Badgr warns if a value looks like a secret |
93
+ | `--artifacts <path>` | — | Extra path to capture and upload (repeatable), e.g. `--artifacts playwright-report`. Retrieve with `badgr artifacts <id>` |
94
+ | `--max-cost <$>` | `$2` | Auto-stop when spend reaches this amount |
95
+ | `--max-runtime <min>` | 60 | Auto-stop after N minutes |
96
+ | `--region US\|EU\|AU` | — | Region preference |
97
+ | `--size small\|medium\|browser` | per-workload default | VM class override |
98
+
99
+ ### `badgr task` — a labeled launch
100
+
101
+ ```bash
102
+ badgr task "Run the Chromium tests and tell me what failed" --max-cost 1 -- npm run test:chromium
103
+ ```
104
+
105
+ A thin wrapper over `badgr launch . -- <command>` — the description is printed for the human and otherwise discarded; the receipt and `badgr status` still key off the deployment ID like any other launch.
106
+
107
+ ---
108
+
39
109
  ## Also try: image generation
40
110
 
41
111
  ```bash
@@ -86,11 +156,16 @@ Run `badgr doctor --help` for the full flag list. Details in
86
156
 
87
157
  ```text
88
158
  login
159
+ connect
89
160
  doctor
90
161
  run
162
+ launch
163
+ task
91
164
  serve
92
165
  status
93
166
  logs
167
+ pull
168
+ artifacts
94
169
  down
95
170
  receipts
96
171
  test
@@ -99,16 +174,21 @@ test
99
174
  | Command | What it does |
100
175
  |---------|-------------|
101
176
  | `badgr login` | Save API key to `~/.badgr/config.json` |
177
+ | `badgr connect <provider>` | Store a provider credential (`anthropic`, `openai`) for `badgr launch` |
102
178
  | `badgr doctor` | Diagnose a GPU workload failure — read-only, no login needed |
103
179
  | `badgr run <command>` | Run a one-off GPU job (any container command) |
180
+ | `badgr launch cline\|claude\|codex\|playwright "<task>"` | Run a coding/testing agent on a CPU VM — image + command auto-selected |
181
+ | `badgr task "<desc>" -- <command>` | Label + launch — thin wrapper over `badgr launch . -- <command>` |
104
182
  | `badgr serve <model>` | Start a persistent OpenAI-compatible endpoint |
105
183
  | `badgr status` | Show what's running and what's billing |
106
184
  | `badgr logs <id>` | Fetch log output from a deployment |
185
+ | `badgr pull <id>` | Pull a code-editing agent's patch as a local git diff/branch |
186
+ | `badgr artifacts <id>` | Download non-patch outputs (test reports, screenshots, traces) |
107
187
  | `badgr down <id>` | Terminate a deployment — stops billing immediately |
108
188
  | `badgr receipts [n]` | Cost, route, and retry receipts (default 10) |
109
189
  | `badgr test` | Run an end-to-end test (provision → run → teardown) |
110
190
 
111
- More commands below, under [Advanced](#advanced): `comfyui`, `train`, `transcribe`, `embed`, `workload`, `workspace`, `capacity`, `billing`.
191
+ More commands below, under [Advanced](#advanced): `comfyui`, `train`, `transcribe`, `embed`, `workload`, `workspace`, `batch`, `sbatch`, `capacity`, `billing`.
112
192
 
113
193
  `badgr serve` — for anything that needs a persistent endpoint: LLM serving, embeddings, image generation APIs, transcription APIs.
114
194
 
@@ -407,6 +487,51 @@ badgr workspace list
407
487
  badgr workspace delete my-project
408
488
  ```
409
489
 
490
+ ### `badgr batch` — generic containerized batch jobs
491
+
492
+ ```bash
493
+ badgr batch run workload.yml
494
+ badgr batch status dep-abc123
495
+ badgr batch artifacts dep-abc123
496
+ badgr batch receipt dep-abc123
497
+ badgr batch compare dep-abc123 dep-def456
498
+ ```
499
+
500
+ For CV/video/scientific batch, simulation, and physical-AI eval workloads — runs a container from a `workload.yml` spec and captures output artifacts automatically.
501
+
502
+ **Fan-out** — run the same program once per file in a directory, one deployment per input, in parallel:
503
+
504
+ ```bash
505
+ badgr batch run workload.yml --fan-out ./scenarios
506
+ badgr batch run workload.yml --fan-out ./scenarios --max-concurrency 10
507
+ badgr batch run workload.yml --fan-out ./scenarios --only failed1.json,failed2.json
508
+ ```
509
+
510
+ `workload.yml` must declare exactly one `inputs:` entry (the path that varies per task).
511
+
512
+ | Flag | Default | Description |
513
+ |------|---------|-------------|
514
+ | `--fan-out <dir>` | — | Run once per file in this directory instead of a single job |
515
+ | `--max-concurrency <n>` | 5 | Cap in-flight fan-out deployments |
516
+ | `--only <f1,f2>` | — | Rerun just the named input files |
517
+ | `--dry-run` | — | Preview the batch/fan-out plan without provisioning |
518
+
519
+ ### `badgr sbatch` — existing Slurm scripts
520
+
521
+ ```bash
522
+ badgr sbatch job.slurm
523
+ badgr sbatch job.slurm --dry-run
524
+ badgr sbatch array_job.slurm # #SBATCH --array=1-100 fans out into one deployment per task
525
+ badgr sbatch array_job.slurm --max-concurrency 10
526
+ ```
527
+
528
+ Translates `--cpus-per-task`/`--mem`/`--gres`/`--time`/`--export` from a real `.slurm` file. `#SBATCH --array=...` directives fan out into bounded-concurrency deployments the same way `batch run --fan-out` does; unsupported directives (`--partition`, `--qos`, `--account`) print a visible warning but don't block translation of the rest.
529
+
530
+ | Flag | Default | Description |
531
+ |------|---------|-------------|
532
+ | `--max-concurrency <n>` | 5 | Cap in-flight array tasks |
533
+ | `--dry-run` | — | Preview the translated job without provisioning |
534
+
410
535
  ### Other commands
411
536
 
412
537
  - `badgr capacity [--gpu <type>]` — check available GPU capacity right now
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "badgr-cli",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Badgr — run or serve GPU workloads from one command",
5
5
  "type": "module",
6
6
  "bin": {