|
| 1 | +# `tracer cloud`: drive Tracer Cloud from the terminal |
| 2 | + |
| 3 | +`tracer cloud` mirrors the Tracer Cloud web app from your shell: log in once, |
| 4 | +then create and train tracers, run live routing queries, manage tests, models, |
| 5 | +observability keys, billing, and more. It talks to the same API the dashboard |
| 6 | +uses, as you. |
| 7 | + |
| 8 | +```bash |
| 9 | +pip install tracer-llm |
| 10 | +tracer cloud login # opens your browser, pick your account |
| 11 | +tracer cloud tracers # list your tracers |
| 12 | +``` |
| 13 | + |
| 14 | +## Auth |
| 15 | + |
| 16 | +`tracer cloud login` runs a browser device flow: it opens a page where you pick |
| 17 | +your account and approve, then hands the session back to the CLI on a localhost |
| 18 | +callback. The session is stored only on this machine in `~/.tracer/cloud.json` |
| 19 | +and refreshed automatically. Sign out with `tracer cloud logout`. |
| 20 | + |
| 21 | +Headless / CI: pass credentials to skip the browser. |
| 22 | + |
| 23 | +```bash |
| 24 | +tracer cloud login --email you@example.com --password "$TRACER_PW" |
| 25 | +``` |
| 26 | + |
| 27 | +Point at a different deployment or a local dev server with `--url` (or the |
| 28 | +`TRACER_CLOUD_URL` env var). The package hardcodes no infrastructure details; |
| 29 | +the client config is fetched from `<url>/api/cli/config` at login. |
| 30 | + |
| 31 | +## Commands |
| 32 | + |
| 33 | +### Account & workspaces |
| 34 | +```bash |
| 35 | +tracer cloud whoami # the logged-in user + workspaces |
| 36 | +tracer cloud tenants # list workspaces |
| 37 | +tracer cloud tenant-delete <ref> --confirm "<name>" # delete an EMPTY company workspace |
| 38 | +``` |
| 39 | + |
| 40 | +### Tracers |
| 41 | +```bash |
| 42 | +tracer cloud tracers # list |
| 43 | +tracer cloud get <id|slug> # a tracer + its versions |
| 44 | +tracer cloud rename <id|slug> "New name" |
| 45 | +tracer cloud delete <id|slug> [--confirm <name>] |
| 46 | + |
| 47 | +# create + train |
| 48 | +tracer cloud create "support router" --mode quick \ |
| 49 | + --file traces.jsonl --teacher my-provider:my-model \ |
| 50 | + --label-space "billing,fraud,general" --wait |
| 51 | +tracer cloud create "watch mode" --mode auto --teacher my-provider:my-model --threshold 200 |
| 52 | +``` |
| 53 | +`--mode quick` trains on a labelled upload, `unlabelled` lets the teacher label |
| 54 | +it, `auto` starts in watch mode (no data needed). `--wait` blocks until training |
| 55 | +finishes. `--teacher` takes `provider:model_id` or a JSON object. |
| 56 | + |
| 57 | +### Training, retraining, promotion |
| 58 | +```bash |
| 59 | +tracer cloud training <id> # job status |
| 60 | +tracer cloud training-cancel <id> |
| 61 | +tracer cloud retrain <id> --mode reuse|merge|replace [--trace-ids a,b,c] [--wait] |
| 62 | +tracer cloud auto-retrain <id> --threshold 500 # or --disable |
| 63 | +tracer cloud promote <id> [--version <version_id>] # promote (or roll back) |
| 64 | +``` |
| 65 | + |
| 66 | +### Live routing |
| 67 | +```bash |
| 68 | +tracer cloud route <id> "my card was declined" # the dashboard's Live Query |
| 69 | +tracer cloud route <id> "..." --lite # skip the teacher call |
| 70 | +tracer cloud route <id> "..." --show-exemplars |
| 71 | +``` |
| 72 | + |
| 73 | +### Tests (batteries) |
| 74 | +```bash |
| 75 | +tracer cloud batteries list <id> |
| 76 | +tracer cloud batteries create <id> --name "smoke" --cases cases.json |
| 77 | +tracer cloud batteries run <id> --battery <battery_id> [--version <id>] |
| 78 | +``` |
| 79 | + |
| 80 | +### Models |
| 81 | +```bash |
| 82 | +tracer cloud models list |
| 83 | +tracer cloud models add --name my-llm --endpoint https://… --upstream model-id \ |
| 84 | + --api-key "$KEY" --kind llm --cost-in 0.15 --cost-out 0.6 |
| 85 | +tracer cloud models delete --id <model_id> |
| 86 | +``` |
| 87 | + |
| 88 | +### Observability |
| 89 | +```bash |
| 90 | +tracer cloud ingest-keys create --name "my app" # mint a workspace ingest key |
| 91 | +tracer cloud ingest-keys list |
| 92 | +tracer cloud ingest-keys revoke --id <key_id> |
| 93 | +tracer cloud ingest --key trobs_… --events events.json # send observed events |
| 94 | +``` |
| 95 | +Most teams stream live traffic with [`tracer.watch`](watch.md) instead of |
| 96 | +posting batches by hand. |
| 97 | + |
| 98 | +### Keys, analytics, billing, scan, label space |
| 99 | +```bash |
| 100 | +tracer cloud keys list|create|revoke <id> # per-tracer gateway API keys |
| 101 | +tracer cloud analytics <id> --range 24h|7d|30d |
| 102 | +tracer cloud label-space <id> [--set a,b,c] [--strict] |
| 103 | +tracer cloud billing [--tenant <ref>] |
| 104 | +tracer cloud scan path/to/traces.jsonl # public scan |
| 105 | +``` |
| 106 | + |
| 107 | +Add `--json` to any read command for raw JSON output. |
| 108 | + |
| 109 | +## Environment variables |
| 110 | + |
| 111 | +| Var | Effect | |
| 112 | +|-----|--------| |
| 113 | +| `TRACER_CLOUD_URL` | Tracer Cloud base URL (default `https://app.tracerml.ai`) | |
| 114 | +| `TRACER_TENANT` | default workspace id/slug/name when a command needs one | |
| 115 | +| `TRACER_CLOUD_CONFIG` | path to the stored session (default `~/.tracer/cloud.json`) | |
0 commit comments