Skip to content

Plune CLI — Getting started

The Plune CLI (@plune-ai/cli) is AI-powered assertion testing for LLM apps — a test runner for model behaviour. You describe the checks in one plune.yaml; Plune calls the model, evaluates each assertion, caches results, and reports a pass/fail summary with token cost — locally, in CI, or as a regression diff between two runs. It is the Evaluate step in Plune’s Generate → Evaluate → Gate flow.

v0.39.14MITNode ≥ 20

Terminal window
npm install -g @plune-ai/cli # or: pnpm add -g @plune-ai/cli
plune --version

Or run it without installing:

Terminal window
npx -y @plune-ai/cli run

better-sqlite3 backs the completion cache. If its prebuilt binary cannot be fetched and the machine has no compiler, npm skips it, the install still succeeds, and plune run prints completion cache disabled and runs with the cache off.

  1. Scaffold a plune.yaml, an example dataset, and .env.example:

    Terminal window
    plune init
  2. Add your provider key — read from the environment / .env, never written to disk:

    Terminal window
    echo 'ANTHROPIC_API_KEY=sk-ant-...' >> .env
  3. Run the assertions:

    Terminal window
    plune run
    # → 3 passed · 0 failed · 0 errored · 3 total · $0.0008 · 1840ms
  4. Re-render the last run, or diff two runs to catch regressions:

    Terminal window
    plune report --format markdown
    plune diff baseline.json current.json --fail-on-regression

Each run writes its full result to .plune/last-run.json.

Everything above generates checks, which is why it wants a provider key. If your tests already exist, there is nothing to generate — the results exist and only have to arrive, and that road needs no provider key at all:

Terminal window
plune run import ./junit.xml # Vitest, Jest, pytest, PHPUnit, Surefire, Cypress, Playwright…

Plune reads a single plune.yaml, discovered by walking up from the working directory (or passed with -c <path>). This is what plune init scaffolds:

version: 1
provider:
type: anthropic # anthropic | openai | openrouter
model: claude-sonnet-5-5
evals:
- id: example
prompt: "Answer concisely. {{question}}" # {{vars}} come from each dataset row
dataset: datasets/example.jsonl # a file path, or an inline `examples:` list
assertions:
- type: contains
value: "Paris"

Datasets are JSONL — one row per line, shaped { "vars": { ... }, "expected"?: "..." }.

model is any id the provider serves. plune init starts you on claude-sonnet-5-5 — its wizard offers OpenAI users gpt-4o-mini. Switch providers has the rest: a model per eval, temperature, and what a run costs.

The provider API key is read from the environment based on provider.type — never written to disk:

Providerprovider.typeEnvironment variable
AnthropicanthropicANTHROPIC_API_KEY
OpenAIopenaiOPENAI_API_KEY
OpenRouteropenrouterOPENROUTER_API_KEY

Every command reads its settings the same way: from the environment first — what your shell or CI job exported — then from a .env beside the config you named with -c, then from a .env in the current directory. The first place that sets a variable wins, so a .env never overrides what is already exported. That covers the keys above and every PLUNE_* variable (PLUNE_TOKEN, PLUNE_API_URL, PLUNE_RUN, …) for run import, sync, login and the rest, not only run and report — no dotenv wrapper in your scripts (from 0.16.0). The token plune login saved is the last resort, used only when PLUNE_TOKEN is set nowhere else.

Ten built-in assertion types cover plain text, JSON-schema, LLM-as-judge, and RAG metrics:

