Sync runs to the Plune platform
Four commands run fully local — run, report, diff and init: no account, no network, no data
leaving your machine. The rest talk to a server and are entirely opt-in: login, logout, sync,
ingest, and the plune run start | finish | exec | report | import group that reports a suite’s
results to the platform. You can use Plune forever without any of them.
This list grew: until 0.7.0 it really was three. Naming the local four is the more durable way round — the local half is the promise, and it is the half that has not changed.
The commands that test an MCP server — plune mcp check, lint, snapshot and diff — need no account
either and never talk to the Plune platform. They do use a network when you ask them to: they start the
server you name, or connect to the address you give with --url, and nothing else. See
Test an MCP server. plune mcp serve is the other kind: it gives an
agent the Plune your token reaches, so it talks to the platform.
What they add is history. plune run writes its result to .plune/last-run.json and that is where it
stays; plune sync uploads that file to the Plune platform, where runs accumulate into a pass-rate and
cost trend you can look at over time.
Get a token
Section titled “Get a token”-
Sign in to the dashboard — it uses a magic link, so there is no password to manage.
-
Open Account → API tokens — the avatar at the top right, then API tokens in its panel — pick the project the runs belong to and generate one. The token is shown once; copy it then.
-
Hand it to the CLI (see below). Tokens are per-user and can be revoked from the same screen.
plune login
Section titled “plune login”Saves the token so every later command can use it.
plune login --token plune_xxxxxxxxPassing a secret as an argument leaves it in your shell history, so login also reads the token from
standard input — piped or pasted:
echo "$PLUNE_TOKEN" | plune login # scripted / CIplune login # interactive: paste it, press EnterThe token is written to ~/.config/plune/credentials.json (honouring XDG_CONFIG_HOME) with 0600
permissions inside a 0700 directory. The command prints only the path — the token itself is never
echoed to a terminal or a log:
Logged in. Token saved to /home/you/.config/plune/credentials.jsonAn empty token exits 2 rather than saving an unusable file.
plune logout
Section titled “plune logout”Removes the saved token. It is safe to run when you are not logged in — that is not an error:
plune logout# Logged out. Removed /home/you/.config/plune/credentials.json# …or: Not logged in — nothing to remove.plune sync
Section titled “plune sync”Uploads a run to POST /v1/runs and prints the id the server assigned, plus the URL to read it back:
plune run # produces .plune/last-run.jsonplune sync # uploads itBy default it syncs the most recent run. Point it at a specific file to upload an older or archived one:
plune sync --file reports/nightly-2026-07-27.jsonThe global -c, --config flag works the way it does for plune report: it makes sync look for the run
saved next to that config rather than in the current directory.
plune -c packages/api/plune.yaml syncThe uploaded file is the run exactly as the CLI wrote it — the platform validates it against the same
frozen RunResult contract the CLI produces, so nothing is reshaped on the way out.
A trace link on an eval
Section titled “A trace link on an eval”An eval in the run file may carry traceUrl, the link to its trace in your own observability tool.
plune run does not write the field; it is for a run file your own tooling adds it to before the
sync. Plune keeps the link, never the trace, and shows it under the eval’s name on the run’s page
(The observability trace).
This is the one field plune sync touches on the way out. A good link is trimmed. One the platform
would refuse (not https://, no host, a user name or password, a space or control character, over
2048 characters, not a string) is dropped, the eval is synced without it, and a warning on stderr
names the eval and the reason:
plune: eval "http": trace link not sent (must be an https address) — the eval is synced without it.In AI operations
Section titled “In AI operations”From 0.30.2 a sync also shows in AI operations — the button in the bar — while it uploads. A completed sync stays in the list for 24 hours; a failed one stays until you dismiss it.
The row is called Sync · name. The name is the folder the run was read from: the folder that holds
the config -c points at (api for -c packages/api/plune.yaml), else the current directory. With
--file it is the file’s name, extension included (nightly-2026-07-27.json). The row counts the run’s
rows — Synced 0 / 12, then Synced 12 / 12 once the upload is in; a run with no rows has no count. It
ends Completed, or Failed with the error line the CLI printed, under Error details.
A failed sync has no Retry: the upload is the CLI’s work, not the platform’s. In its place the row
says A sync runs on the machine that started it, not here. To try again, run plune sync once more.
Dismiss removes the row. A sync whose CLI stops reporting is marked Failed after 30 minutes
(No report from the producer for 30 minutes…), with the same advice.
The row only describes the upload. Whatever the platform answers to it, the sync goes on and its exit code is the same, and each report gives up after 5 seconds. When the sync went through but the platform did not take a report, the CLI says so once, on stderr:
plune: could not report this sync to the job queue (HTTP 400 — …) — the run is uploaded.A platform without the queue (POST /v1/jobs answers 404 or 405) is not reported to, and nothing is
said. 0.30.0 and 0.30.1 meant to report a sync as well, but the platform refused their first request, so
no sync from them reached the list.
Exit codes
Section titled “Exit codes”sync separates “you need to do something” from “the environment failed”, so a CI step can react to the
difference instead of retrying a hopeless upload:
| Code | Meaning | Typical cause |
|---|---|---|
0 | Uploaded | — |
2 | Your input needs fixing | Not logged in, token rejected or revoked, run file missing or invalid |
1 | Environment or server | Network unreachable, API returned 5xx |
Errors are printed as a single readable line; the token never appears in the output, and neither does a stack trace.
With --fail-on-failures (from 0.19.0) sync then reads the run’s summary once and exits on that verdict: 1
on a failure that is not muted or when no verdict comes back, 0 otherwise — see
Run Plune in CI.
sync reads PLUNE_TOKEN from the environment — or from a .env in the current directory, from
0.16.0 — and the saved login only when the variable is set nowhere. So a CI job hands it the secret
directly, with no login step:
- name: Upload the run to Plune env: PLUNE_TOKEN: ${{ secrets.PLUNE_TOKEN }} run: | npx -y @plune-ai/cli run npx -y @plune-ai/cli syncBefore 0.13.0 sync read the credentials file and nothing else, and a job logged in first, from a
secret — which is what the stdin form of plune login is for.
Programmatically
Section titled “Programmatically”The same upload is exported from the package, alongside typed errors — so a caller can tell “log in” apart from “the network is down” without parsing messages:
import { run, sync, NotLoggedInError, SyncNetworkError } from "@plune-ai/cli";
await run({ configPath: "plune.yaml" });
try { const { id, url } = await sync(); console.log(`uploaded ${id} → ${url}`);} catch (err) { if (err instanceof NotLoggedInError) { // ask for a token, then retry } else if (err instanceof SyncNetworkError) { // transient — safe to retry later } else { throw err; }}sync() accepts the same choices the flags expose (file, apiUrl, and injectable fetch/token
loading for tests), and reportSyncFailure(err, write) maps any of the typed errors to the exit code
the CLI itself would use. sync() reports to AI operations too, but prints nothing:
a report the platform did not take comes back as jobProblem on the result.