badgr-cli 1.1.2 → 1.1.4

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.
package/README.md CHANGED
@@ -13,7 +13,7 @@ Badgr supports many GPU workloads through two commands: `serve` for persistent e
13
13
  npm install -g badgr-cli
14
14
  ```
15
15
 
16
- **Jump to:** [Quick start](#quick-start) · [Coding agents (`badgr launch`)](#coding--testing-agents-badgr-launch) · [Image generation](#also-try-image-generation) · [`badgr doctor`](#something-not-working-badgr-doctor) · [Commands](#commands) · [`serve` options](#badgr-serve-options) · [`run` options](#badgr-run-options) · [Receipts](#receipts) · [OpenAI compatibility](#openai-compatibility) · [GPU options](#gpu-options) · [Advanced](#advanced) · [Requirements](#requirements)
16
+ **Jump to:** [Quick start](#quick-start) · [Coding agents (`badgr launch`)](#coding--testing-agents-badgr-launch) · [Image generation](#also-try-image-generation) · [`badgr doctor`](#something-not-working-badgr-doctor) · [`badgr diagnose`](#diagnose-a-gpu-issue-badgr-diagnose) · [Commands](#commands) · [`serve` options](#badgr-serve-options) · [`run` options](#badgr-run-options) · [Receipts](#receipts) · [OpenAI compatibility](#openai-compatibility) · [GPU options](#gpu-options) · [Advanced](#advanced) · [Requirements](#requirements)
17
17
 
18
18
  ---
19
19
 
@@ -103,13 +103,13 @@ Everything before `--` is a `badgr launch` flag; everything after `--` is passed
103
103
  | `--region US\|EU\|AU` | — | Region preference |
104
104
  | `--size small\|medium\|browser` | per-workload default | VM class override |
105
105
 
106
- ### `badgr task` — a labeled launch
106
+ ### `badgr job` — a tracked coding-agent job
107
107
 
108
108
  ```bash
109
- badgr task "Run the Chromium tests and tell me what failed" --max-cost 1 -- npm run test:chromium
109
+ badgr job cline "Run the Chromium tests and tell me what failed" --check "npm run test:chromium" --max-cost 1
110
110
  ```
111
111
 
112
- 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.
112
+ 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.
113
113
 
114
114
  ---
115
115
 
@@ -159,21 +159,80 @@ Run `badgr doctor --help` for the full flag list. Details in
159
159
 
160
160
  ---
161
161
 
162
+ ## Badgr Smoke Test: `badgr diagnose`
163
+
164
+ Paste a GitHub issue, a Docker image, a repo URL, a log file, a ComfyUI
165
+ workflow, or a raw conversation — Badgr auto-detects the input, redacts
166
+ secrets, and runs free static checks as part of a Badgr Smoke Test.
167
+ Nothing runs on a GPU without explicit `--approve`.
168
+
169
+ ```bash
170
+ # Free Badgr Smoke Test — no login required
171
+ badgr diagnose "https://github.com/org/repo/issues/123"
172
+ badgr diagnose ajayrajtp/vllm_gemma412b:latest
173
+ badgr diagnose ./vllm-error.log
174
+ badgr diagnose "https://github.com/org/repo"
175
+ badgr diagnose workflow.json
176
+
177
+ # Free mechanical validation of the produced command — still no GPU, no login
178
+ badgr diagnose "https://github.com/org/repo/issues/123" --smoke
179
+
180
+ # Approve a capped smoke test after diagnosis (login required)
181
+ badgr diagnose "https://github.com/org/repo/issues/123" --approve
182
+
183
+ # Resume an existing case, e.g. one shared via a case link
184
+ badgr diagnose repro_xxxxxxxx --approve
185
+ badgr diagnose "https://aibadgr.com/repro/repro_xxxxxxxx" --approve
186
+
187
+ # Machine-readable output
188
+ badgr diagnose "https://github.com/org/repo/issues/123" --json
189
+ ```
190
+
191
+ | Flag | Description |
192
+ |------|-------------|
193
+ | `--smoke` | Free. Runs real, cheap mechanical validation of the produced command (syntax, CLI-entrypoint corroboration, referenced-file presence, Docker `ENTRYPOINT`/`CMD` consistency, required env vars, plus a client-side check of any local file path you pasted). Never starts a GPU, never requires login. Combine with `--approve` — the smoke checks print first, then the normal approve flow runs. Not the same as `badgr run --smoke`, which launches a real, billable GPU job |
194
+ | `--approve` | Approve the capped smoke test after diagnosis (opens browser sign-in automatically if not logged in) |
195
+ | `--docker <image>` | Force Docker-image intake (override auto-detect) |
196
+ | `--repo <url>` | Force repository intake (override auto-detect) |
197
+ | `--comfyui <path>` | Force ComfyUI workflow intake (override auto-detect) |
198
+ | `--github <url>` | Include a GitHub issue URL found inside pasted text as additional context (opt-in, never fetched automatically) |
199
+ | `--json` | Machine-readable JSON output |
200
+
201
+ Every run prints one status: `NEEDS INFO` (fields still missing) →
202
+ `READY` (complete evidence-backed command, no smoke run) → `SMOKE CHECKED`
203
+ (`--smoke` ran, every applicable check passed or was skipped) / `INVALID`
204
+ (`--smoke` ran and a check actually failed) → `VERIFIED` (reserved for an
205
+ actual successful GPU-provisioned run — never assigned from static
206
+ resolution or `--smoke`). `READY`/`SMOKE CHECKED` results also print the
207
+ canonical `badgr run`/`badgr serve` command `--approve` would run, plus a
208
+ shareable case link — pass that case ID or URL back into `badgr diagnose
209
+ <case_id_or_url> --approve` to resume the same case without re-diagnosing.
210
+
211
+ `badgr run-issue` is an alias for `badgr diagnose`, matching the
212
+ [aibadgr.com/run-issue](https://aibadgr.com/run-issue) Badgr Smoke Test
213
+ web flow.
214
+
215
+ ---
216
+
162
217
  ## Commands
163
218
 
164
219
  ```text
