CLI reference #
The full command list below is generated from testerkit itself.
Installation #
pip install testerkit # PyPI name is testerkit; the import is `testerkit`
testerkit --helpAfter install, testerkit is on $PATH.
Commands #
testerkit benchmark {#cli-benchmark} #
Measure this machine's per-store performance.
| Argument / option | Type | Description |
|---|---|---|
--full | flag | Run the full sweep (100/1k/10k unit, 1/2/4 writers) |
--rounds | integer | Timed rounds per case (override) |
-o/--output | text | Directory for the result folder (default: .benchmarks) |
--no-save | flag | Print the summary but don't write a result folder |
testerkit catalog (group) {#cli-catalog} #
Catalog commands.
testerkit catalog datasheet {#cli-catalog-datasheet} #
Generate a formatted datasheet from a catalog YAML file.
| Argument / option | Type | Description |
|---|---|---|
YAML_PATH | path | |
-f/--format | {html, pdf} | Output format (default: html) (default: html) |
-o/--output | path | Output file path |
testerkit daemon (group) {#cli-daemon} #
Manage TesterKit background daemons (events / runs / channels).
testerkit daemon restart {#cli-daemon-restart} #
Restart selected daemons (SIGTERM the running process; respawn on next access).
| Argument / option | Type | Description |
|---|---|---|
TARGETS... | text | |
--all | flag | Restart every daemon under the project |
testerkit daemon status {#cli-daemon-status} #
Show running daemons, their PIDs, refs, and locations.
(no options or arguments.)
testerkit daemon stop {#cli-daemon-stop} #
Stop selected daemons without respawning.
| Argument / option | Type | Description |
|---|---|---|
TARGETS... | text | |
--all | flag | Stop every daemon under the project |
testerkit data (group) {#cli-data} #
Data retention and management.
testerkit data import {#cli-data-import} #
Merge another data_dir into this one; the store daemons rebuild from the files.
| Argument / option | Type | Description |
|---|---|---|
SOURCE | directory | |
--data-dir | text | Destination results dir (default: configured). |
testerkit data index (group) {#cli-data-index} #
Runs-index (DuckDB) epoch lifecycle tooling.
testerkit data index build {#cli-data-index-build} #
Eagerly build/warm the CURRENT runs-index epoch (blocks until warm).
| Argument / option | Type | Description |
|---|---|---|
--data-dir | text | Results directory |
--rebuild | flag | Discard the current epoch first, so it rebuilds fresh from parquet. |
--background | flag | Start the daemon and return immediately; don't block until warm. |
testerkit data index list {#cli-data-index-list} #
List every runs-index epoch by fingerprint, versions, rows, size, last seen.
| Argument / option | Type | Description |
|---|---|---|
--data-dir | text | Results directory |
testerkit data index prune {#cli-data-index-prune} #
Remove stale runs-index epochs by last-access (never the current epoch).
| Argument / option | Type | Description |
|---|---|---|
--data-dir | text | Results directory |
--keep-last | integer | Always keep at least this many most-recently-seen epochs. (default: 3) |
--older-than | text | Never remove an epoch last seen more recently than this (e.g. 30d). (default: 30d) |
--dry-run | flag | Show what would be removed; delete nothing. |
testerkit data index rm {#cli-data-index-rm} #
Delete one runs-index epoch file by fingerprint prefix.
| Argument / option | Type | Description |
|---|---|---|
FINGERPRINT | text | |
--data-dir | text | Results directory |
--force | flag | Also remove the CURRENT epoch (restarts its daemon first to release the lock). |
testerkit data promote {#cli-data-promote} #
Move a starter project's local runs + their referenced data to the global store.
| Argument / option | Type | Description |
|---|---|---|
--include-starter | flag | Also promote runs that match starter sentinels (example_part / starter_station / STARTER001 / etc.). Default skips these as throwaway learning runs. |
--dry-run | flag | Show what would be promoted; write nothing. |
--with-events | flag | Also carry each run's session event timeline (audit-grade archive). |
testerkit data prune {#cli-data-prune} #
Delete date-partitioned data older than the specified period.
| Argument / option | Type | Description |
|---|---|---|
--older-than | text | Retention period (e.g. 30d, 90d) |
--type | text | Data types to prune (e.g. channels, files, events) |
--data-dir | text | Results directory |
--dry-run | flag | Show what would be deleted |
--ext | text | Only prune files with these extensions (tiered retention, e.g. --ext tdms). Files only. |
testerkit data reindex {#cli-data-reindex} #
Kill index daemons and rebuild on next access.
| Argument / option | Type | Description |
|---|---|---|
--data-dir | text | Results directory |
testerkit discover {#cli-discover} #
Scan for available instruments.
| Argument / option | Type | Description |
|---|---|---|
--visa | flag | VISA instruments only |
--ni | flag | NI devices only |
--serial | flag | Serial ports only |
--lxi | flag | LXI network instruments only |
--identify/--no-identify | flag | Query *IDN? for each instrument |
--json | flag | Output as JSON |
testerkit docs (group) {#cli-docs} #
Stream the shipped documentation to stdout.
testerkit docs list {#cli-docs-list} #
List available documentation pages, optionally filtered to SECTION.
| Argument / option | Type | Description |
|---|---|---|
SECTION | text |
testerkit docs show {#cli-docs-show} #
Print the named documentation page to stdout.
| Argument / option | Type | Description |
|---|---|---|
PATH | text |
testerkit export {#cli-export} #
Export a test run or session to a different format via event replay.
| Argument / option | Type | Description |
|---|---|---|
ID | text | |
-f/--format | text | Target format (csv, json, stdf, hdf5, tdms, mdf4) |
-o/--output-dir | text | Output directory |
--data-dir | text | Data directory |
testerkit grafana (group) {#cli-grafana} #
Grafana dashboard provisioning and data server.
testerkit grafana export {#cli-grafana-export} #
Export dashboards and provisioning templates for manual setup.
| Argument / option | Type | Description |
|---|---|---|
--output-dir/-o | path | Output directory (default: grafana-export) |
testerkit grafana serve {#cli-grafana-serve} #
Start the pgwire server for Grafana.
| Argument / option | Type | Description |
|---|---|---|
--host | text | Bind address (default: 0.0.0.0) |
--port | integer | PostgreSQL wire protocol port (default: 5433) |
--data-dir | path | |
--refresh-seconds | integer | Seconds between IPC table refreshes (events, channels) (default: 30) |
testerkit grafana setup {#cli-grafana-setup} #
Install provisioning config and dashboards into Grafana.
| Argument / option | Type | Description |
|---|---|---|
--grafana-home | directory | Grafana installation directory (default: auto-detect) |
--grafana-url | text | Grafana URL for API setup (e.g. http://localhost:3000) |
--grafana-token | text | Grafana API token or service account token |
--grafana-user | text | Grafana username for basic auth |
--grafana-password | text | Grafana password for basic auth |
--host | text | pgwire host for datasource config (default: 127.0.0.1) |
--port | integer | pgwire port for datasource config (default: 5433) |
--folder | text | Grafana folder for dashboards (default: TesterKit) |
testerkit init {#cli-init} #
Initialize a new TesterKit project.
| Argument / option | Type | Description |
|---|---|---|
NAME | text | |
--no-git | flag | Skip git initialization |
--discover | flag | Auto-discover instruments and create station file |
--starter/--no-starter | flag | Generate starter example files (prompts if not specified) |
--tier | {bringup, bench, factory} | Scaffold tier. 'bringup' = Tier 0/1 (MagicMock fixtures, one test, one sidecar, no station/part YAML). 'bench' = Tier 2 starter (equivalent to --starter). 'factory' = Tier 3/4 (bench + profiles). |
--ai | {claude-code, claude-desktop, copilot} | Set up AI tool integration (MCP server + project instructions) |
--no-input | flag | Run non-interactively: scaffold with defaults and never prompt (skips AI setup unless --ai is given). |
--no-ai | flag | Skip AI tool integration. |
--name | text | Project name (overrides auto-detect) |
testerkit instrument (group) {#cli-instrument} #
Instrument management commands.
testerkit instrument cal {#cli-instrument-cal} #
Update calibration information for an instrument.
| Argument / option | Type | Description |
|---|---|---|
INSTRUMENT_ID | text | |
--due | text | Calibration due date (YYYY-MM-DD) |
--last | text | Last calibration date (YYYY-MM-DD) |
--cert | text | Certificate number |
--lab | text | Calibration lab name |
testerkit instrument list {#cli-instrument-list} #
List all instrument configuration files.
| Argument / option | Type | Description |
|---|---|---|
--json | flag | Output as JSON |
testerkit instrument show {#cli-instrument-show} #
Show details for a specific instrument.
| Argument / option | Type | Description |
|---|---|---|
INSTRUMENT_ID | text | |
--json | flag | Output as JSON |
testerkit mcp (group) {#cli-mcp} #
MCP server commands for AI-assisted workflows.
testerkit mcp serve {#cli-mcp-serve} #
Start the MCP server for AI agents.
| Argument / option | Type | Description |
|---|---|---|
--transport | text | Transport type (stdio, sse) (default: stdio) |
testerkit metrics (group) {#cli-metrics} #
Manufacturing-test analytics (yield, pareto, ppk, trend, retest, time-loss).
testerkit metrics pareto {#cli-metrics-pareto} #
Top failures (Pareto). Group by part / step / measurement.
| Argument / option | Type | Description |
|---|---|---|
--json | flag | Output as JSON |
--utc | flag | Interpret bare --since/--until values as UTC. Also enabled by setting TESTERKIT_UTC=1 in the environment. |
--station | text | Station ID |
--part | text | Part ID |
--until | text | Include runs started at or before this time. Same format as --since. |
--since | text | Include runs started at or after this time. Accepts a relative duration (e.g. '7d', '4h', '30m') or an ISO date/datetime (e.g. '2024-01-01', '2024-01-01T08:00:00'). Bare values are interpreted as local time unless --utc is set. |
--phase | text | Test phase (or 'all') |
--data-dir | text | Results directory |
--top | integer | Number of top failures (default: 10) |
--group-by | {part, step, measurement} | Lens for the pareto: part groups runs by uut_part_number (most-failing SKUs); step groups steps by step_path (most-failing tests); measurement groups limit-bearing measurements by name (the historical default). (default: part) |
testerkit metrics ppk {#cli-metrics-ppk} #
Process performance (Ppk/Pp) per measurement.
| Argument / option | Type | Description |
|---|---|---|
--json | flag | Output as JSON |
--utc | flag | Interpret bare --since/--until values as UTC. Also enabled by setting TESTERKIT_UTC=1 in the environment. |
--station | text | Station ID |
--part | text | Part ID |
--until | text | Include runs started at or before this time. Same format as --since. |
--since | text | Include runs started at or after this time. Accepts a relative duration (e.g. '7d', '4h', '30m') or an ISO date/datetime (e.g. '2024-01-01', '2024-01-01T08:00:00'). Bare values are interpreted as local time unless --utc is set. |
--phase | text | Test phase (or 'all') |
--data-dir | text | Results directory |
--min-samples | integer | Minimum sample count (default: 10) |
testerkit metrics retest {#cli-metrics-retest} #
Retest rates: how often UUTs are retried.
| Argument / option | Type | Description |
|---|---|---|
--json | flag | Output as JSON |
--utc | flag | Interpret bare --since/--until values as UTC. Also enabled by setting TESTERKIT_UTC=1 in the environment. |
--station | text | Station ID |
--part | text | Part ID |
--until | text | Include runs started at or before this time. Same format as --since. |
--since | text | Include runs started at or after this time. Accepts a relative duration (e.g. '7d', '4h', '30m') or an ISO date/datetime (e.g. '2024-01-01', '2024-01-01T08:00:00'). Bare values are interpreted as local time unless --utc is set. |
--phase | text | Test phase (or 'all') |
--data-dir | text | Results directory |
--period | {day, week, month} | (default: day) |
testerkit metrics summary {#cli-metrics-summary} #
Yield summary: FPY, final yield, run counts, RTY, DPMO, DPPM, duration stats.
| Argument / option | Type | Description |
|---|---|---|
--json | flag | Output as JSON |
--utc | flag | Interpret bare --since/--until values as UTC. Also enabled by setting TESTERKIT_UTC=1 in the environment. |
--station | text | Station ID |
--part | text | Part ID |
--until | text | Include runs started at or before this time. Same format as --since. |
--since | text | Include runs started at or after this time. Accepts a relative duration (e.g. '7d', '4h', '30m') or an ISO date/datetime (e.g. '2024-01-01', '2024-01-01T08:00:00'). Bare values are interpreted as local time unless --utc is set. |
--phase | text | Test phase (or 'all') |
--data-dir | text | Results directory |
--period | {day, week, month} | (default: day) |
testerkit metrics time-loss {#cli-metrics-time-loss} #
Time lost to failures and errors.
| Argument / option | Type | Description |
|---|---|---|
--json | flag | Output as JSON |
--utc | flag | Interpret bare --since/--until values as UTC. Also enabled by setting TESTERKIT_UTC=1 in the environment. |
--station | text | Station ID |
--part | text | Part ID |
--until | text | Include runs started at or before this time. Same format as --since. |
--since | text | Include runs started at or after this time. Accepts a relative duration (e.g. '7d', '4h', '30m') or an ISO date/datetime (e.g. '2024-01-01', '2024-01-01T08:00:00'). Bare values are interpreted as local time unless --utc is set. |
--phase | text | Test phase (or 'all') |
--data-dir | text | Results directory |
--period | {day, week, month} | (default: day) |
testerkit metrics trend {#cli-metrics-trend} #
Yield trend over time.
| Argument / option | Type | Description |
|---|---|---|
--json | flag | Output as JSON |
--utc | flag | Interpret bare --since/--until values as UTC. Also enabled by setting TESTERKIT_UTC=1 in the environment. |
--station | text | Station ID |
--part | text | Part ID |
--until | text | Include runs started at or before this time. Same format as --since. |
--since | text | Include runs started at or after this time. Accepts a relative duration (e.g. '7d', '4h', '30m') or an ISO date/datetime (e.g. '2024-01-01', '2024-01-01T08:00:00'). Bare values are interpreted as local time unless --utc is set. |
--phase | text | Test phase (or 'all') |
--data-dir | text | Results directory |
--period | {day, week, month} | (default: day) |
testerkit new-test {#cli-new-test} #
Scaffold a new test file.
| Argument / option | Type | Description |
|---|---|---|
NAME | text |
testerkit runs {#cli-runs} #
List recent test runs.
| Argument / option | Type | Description |
|---|---|---|
--data-dir | text | Results directory |
--limit | integer | Number of runs to show (default: 20) |
--since | text | Show runs started at or after this time. Accepts a relative duration (e.g. '7d', '4h', '30m') or an absolute ISO date/datetime (e.g. '2024-01-01', '2024-01-01T08:00:00', '2024-01-01T08:00:00+05:00'). Bare values are interpreted as local time unless --utc is set. |
--until | text | Show runs started at or before this time. Same format as --since. |
--utc | flag | Display timestamps in UTC (trailing Z) and interpret bare --since/--until values as UTC. Also enabled by setting TESTERKIT_UTC=1 in the environment. |
--json | flag | Output as JSON |
testerkit sbom {#cli-sbom} #
Export CycloneDX SBOM for a test run's software environment.
| Argument / option | Type | Description |
|---|---|---|
RUN_ID | text | |
--data-dir | text | Results directory |
-o/--output | text | Output file (default: stdout) |
testerkit schema (group) {#cli-schema} #
JSON Schema generation for YAML validation.
testerkit schema export {#cli-schema-export} #
Export JSON Schema files for all TesterKit YAML types.
| Argument / option | Type | Description |
|---|---|---|
--output-dir/-o | text | Directory for .schema.json files (default: schemas) |
testerkit schema refresh {#cli-schema-refresh} #
Refresh .vscode/schemas/ and .vscode/settings.json after a TesterKit upgrade.
| Argument / option | Type | Description |
|---|---|---|
--project-dir | text | Project root (defaults to current directory). (default: .) |
testerkit serve {#cli-serve} #
Start the operator UI server.
| Argument / option | Type | Description |
|---|---|---|
--host | text | Host to bind to (default: 127.0.0.1) |
--port | integer | Port to bind to (default: 8000) |
--reload | flag | Enable auto-reload for development |
testerkit setup (group) {#cli-setup} #
Configure AI tool integrations.
testerkit setup claude-code {#cli-setup-claude-code} #
Configure TesterKit MCP server for Claude Code.
| Argument / option | Type | Description |
|---|---|---|
--print-only | flag | Print config instead of installing |
testerkit setup claude-desktop {#cli-setup-claude-desktop} #
Configure TesterKit for Claude Desktop.
| Argument / option | Type | Description |
|---|---|---|
--legacy | flag | Use legacy JSON config instead of .mcpb bundle |
--print-only | flag | Print config instead of installing |
testerkit setup cline {#cli-setup-cline} #
Configure TesterKit MCP server for Cline (VS Code extension).
| Argument / option | Type | Description |
|---|---|---|
--print-only | flag | Print config instead of installing |
testerkit setup codex {#cli-setup-codex} #
Configure TesterKit for OpenAI Codex.
| Argument / option | Type | Description |
|---|---|---|
--print-only | flag | Print config instead of installing |
testerkit setup copilot {#cli-setup-copilot} #
Configure TesterKit for GitHub Copilot (VS Code + CLI).
| Argument / option | Type | Description |
|---|---|---|
--print-only | flag | Print config instead of installing |
testerkit setup cursor {#cli-setup-cursor} #
Configure TesterKit for Cursor.
| Argument / option | Type | Description |
|---|---|---|
--print-only | flag | Print config instead of installing |
testerkit setup show {#cli-setup-show} #
Show current MCP server configuration.
(no options or arguments.)
testerkit show {#cli-show} #
Show details for a specific test run.
| Argument / option | Type | Description |
|---|---|---|
RUN_ID | text | |
--data-dir | text | Results directory |
-f/--format | {html, pdf, json, csv} | Generate report in format |
-o/--output | text | Output file or directory |
-t/--template | text | Report template name (default: default) |
--env | flag | Show environment snapshot |
-v/--verbose | flag | Show each step's full step_path (and the run's parquet file) as a location locator |
--utc | flag | Display timestamps in UTC (trailing Z). Also enabled by setting TESTERKIT_UTC=1 in the environment. |
testerkit station (group) {#cli-station} #
Station management commands.
testerkit station init {#cli-station-init} #
Initialize a new station configuration.
| Argument / option | Type | Description |
|---|---|---|
--station-id | text | Unique station identifier |
--name | text | Human-readable station name |
--location | text | Physical location |
testerkit station update {#cli-station-update} #
Re-discover and update instrument identity in configuration.
| Argument / option | Type | Description |
|---|---|---|
STATION_ID | text |
testerkit station validate {#cli-station-validate} #
Validate station instruments against configuration.
| Argument / option | Type | Description |
|---|---|---|
STATION_ID | text | |
--strict | flag | Fail on any mismatch |
testerkit validate {#cli-validate} #
Validate YAML configuration files.
| Argument / option | Type | Description |
|---|---|---|
PATHS... | path | |
--type/-t | {catalog, part, station, fixture, instrument_asset, project} | Explicit file type (skips auto-detection). |
--json | flag | Output as JSON |
Test phase #
test_phase tags every run with the maturity tier it was produced for (development, validation, characterization, production). It lands on every parquet row so dashboards and queries can filter by phase.
Setting the phase #
Resolution order (first match wins):
pytest --test-phase=<phase>— explicit per-run.TESTERKIT_TEST_PHASEenv var.- Default —
developmentwhen neither is set.
Git-status and mock enforcement #
Non-development phases require a clean git repository and real instruments. Uncommitted changes (or no git at all), or running with --mock-instruments, force the stamp down to development regardless of what was requested — a production-tagged row is then always reproducible from a commit hash and came from real hardware. (Profile selection still honors the requested phase; only the recorded stamp is demoted.)
| Git status | Requested | Stamp |
|---|---|---|
| Clean | validation | validation |
| Clean | production | production |
| Clean | (none) | development |
| Dirty | validation | development |
| Dirty | production | development |
| Dirty | (none) | development |
| No git | (any) | development |
| Any | (any, --mock-instruments) | development |
Query by phase #
import duckdb
duckdb.sql("""
SELECT * FROM read_parquet('data/runs/**/*.parquet')
WHERE test_phase = 'production'
""")
# Exclude dev work
duckdb.sql("""
SELECT * FROM read_parquet('data/runs/**/*.parquet')
WHERE test_phase != 'development'
""")See Profiles for the profile YAML shape.
Environment variables #
| Variable | Description |
|---|---|
TESTERKIT_HOME | Default data directory. Resolution: --data-dir arg → project testerkit.yaml data_dir: → TESTERKIT_HOME → platformdirs.user_data_dir("testerkit"). |
TESTERKIT_FILES_BACKEND | Selects the FileStore backend for captured artifacts; takes precedence over testerkit.yaml files.backend (default: local filesystem). |
TESTERKIT_TEST_PHASE | Default test_phase for runs (see Test phase above). |
TESTERKIT_TEST_PROFILE | Default profile name; equivalent to --test-profile. |
TESTERKIT_MOCK_INSTRUMENTS | Set to 1 to enable mock mode without passing --mock-instruments. |
TESTERKIT_AUTO_CONFIRM | Truthy → auto-resolve operator prompts and dialogs in non-tty contexts (CI, subprocess runs). Set to "confirm" to auto-confirm, "cancel" to auto-cancel; any other truthy value defaults to confirm. |
TESTERKIT_SERVER_URL | Server URL the dialog bridge uses to POST operator prompts from subprocess test runs back to the UI host (default: http://localhost:8000). |
TESTERKIT_UUT_SERIAL | UUT serial. In a multi-UUT run the orchestrator sets this per site-subprocess to that site's resolved serial (see Multi-UUT testing); assign per-site serials from the CLI with --uut-serials. |
TESTERKIT_UUT_PART_NUMBER | Default UUT part number (uut_part_number on every run). |
TESTERKIT_UUT_REVISION | Default UUT hardware revision. |
TESTERKIT_UUT_LOT_NUMBER | Default UUT lot / batch number. |
TESTERKIT_DAEMON_IDLE_TIMEOUT | Seconds a background daemon (events, runs, channels) waits idle before self-shutting-down (default: 300). |
TESTERKIT_DAEMON_SPAWN_TIMEOUT | Seconds to wait for a daemon to report ready after spawning (default: 30). |
TESTERKIT_CHANNELS_SYNC_PUSH | Set to 1 to force channel-sample writes to push synchronously instead of the default async push (determinism / debugging). |
TESTERKIT_SKIP_DAEMON_NOTIFY | Suppresses the daemon-notify hop — useful in tooling scripts that read stored runs without serving them. |
Exit codes #
| Code | Meaning |
|---|---|
0 | Success |
1 | General error (invalid options, missing files, validation failures) |
2 | Command not found / usage error (Click standard) |
See also #
- Platform architecture — what each entry point owns
- MCP tools — the agent-side parallel to most
testerkitsubcommands - Configuration — YAML files the CLI reads
- API reference — HTTP routes the
testerkit serveUI mounts