TypePasses when…
exact-matchoutput equals value (optional trim, ignore_case)
containsoutput contains value
contains-anyoutput contains at least one of values
contains-alloutput contains every one of values
json-schemaoutput validates against the JSON schema
llm-judgean LLM grades the output against criteria (≥ pass_threshold)
semantic-similarityembedding similarity to reference ≥ threshold
faithfulnessoutput is grounded in context (RAG)
answer-relevanceoutput actually answers the question (RAG)
context-precisioncontext is relevant to the question (RAG)
CommandSummary
plune runRun the suite. Flags: --dry-run (price the run from the model’s rates — it calls no model, so it needs no provider key; from 0.16.0), --only <id|tag> (repeatable), --bail, --no-cache, --cache-strict (answer every row from the cache and never call the model for a completion; a row with no entry exits 5), --cache-max-age <duration, e.g. 12h, 90s, 7d> (open the cache’s expiry), --concurrency <n>, --format console|json|markdown, -o, --output <file>.
plune reportRe-render the most recent run. Flags: --format, -o.
plune diff <baseline> <current>Compare two plune run --format json outputs and report pass→fail regressions. Flags: --fail-on-regression, --max-pass-rate-drop-percent <n>, --max-cost-usd <n>, --max-cost-increase-percent <n>, --max-tokens <n> (gates, each off until given; from 0.38.0), --waivers <file> (waivers for measured gate failures; from 0.38.0), --format console|json|markdown, -o, --output <path>. See the gate in a pull request.
plune initScaffold plune.yaml, a sample dataset, and .env.example. Flags: --yes (non-interactive), --force.
plune run import <file | folder>Turn a JUnit XML or Playwright JSON report, a k6 summary or Lighthouse JSON report (from 0.33.0), a folder of JUnit XML files (from 0.32.0) or an allure-results folder into a run — no provider key, nothing generated. Flags: --format, --name <text> to call the run something other than the default, --key <externalKey> to land several jobs in one run, --create to offer unmatched tests for review, --min-score <category=score> for a Lighthouse category’s bar.
plune login / plune logoutSave or remove a platform API token. The token is checked against the API before it is saved. See Platform sync.
plune syncUpload the latest local run to the platform. Flags: --file <path>.
plune mcp serveServe the Plune tools to an AI agent (Claude Code, Codex, any MCP client) over MCP stdio (from 0.34.0). Flags: --project <id>, --read-only. See Plune tools for AI agents.
plune mcp check / lint / snapshot / diffTest any MCP server, stdio or HTTP (from 0.34.5): does it start and answer, what in its tool list confuses a model, its contract as a file to commit, and what a change breaks. No account; they never talk to the Plune platform. See Test an MCP server.
plune run start / finish / exec / reportOpen, close, wrap and replay a platform run — the group that lets several jobs report into one run. start and exec take --name <text> too, as run import does; it wins over PLUNE_RUN_TITLE. See Import an existing suite.
plune run delete <id>Delete a run and everything it produced: its results and the review-queue entries it raised. Approved test cases and the audit log stay. An owner of the project can put it back for 30 days from Settings → Bin; after that it is gone for good. No prompt: it is your data, and this command belongs in scripts.
plune ingest [dir]Record a Cairn run in Plune. Omit [dir] for the newest run under ./runs. Generated cases arrive as review proposals — nothing is created until a person approves it.
plune pull [file]Write the project’s test cases as one Markdown document — Testomat’s classical format, plus Plune’s own columns — to plune/cases.md (or [file]). Refuses to overwrite a file git sees as modified; --force overrides, --suite <id> takes one suite or folder and what is under it. See Cases as Markdown.
plune push [file] [--dry-run]Send the document back. Cases are matched by id; a block without one becomes a draft; an unknown id is refused by line; nothing is deleted. Prints the report — created, updated, unchanged, refused, warnings — and with --dry-run writes nothing.
plune verifyCompare the project’s automated cases with the Playwright tests in the code, read-only: prints cases in Plune the code no longer has (already detached, or one a full run would detach) and tests in the code with no case. Nothing is written. Flags: --from <file>, --playwright-config <path>, --json, --fail-on-drift. See Check for drift.
plune ids [--write]Write the Plune case id of each Playwright test that names none into plune/ids.json, a map from the test’s path-title key to its case id; test files are not edited. A dry run unless --write. Entries are only added, never overwritten. Playwright only. The Playwright reporter reads the file (PLUNE_IDS_FILE or the reporter option idsFile sets another path). Flags: --write, --file <path>, --from <file>, --playwright-config <path>, --json. See Record case ids.
plune requirements links <file.md>Import a traceability matrix (a Markdown table of requirement key to test) as links between requirements and cases. With no flags it lists the tables and exits 0; with --table, --requirement-column and --test-column it is a dry run until --yes. Flags: --separator, --project, --json, --fail-on-unmatched. See Import a traceability matrix.
plune plan grep <id>Print a test plan as one --grep pattern — npx playwright test --grep "$(plune plan grep <id>)" or npx vitest run -t "$(…)" runs exactly what the plan collects. Only the pattern reaches stdout; an empty plan prints (?!), which matches nothing.
plune run grep <run> [--failed]Print a run’s automated cases as one --grep pattern, built as plan grep builds a plan’s (from 0.21.0) — the commands Plune shows for a run: npx playwright test --grep "$(plune run grep <run-id> --failed)" re-runs an automated run’s failures (Re-run N failed), and PLUNE_RUN=<key> PLUNE_SHARED_RUN=1 npx playwright test --grep "$(plune run grep <key>)" runs the automated half of a mixed run of no plan. <run> is the run’s id or its key (rk_ and ten hex); anything else exits 2 before a request is sent, and a key no run carries exits 1. --failed keeps what the platform counts as failed or broken, so a muted case’s failure stays out. Only the pattern reaches stdout; nothing taken prints (?!).

Global flags: -c, --config <path> · -v, --verbose · --no-color.

The same engine that powers plune run is exported for use from your own code. Unlike the CLI, the library does not parse argv or auto-load .env — set the provider key in process.env yourself.

import { run } from "@plune-ai/cli";
import type { RunResult } from "@plune-ai/cli";
const result: RunResult = await run({ dryRun: false, configPath: "plune.yaml" });
console.log(result.summary); // { total, passed, failed, errored, ... }

Run Plune on every pull request and post a regression diff as a sticky comment with the companion GitHub Action, eval-action:

- uses: plune-ai/eval-action@v1
with:
config: plune.yaml
fail-on-regression: true

Runs stay on your machine unless you ask otherwise. plune login saves an API token and plune sync uploads a run to the Plune platform, where runs accumulate into a pass-rate and cost trend. Everything above works without an account, and continues to.

The token comes from the dashboard: the avatar at the top right → API tokens, then the Project and its Rights — Read and write, to sync runs — and Generate a token. It is shown once — paste it into plune login.

Account, API tokens: the Project and Rights selects, Generate a token, and the tokens listed by the project each writes to, each with its rights and Revoke. Account, API tokens: the Project and Rights selects, Generate a token, and the tokens listed by the project each writes to, each with its rights and Revoke.

MIT © Plune Contributors.