Analytics CLI
The endform query command returns Endform analytics data as raw JSON. Use it when you want to inspect suite runs or test runs from a terminal, script, or CI job.
The same underlying data powers Endform’s dashboard analytics: suite outcomes, test outcomes, durations, retries, branches, commits, projects, errors, and trace links.
Authentication
Section titled “Authentication”The command uses your active Endform login or the ENDFORM_API_KEY environment variable.
For local use, run:
npx endform@latest loginFor CI, set ENDFORM_API_KEY in your CI environment.
If your account has access to multiple organizations, set organizationId in endform.jsonc or pass --organization-id.
Query kinds
Section titled “Query kinds”There are two query kinds:
suite-runsreturns one row per Endform suite run.test-runsreturns one row per test result inside suite runs.
Use suite-runs to understand whole-suite behavior. Use test-runs to find individual failing, slow, or flaky tests.
Examples
Section titled “Examples”Find recent failing suite runs:
npx endform@latest query suite-runs --where 'suiteRun.outcome = fail' --last 7d --limit 20Find failing test runs from the last month:
npx endform@latest query test-runs --where 'testRun.outcome = fail' --last 30d --limit 50Find tests that needed retries:
npx endform@latest query test-runs --where 'testRun.testAttemptsCount > 1' --last 30d --limit 50Find slow test runs:
npx endform@latest query test-runs --where 'testRun.durationSeconds > 30' --last 7d --limit 50Find failures inside a specific suite run:
npx endform@latest query test-runs --where 'suiteRun.id = sr_123, testRun.outcome = fail' --last 5dFind passing suite runs in an absolute time range:
npx endform@latest query suite-runs --where 'suiteRun.outcome = pass' --from 2026-05-01T00:00:00Z --to 2026-05-28T00:00:00ZFind tests whose name contains checkout:
npx endform@latest query test-runs --where 'test.name ~= checkout' --last 2wTime ranges
Section titled “Time ranges”Use exactly one time range mode.
For a relative time range, use --last with h, d, w, or m:
npx endform@latest query test-runs --where 'testRun.outcome = fail' --last 24hFor an absolute time range, use both --from and --to with ISO 8601 timestamps:
npx endform@latest query suite-runs --where 'suiteRun.outcome = pass' --from 2026-05-01T00:00:00Z --to 2026-05-28T00:00:00ZFilters
Section titled “Filters”Filters are passed with --where. Separate multiple filters with commas.
Useful suite-level filters include:
suiteRun.idsuiteRun.outcomesuiteRun.durationSecondssuiteRun.maxTestAttemptsCountbranchcommitShasuite.repositorysuite.directory
Useful test-level filters include:
test.nametest.locationtest.describestestRun.outcometestRun.projectNametestRun.testAttemptsCounttestRun.durationSecondstestAttempt.errorMessagetestAttempt.errorLocation
Do not use testRun.* or testAttempt.* filters with suite-runs. Use test-runs instead.
Operators
Section titled “Operators”Supported operators include:
=equals!=not equals^=starts with$=ends with~=contains!~=does not contain>greater than>=greater than or equal<less than<=less than or equalinis one of several values!inis not one of several values
Pagination
Section titled “Pagination”The response includes pagination information. When page.hasMore is true, pass page.nextCursor to --cursor to fetch the next page.
npx endform@latest query test-runs --where 'testRun.outcome = fail' --last 30d --cursor <nextCursor>