165
220
  login
166
221
  connect
167
222
  doctor
223
+ diagnose
168
224
  run
169
225
  launch
170
- task
226
+ job
171
227
  serve
172
228
  status
173
229
  logs
174
230
  pull
175
231
  artifacts
176
232
  down
233
+ restart
234
+ rerun
235
+ heartbeat
177
236
  receipts
178
237
  test
179
238
  ```
@@ -183,19 +242,23 @@ test
183
242
  | `badgr login` | Save API key to `~/.badgr/config.json` |
184
243
  | `badgr connect <provider>` | Store a provider credential (`anthropic`, `openai`) for `badgr launch` |
185
244
  | `badgr doctor` | Diagnose a GPU workload failure — read-only, no login needed |
245
+ | `badgr diagnose "<input>"` | Run a Badgr Smoke Test on a GitHub issue, Docker image, repo, log, or workflow — free, no GPU until `--approve` |
186
246
  | `badgr run <command>` | Run a one-off GPU job (any container command) |
187
247
  | `badgr launch cline\|claude\|codex\|playwright "<task>"` | Run a coding/testing agent on a CPU VM — image + command auto-selected |
188
- | `badgr task "<desc>" -- <command>` | Label + launch thin wrapper over `badgr launch . -- <command>` |
248
+ | `badgr job <agent> "<instruction>" --check "<cmd>"` | Tracked coding-agent job via `POST /v1/jobs` (type: agent) |
189
249
  | `badgr serve <model>` | Start a persistent OpenAI-compatible endpoint |
190
250
  | `badgr status` | Show what's running and what's billing |
191
251
  | `badgr logs <id>` | Fetch log output from a deployment |
192
252
  | `badgr pull <id>` | Pull a code-editing agent's patch as a local git diff/branch |
193
253
  | `badgr artifacts <id>` | Download non-patch outputs (test reports, screenshots, traces) |
194
254
  | `badgr down <id>` | Terminate a deployment — stops billing immediately |
255
+ | `badgr restart <id>` | Relaunch an endpoint with the same config, on a new deployment ID, keeping its API key |
256
+ | `badgr rerun <id>` | Replay a past job or endpoint with its exact original spec, on a new deployment ID |
257
+ | `badgr heartbeat <id>` | Reset an endpoint's idle-timeout clock (see `--idle-timeout` under [`badgr serve` options](#badgr-serve-options)) |
195
258
  | `badgr receipts [n]` | Cost, route, and retry receipts (default 10) |
196
259
  | `badgr test` | Run an end-to-end test (provision → run → teardown) |
197
260
 
198
- More commands below, under [Advanced](#advanced): `comfyui`, `train`, `transcribe`, `embed`, `workload`, `workspace`, `batch`, `sbatch`, `capacity`, `billing`.
261
+ More commands below, under [Advanced](#advanced): `comfyui`, `train`, `transcribe`, `embed`, `workload`, `workspace`, `batch`, `sbatch`, `capacity`, `billing`, `models`, `template`.
199
262
 
200
263
  `badgr serve` — for anything that needs a persistent endpoint: LLM serving, embeddings, image generation APIs, transcription APIs.
201
264
 
@@ -228,16 +291,38 @@ Each command section below lists only its own extra flags.
228
291
  badgr serve meta-llama/Llama-3.1-8B-Instruct --gpu L40S --region EU
229
292
  ```
