NewThe tragent CLI is on npm: npx @tragent/cli scan your-store.com

CLI reference

Install the tragent CLI, scan a store from your terminal, and run it in any CI.

Install

npx needs nothing installed. The package downloads the prebuilt binary for your platform from GitHub releases and checks it against the release's SHA-256 checksums before it runs.

Terminal
npx @tragent/cli scan https://your-store.com

To keep the command around:

Terminal
npm i -g @tragent/cli
tragent version

macOS, Linux and Windows, on x64 and arm64. Node 18 or newer. Package: @tragent/cli on npm; source of the releases and the GitHub Action: tragent-io/cli.

Commands

scan runs on your machine and needs no account. Every other command talks to the tragent API and needs an API key from Settings › API keys. Run tragent <command> -h for its flags.

CommandWhat it does
tragent scan <url>Score a URL for AI shopping readiness, on your machine. No account or key.
tragent testRun a test plan against a store with real agents, and optionally fail the build.
tragent runsList tests, or show one.
tragent reportFetch a test's report as Markdown or JSON.
tragent baselineAccept a finished test as the reference result, or show the current one.
tragent commentPost a test's readiness summary to a pull request.
tragent fixShow, write or propose the changes that resolve a test's findings.
tragent versionPrint the CLI version.

Scan flags

FlagWhat it doesDefault
--feedProduct feed URL; turns on the feed-against-page checks.—
--product-urlProduct pages to inspect when the home page does not link to them.—
--personaAgent style to scan as.assistant-browser
--platformCommerce platform hint: shopify, woocommerce, magento and others.—
--onlyComma-separated check ids to run.—
--formattext, md or json.text
--outWrite the report to a file.—
--gateExit 1 when the scan does not pass.—
--min-scoreWith --gate, the lowest passing score.—
--watchScan again on an interval while you edit, for example 30s.—
--timeoutOverall time limit for the scan.1m

Environment variables

VariableWhat it doesDefault
TRAGENT_API_KEYAPI key for every command except scan. Create one in Settings › API keys.—
TRAGENT_API_URLAPI root.https://api.tragent.io
TRAGENT_SKIP_DOWNLOADDo not download a binary; use the tragent already on PATH.—
NO_COLORTurn off colour in the output.—

Exit codes

A build can tell a store that got worse from a tool that could not measure it.

CodeWhat it does
0Passed the release check.
1The release check failed: a stage regressed, a stage failed, or the score is under the floor.
2Nothing was measured: bad flags, an unreachable API, or a test error. The build is not told your store broke.

GitHub Actions

tragent-io/cli@v1 installs the CLI on the runner, runs the test plan against your store and fails the job when the release check fails.

.github/workflows/tragent.yml
name: AI shopping readiness
on: pull_request

jobs:
  tragent:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      pull-requests: write
    steps:
      - uses: actions/checkout@v4
      - uses: tragent-io/cli@v1
        with:
          api-key: ${{ secrets.TRAGENT_API_KEY }}
          target: https://staging.shop.example
          suite: suites/retail-core.yaml
          comment: true

Inputs

InputWhat it doesDefault
api-keyAPI key (tk_live_…), from a repository secret. Required.—
targetThe store to test: its id, or the base URL of a store you have added. Required.—
suitePath to a test plan YAML in this repository.—
suite-idId of a test plan stored in tragent, instead of suite.—
projectProject id, slug or name. Optional when the organisation has one project.—
kindchecks for a quick store check, test for an AI shopping test.—
gateFail the job when the release check fails.true
waitWait for the test to finish. Needed for gating and the report.true
commentPost the result on the pull request. Needs pull-requests: write.false
timeoutHow long to wait for the test.30m
versionCLI release to install: latest or a tag such as v0.1.2.latest
report-pathWhere to write the Markdown report.tragent-report.md
api-urlAPI root.https://api.tragent.io

Outputs

OutputWhat it does
run-idThe test's id.
scoreAI shopping readiness, 0 to 100; empty when the test produced none.
statuspassed, warned, failed or errored.
gatepassed or failed.
report-pathThe Markdown report this step wrote.

GitLab CI

.gitlab-ci.yml
include:
  - remote: 'https://raw.githubusercontent.com/tragent-io/cli/v1/gitlab/.tragent.yml'

tragent:agent-readiness:
  variables:
    TRAGENT_TARGET: https://staging.shop.example
    TRAGENT_SUITE: suites/retail-core.yaml
VariableWhat it doesDefault
TRAGENT_API_KEYAPI key, as a masked and protected CI/CD variable. Without it the job skips itself.—
TRAGENT_TARGETThe store to test: its id or base URL. Required.—
TRAGENT_SUITEPath to a test plan YAML in the repository.—
TRAGENT_SUITE_IDId of a stored test plan, instead of TRAGENT_SUITE.—
TRAGENT_PROJECTProject id, slug or name.—
TRAGENT_KINDchecks or test.—
TRAGENT_GATEFail the job when the release check fails.true
TRAGENT_TIMEOUTHow long to wait for the test.30m
TRAGENT_REPORT_PATHWhere to write the Markdown report.tragent-report.md
TRAGENT_CLI_VERSIONCLI release to install.latest
TRAGENT_API_URLAPI root.https://api.tragent.io

Any other CI

Install the package, or download the binary for the runner from the releases page, and call it. The exit code is the result.

Terminal
npx -y @tragent/cli test \
  --target https://staging.shop.example \
  --suite suites/retail-core.yaml \
  --gate