230
293
 
294
+ Endpoints bill continuously, so `serve` requires either `--max-cost` or `--persistent` (or `--dry-run` to just preview) — it refuses to start otherwise.
295
+
231
296
  | Flag | Default | Description |
232
297
  |------|---------|-------------|
233
298
  | `--image <img>` | — | Serve a custom container instead of a HuggingFace model |
234
299
  | `--task <task>` | — | vLLM task override, e.g. `embed` for embedding models |
235
- | `--health-path <path>` | auto | Readiness path to poll (auto-detected for ComfyUI `/system_stats`) |
300
+ | `--runtime llama.cpp\|ollama` | vLLM | Serve via a different runtime instead of vLLM |
301
+ | `--hf-repo <repo>` | — | HuggingFace repo for a GGUF file (with `--runtime llama.cpp`), e.g. `org/model-repo` |
302
+ | `--hf-file <file>` | — | GGUF filename within that repo, e.g. `model.gguf` (required with `--runtime llama.cpp`) |
303
+ | `--idle-timeout <min>` | — | Auto-stop after N minutes with no `badgr heartbeat` call — see [`badgr heartbeat`](#badgr-heartbeat) |
304
+ | `--persistent` | off | Run until manually stopped — satisfies the cost-control requirement in place of `--max-cost` |
305
+ | `--check-nodes <n1,n2>` | — | For ComfyUI-shaped images: verify custom nodes are installed after startup |
306
+ | `--health-path <path>` | auto | Readiness path to poll (auto-detected: ComfyUI → `/system_stats`, llama.cpp → `/health`) |
236
307
  | `--no-wait` | off | Skip endpoint health check and return immediately |
308
+ | `--yes` / `-y` | off | Skip duplicate-deployment warning |
309
+ | `--dry-run` | — | Preview the plan (GPU, price) without provisioning |
237
310
  | `--list-aliases` | — | List blessed vLLM model aliases (`qwen-7b`, `llama-8b`, `qwen-coder-7b`) and exit — no provisioning, no API key required |
238
311
 
239
312
  Blessed aliases expand to a full model ID + preset GPU, e.g. `badgr serve qwen-7b` → `Qwen/Qwen2.5-7B-Instruct` on an RTX 4090. Run `badgr serve --list-aliases` to see the current list.
240
313
 
314
+ ```bash
315
+ # Serve a Hugging Face GGUF file via llama.cpp instead of vLLM
316
+ badgr serve --runtime llama.cpp --hf-repo org/model-repo --hf-file model.gguf --max-cost 10
317
+
318
+ # Serve Open WebUI, a chat UI, pointed at a model endpoint
319
+ badgr serve openwebui --model qwen-7b --max-cost 10
320
+ badgr serve openwebui --connect <existing-endpoint-url> # connect to an endpoint you already have
321
+
322
+ # Auto-stop only when idle — requires periodic badgr heartbeat calls to stay up
323
+ badgr serve qwen-7b --idle-timeout 30 --max-cost 10
324
+ ```
325
+
241
326
  ### Model support levels
242
327
 
243
328
  `badgr serve qwen-7b` is the happy path — a tested route with no extra setup. `badgr serve` also accepts any other model ID or a custom container:
@@ -269,10 +354,21 @@ badgr run . --image mycompany/custom:latest --cmd "python train.py" --max-cost 5
269
354
 
270
355
  Badgr zips and uploads the folder (Flow 1) or clones the repo (Flow 2), picks a generic runner, installs deps, runs the command, stores outputs for 48 hours, and tears down the GPU. `--max-cost` is required.
271
356
 
357
+ ```bash
358
+ # No GPU needed — run on a plain CPU VM instead
359
+ badgr run . --cmd "npm test" --no-gpu --max-cost 1
360
+
361
+ # Describe basic compute needs instead of a GPU model — Badgr finds a compatible machine
362
+ badgr run . --cpu 16 --memory 64GB --gpu-memory 24GB --max-cost 5
363
+ ```
364
+
272
365
  | Flag | Default | Description |
273
366
  |------|---------|-------------|
274
367
  | `--cmd <command>` | — | Command to run inside the uploaded project or cloned repo (required for folder/GitHub flows) |
275
- | `--min-vram <GB>` | — | Minimum VRAM in GB — optional constraint for Auto routing |
368
+ | `--min-vram <GB>` | — | Minimum VRAM in GB — optional constraint for Auto routing (alias: `--gpu-memory`) |
369
+ | `--cpu <cores>` | — | Minimum CPU cores (for a CPU-only run) |
370
+ | `--memory <size>` | — | Minimum RAM, e.g. `64GB` |
371
+ | `--no-gpu` | off | Run on a CPU-only VM — no GPU is provisioned (conflicts with `--gpu`/`--min-vram`) |
276
372
  | `--image <img>` | — | Custom Docker image — bypasses the runner |
277
373
  | `--max-runtime <min>` | — | Auto-stop after N minutes |
278
374
  | `--save <name>` | — | Save this job as a named workload after it completes |
@@ -320,13 +416,14 @@ Productized batch image generation — runs a list of prompts through a **blesse
320
416
  ```bash
321
417
  badgr comfyui batch --workflow sdxl-basic --prompts prompts.txt --max-cost 10
322
418
  badgr comfyui batch --workflow sdxl-basic --prompt "a cat on a beach" --prompt "a dog in the park" --max-cost 5
419
+ badgr comfyui batch --workflow flux-basic --prompt "a neon city at night" --max-cost 5
323
420
  ```
324
421
 
325
- Blessed workflows: `sdxl-basic` (SDXL text-to-image, default sampler settings). Max 20 prompts per batch.
422
+ Blessed workflows: `sdxl-basic` (SDXL text-to-image, default sampler settings), `flux-basic` (FLUX.1-schnell text-to-image). Max 20 prompts per batch.
326
423
 
327
424
  | Flag | Default | Description |
328
425
  |------|---------|-------------|
329
- | `--workflow <name>` | — | Blessed workflow ID (required) — currently `sdxl-basic` |
426
+ | `--workflow <name>` | — | Blessed workflow ID (required) — `sdxl-basic` or `flux-basic` |
330
427
  | `--prompts <file>` | — | Text file, one prompt per line |
331
428
  | `--prompt <text>` | — | Inline prompt (repeatable) — combine with `--prompts` if needed |
332
429
  | `--max-runtime <min>` | 60 | Auto-stop after N minutes |
@@ -350,6 +447,37 @@ Each receipt includes runtime, estimated/settled cost, status, retries, teardown
350
447
 
351
448
  ---
352
449
 
450
+ ## Managing a deployment
451
+
452
+ ```bash
453
+ badgr status # what's running and billing
454
+ badgr logs dep-abc123 # fetch current log output
455
+ badgr logs dep-abc123 --follow # stream logs until the deployment reaches a terminal state
456
+ badgr pull dep-abc123 # pull a coding agent's patch as a local git diff
457
+ badgr pull dep-abc123 --branch # ...as a new local branch instead of a diff
458
+ badgr pull dep-abc123 --diff-only # print the diff, don't touch the working tree
459
+ badgr artifacts dep-abc123 # download non-patch outputs (test reports, screenshots, traces)
460
+ badgr down dep-abc123 # terminate one deployment, stop billing
461
+ badgr down --all # terminate everything running, with a confirmation prompt
462
+ badgr down --all --yes # ...skip the confirmation prompt
463
+ badgr restart dep-abc123 # relaunch an endpoint with the same config — new ID, same API key
464
+ badgr rerun dep-abc123 # replay a past job/endpoint with its exact original spec — new ID
465
+ badgr heartbeat dep-abc123 # reset an endpoint's idle-timeout clock (see --idle-timeout on badgr serve)
466
+ ```
467
+
468
+ | Command | Flag | Description |
469
+ |---------|------|-------------|
470
+ | `badgr logs <id>` | `--follow` / `-f` | Stream/poll logs until the deployment reaches a terminal state instead of a one-shot fetch |
471
+ | `badgr pull <id>` | `--branch` | Create a new local git branch from the patch instead of leaving it as an unstaged diff |
472
+ | `badgr pull <id>` | `--diff-only` | Print the raw diff, don't touch the local working tree at all |
473
+ | `badgr pull <id>` | `--yes` / `-y` | Skip the confirmation prompt before applying |
474
+ | `badgr down <id\|--all>` | `--all` | Terminate every running deployment instead of one by ID |
475
+ | `badgr down <id\|--all>` | `--yes` / `-y` | Skip the confirmation prompt |
476
+
477
+ `badgr restart` is endpoint-only (it tears down the current pod and relaunches with the same GPU/model/price/runtime caps and endpoint API key, so existing clients keep working against a new URL). `badgr rerun` works for both one-off jobs and endpoints, replaying the exact original image/command/env/GPU/caps, and never tears down the source deployment.
478
+
479
+ ---
480
+
353
481
  ## OpenAI compatibility
354
482
 
355
483
  `badgr serve` provisions a vLLM endpoint that is fully OpenAI-compatible:
@@ -417,22 +545,26 @@ Less common commands — training, transcription, embeddings, and the workload/w
417
545
  badgr train config.yaml --gpu A100 --max-runtime 240 --env HF_TOKEN=$HF_TOKEN
418
546
  ```
419
547
 
420
- Detects framework (axolotl, unsloth, trl) from the config file, but **only Axolotl configs run today** — `unsloth`/`trl`/unrecognized configs are blocked before provisioning rather than billing a GPU that's guaranteed to fail. Default max-runtime is 120 min.
548
+ Detects framework (axolotl, unsloth, trl) from the config file. **Axolotl and TRL configs run today** — `unsloth`/unrecognized configs are blocked before provisioning rather than billing a GPU that's guaranteed to fail. Default max-runtime is 120 min.
421
549
 
422
550
  ```bash
423
551
  badgr train lora --base-model mistralai/Mistral-7B-v0.1 --dataset ./train.jsonl --preset small --max-cost 20
552
+
553
+ # Resume from a prior job's checkpoint instead of starting over
554
+ badgr train lora --base-model mistralai/Mistral-7B-v0.1 --dataset ./train.jsonl --resume https://.../checkpoint --max-cost 20
424
555
  ```
425
556
 
426
557
  Productized LoRA training — pass a base model and dataset, no Axolotl config file needed. Badgr generates the config from a preset and returns a downloadable adapter.
427
558
 
428
559
  | Flag | Default | Description |
429
560
  |------|---------|-------------|
430
- | `--framework <name>` | auto-detect | Force framework: `axolotl`, `unsloth`, `trl` (only `axolotl` currently runs) |
561
+ | `--framework <name>` | auto-detect | Force framework: `axolotl`, `unsloth`, `trl` (`axolotl`/`trl` currently run; `unsloth` is blocked pre-provisioning) |
431
562
  | `--base-model <id>` | — | HuggingFace model ID (required for `train lora`) — validated to exist before provisioning |
432
563
  | `--dataset <path\|url>` | — | Local file, direct URL, or `s3://` URI |
433
564
  | `--file-id <id>` | — | Badgr upload ID instead of `--dataset` |
434
565
  | `--preset small\|medium` | `small` | `small` = RTX 4090, rank 16, 3 epochs. `medium` = A100, rank 32, 5 epochs |
435
566
  | `--gpu-type <type>` | preset default | GPU type override for `train lora` |
567
+ | `--resume <checkpoint-url>` | — | Continue training from a prior job's checkpoint instead of starting fresh |
436
568
  | `--dry-run` | — | Preview the job without provisioning |
437
569
 
438
570
  On completion, `train lora` prints an `adapter_url` — download with `GET /v1/jobs/{job_id}/adapter`, or via `badgr workload info` if saved.
@@ -502,8 +634,11 @@ badgr batch status dep-abc123
502
634
  badgr batch artifacts dep-abc123
503
635
  badgr batch receipt dep-abc123
504
636
  badgr batch compare dep-abc123 dep-def456
637
+ badgr batch compare dep-abc123 dep-def456 --key accuracy --higher-is-better
505
638
  ```
506
639
 
640
+ `batch compare` reads each run's `success_metric` by default; `--key <metric>` compares a different field from the receipt instead, and `--higher-is-better` (default) / `--higher-is-better false` controls which run is reported as the winner.
641
+
507
642
  For CV/video/scientific batch, simulation, and physical-AI eval workloads — runs a container from a `workload.yml` spec and captures output artifacts automatically.
508
643
 
509
644
  **Fan-out** — run the same program once per file in a directory, one deployment per input, in parallel:
@@ -539,14 +674,44 @@ Translates `--cpus-per-task`/`--mem`/`--gres`/`--time`/`--export` from a real `.
539
674
  | `--max-concurrency <n>` | 5 | Cap in-flight array tasks |
540
675
  | `--dry-run` | — | Preview the translated job without provisioning |
541
676
 
542
- ### Other commands
677
+ ### `badgr models` — GPU catalog and pricing
678
+
679
+ ```bash
680
+ badgr models
681
+ ```
682
+
683
+ Lists available GPU types cheapest-first, with VRAM and hourly rate — pulled live from your account when logged in, falling back to the local catalog otherwise. No flags.
543
684
 
544
- - `badgr capacity [--gpu <type>]` — check available GPU capacity right now
545
- - `badgr billing status` / `badgr billing add <amount>` — check balance / add funds
685
+ ### `badgr template` — pre-built workload templates
686
+
687
+ ```bash
688
+ badgr template list
689
+ badgr template info axolotl
690
+ badgr serve template vllm --model meta-llama/Llama-3.1-8B-Instruct --max-cost 10
691
+ badgr run template axolotl --config ./config.yaml --max-cost 10
692
+ ```
693
+
694
+ Provider-neutral templates for common frameworks (`vllm`, `invokeai`, `comfyui`, `axolotl`, `unsloth`, …). `template list`/`template info <name>` just browse the catalog; launching always goes through `badgr serve template <name>` or `badgr run template <name>`, which apply the template's default flags before handing off to the normal `serve`/`run` path.
695
+
696
+ ### `badgr capacity` — check live availability
697
+
698
+ ```bash
699
+ badgr capacity # cheapest runnable GPU across all types
700
+ badgr capacity --gpu A100 # a specific GPU type
701
+ badgr capacity --gpu A100 --region EU # region-filtered
702
+ badgr capacity --gpu A100 --max-price 2.50 # price-capped
703
+ ```
704
+
705
+ ### `badgr billing`
706
+
707
+ ```bash
708
+ badgr billing status # current balance
709
+ badgr billing add 20 # add funds — $5 minimum top-up
710
+ ```
546
711
 
547
712
  ---
548
713
 
549
714
  ## Requirements
550
715
 
551
- - Node.js 18+
716
+ - Node.js 20.10+
552
717
  - A Badgr account — sign up at [aibadgr.com](https://aibadgr.com)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "badgr-cli",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "description": "Badgr — run or serve GPU workloads from one command",
5
5
  "type": "module",
6
6
  "bin": {
@@ -14,6 +14,7 @@
14
14
  "dependencies": {
15
15
  "@inquirer/prompts": "^8.5.2",
16
16
  "archiver": "^7.0.1",
17
+ "badgr-shared": "0.1.1",
17
18
  "chalk": "^5.3.0",
18
19
  "js-yaml": "^4.1.0",
19
20
  "tar": "^7.4.3"
package/src/badgr.js CHANGED
@@ -9,7 +9,7 @@ import { logsCommand } from './commands/logs.js';
9
9
  import { receiptsCommand } from './commands/receipts.js';
10
10
  import { runCommand } from './commands/run.js';
11
11
  import { launchCommand } from './commands/launch.js';
12
- import { taskCommand } from './commands/task.js';
12
+ import { jobCommand } from './commands/job.js';
13
13
  import { artifactsCommand } from './commands/artifacts.js';
14
14
  import { serveCommand } from './commands/serve.js';
15
15
  import { modelsCommand } from './commands/models.js';
@@ -31,6 +31,7 @@ import { rerunCommand } from './commands/rerun.js';
31
31
  import { heartbeatCommand } from './commands/heartbeat.js';
32
32
  import { pullCommand } from './commands/pull.js';
33
33
  import { doctorCommand } from './commands/doctor.js';
34
+ import { diagnoseCommand } from './commands/diagnose.js';
34
35
  import { connectCommand } from './commands/connect.js';
35
36
 
36
37
  const HELP = `
@@ -43,10 +44,11 @@ ${chalk.bold('COMMANDS')}
43
44
  ${chalk.cyan('badgr run <command>')} Run a one-off GPU job
44
45
  ${chalk.cyan('badgr launch cline|claude|codex|playwright "<task>"')} Run a coding/testing workload on a CPU VM — image + command auto-selected
45
46
  ${chalk.cyan('badgr launch <source> -- <command>')} Advanced escape hatch: run any other command on a CPU VM
46
- ${chalk.cyan('badgr task "<desc>" -- <command>')} Label + launch thin wrapper over badgr launch . -- <command>
47
+ ${chalk.cyan('badgr job <agent> "<instruction>" --check "<command>"')} Bounded coding-agent job, tracked at /jobs (POST /v1/jobs, type: agent)
47
48
  ${chalk.cyan('badgr serve <model>')} Serve a model with an OpenAI-compatible endpoint
48
49
  ${chalk.cyan('badgr serve openwebui')} Serve Open WebUI — chat UI, connects to a model endpoint
49
- ${chalk.cyan('badgr doctor')} Diagnose why a GPU workload is likely failing (read-only, no login needed)
50
+ ${chalk.cyan('badgr diagnose "<input>"')} Run a free Badgr Smoke Test on any GPU issue GitHub issue, Docker image, log, repo, or text
51
+ ${chalk.cyan('badgr doctor')} Local GPU / model-fit diagnosis (read-only, no login needed)
50
52
  ${chalk.cyan('badgr status')} Show what's running and what's billing
51
53
  ${chalk.cyan('badgr logs <id>')} Stream logs for a running job or endpoint
52
54
  ${chalk.cyan('badgr pull <id>')} Safely pull cloud-agent patch artifacts
@@ -108,10 +110,18 @@ ${chalk.bold('EXAMPLES')}
108
110
  badgr launch https://github.com/user/repo --max-cost 1 -- python narrgo.py
109
111
  badgr artifacts <id>
110
112
 
111
- ${chalk.dim('# badgr task is a thin label wrapper over badgr launch . -- <command>:')}
112
- badgr task "Run the Chromium tests and tell me what failed" --max-cost 1 -- npm run test:chromium
113
+ ${chalk.dim('# badgr job bounded coding-agent job with a pass/fail check, tracked at /jobs:')}
114
+ badgr job cline "Run the Chromium tests and tell me what failed" --check "npm run test:chromium" --max-cost 1
113
115
 
114
- ${chalk.dim('# Diagnose why a GPU workload is likely failing (local, read-only, no login):')}
116
+ ${chalk.dim('# Run a free Badgr Smoke Test on any GPU issue (no login needed):')}
117
+ badgr diagnose "https://github.com/org/repo/issues/123"
118
+ badgr diagnose ./error.log
119
+ badgr diagnose --docker ajayrajtp/vllm_gemma412b:latest
120
+ badgr diagnose --repo https://github.com/org/repo
121
+ badgr diagnose --comfyui workflow.json
122
+ badgr diagnose "https://github.com/org/repo/issues/123" --approve ${chalk.dim('# approve a capped smoke test')}
123
+
124
+ ${chalk.dim('# Local model-fit and workload diagnosis (no network):')}
115
125
  badgr doctor
116
126
  badgr doctor --model Qwen/Qwen2.5-7B-Instruct --serve
117
127
  badgr doctor --logs ./vllm.log
@@ -195,6 +205,10 @@ ${chalk.bold('badgr run OPTIONS')}
195
205
  --no-gpu Run on a CPU-only VM — no GPU is provisioned (conflicts with --gpu/--gpu-memory)
196
206
  --tier 1 Managed provider routing (default)
197
207
  --tier 2 Marketplace provider routing, lower-cost options
208
+ --smoke Cheapest compatible provider for a local/dev test run — defaults: $0.25
209
+ max cost, 10min max runtime (override with --max-cost/--max-runtime).
210
+ Always: one attempt, mandatory teardown, no --workspace.
211
+ Same as setting BADGR_DEV_CHEAPEST=1. An explicit --tier overrides this.
198
212
  --image <image> Docker image (default: python:3.11-slim)
199
213
  --env KEY=VALUE Set an environment variable (repeatable)
200
214
  --count <n> Number of GPUs (default: 1)
@@ -270,7 +284,7 @@ async function main() {
270
284
  case 'detect': return detectCommand(config, rest, chalk);
271
285
  case 'run': return runCommand(config, rest, chalk);
272
286
  case 'launch': return launchCommand(config, rest, chalk);
273
- case 'task': return taskCommand(config, rest, chalk);
287
+ case 'job': return jobCommand(config, rest, chalk);
274
288
  case 'artifacts': return artifactsCommand(config, rest, chalk);
275
289
  case 'pull': return pullCommand(config, rest, chalk);
276
290
  case 'serve': return serveCommand(config, rest, chalk);
@@ -280,7 +294,9 @@ async function main() {
280
294
  case 'restart': return restartCommand(config, rest, chalk);
281
295
  case 'rerun': return rerunCommand(config, rest, chalk);
282
296
  case 'heartbeat': return heartbeatCommand(config, rest, chalk);
283
- case 'doctor': return doctorCommand(config, rest, chalk);
297
+ case 'diagnose': return diagnoseCommand(config, rest, chalk);
298
+ case 'run-issue': return diagnoseCommand(config, rest, chalk); // alias — matches the /run-issue web flow name
299
+ case 'doctor': return doctorCommand(config, rest, chalk);
284
300
  case 'receipts': return receiptsCommand(config, rest, chalk);
285
301
  case 'models': return modelsCommand(config, chalk);
286
302
  case 'capacity': return capacityCommand(config, rest, chalk);
@@ -7,7 +7,7 @@ badgr billing — manage your AI Badgr balance
7
7
 
8
8
  COMMANDS
9
9
  badgr billing status Show current balance
10
- badgr billing add <amount> Open checkout to add balance (minimum $10)
10
+ badgr billing add <amount> Open checkout to add balance (minimum $5)
11
11
 
12
12
  EXAMPLES
13
13
  badgr billing status
@@ -49,8 +49,8 @@ async function billingStatus(config, chalk) {
49
49
  async function billingAdd(config, amount, chalk) {
50
50
  requireApiKey(config);
51
51
  const amountInt = parseInt(amount, 10);
52
- if (!amountInt || amountInt < 10) {
53
- console.error(chalk.red(' Minimum top-up is $10. Example: badgr billing add 10'));
52
+ if (!amountInt || amountInt < 5) {
53
+ console.error(chalk.red(' Minimum top-up is $5. Example: badgr billing add 5'));
54
54
  process.exit(1);
55
55
  }
56
56
 
@@ -79,5 +79,8 @@ export async function connectCommand(args, chalk, deps = {}) {
79
79
  setCredential(provider, key);
80
80
  console.log(chalk.green(`\n ✓ ${alreadyConnected ? 'Updated' : 'Connected'} ${provider}`));
81
81
  console.log(chalk.dim(` Stored in ${CREDENTIALS_FILE} (owner-only file permissions)`));
82
- console.log(chalk.dim(` Used automatically by: badgr launch ${provider === 'anthropic' ? 'claude' : provider === 'openai' ? 'codex' : provider} "<task>"\n`));
82
+ const usageHint = provider === 'anthropic' ? 'badgr launch claude "<task>"'
83
+ : provider === 'openai' ? 'badgr launch codex "<task>"'
84
+ : `badgr launch cline/claude/codex --provider ${provider} --model <model-id> "<task>"`;
85
+ console.log(chalk.dim(` Used automatically by: ${usageHint}\n`));
83
86
  }