DOCS
Automate

Command-line tool

testsy-ai.mjs: one file, Node 18 or later, no dependencies. Runs tests, waits for the verdicts, writes JUnit, uploads app builds and skips builds Testsy already has.

Get it#

curl -fsSL https://app.testsy.dev/cli/testsy-ai.mjs -o testsy-ai.mjs
export TESTSY_AI_API_KEY=qa_…          # Settings → API keys
node testsy-ai.mjs version
Variable
TESTSY_AI_API_KEYRequired.
TESTSY_AI_URLThe app's address. Default https://app.testsy.dev.

Commands#

testsy-ai below stands for node testsy-ai.mjs.

testsy-ai run --project <p_id> [--test <t_id,…>] [--mode auto|cold|warm] [--timeout 45m]
          [--junit file.xml] [--fail-on failed,error] [--no-wait] [--url <https://preview…>]
          [--build <app.apk | MyApp.app.zip | MyApp.app | https link | ab_id>]… [--label <text>] [--header "Name: value"]…
          [--device phone|tablet] [--os-version <latest | "iOS 26" | "Android 14">] [--orientation default|portrait|landscape]
testsy-ai devices
testsy-ai build upload <app.apk | MyApp.app.zip> --project <p_id> [--label <text>] [--fingerprint <text>] [--json]
testsy-ai build upload <file> --upload <signed link>
testsy-ai build import <https link> --project <p_id> [--header "Name: value"]… [--label <text>] [--fingerprint <text>] [--json]
testsy-ai build ensure <app.apk | MyApp.app.zip> --project <p_id> [--fingerprint <text>] [--label <text>] [--json]
testsy-ai build find --project <p_id> [--file <build> | --sha256 <hex>] [--fingerprint <text>] [--json] [--dotenv <file>]
testsy-ai builds --project <p_id>
testsy-ai status <j_id…>
testsy-ai projects
testsy-ai tests --project <p_id>

run starts every test in the project, or the tests you name (given both, both happen: the whole project runs and the named tests run once more; to run chosen tests on a new build file, upload it first with build ensure <file> --project p_… and pass the printed ab_ id: run --test t_… --build ab_…), then checks every 15 seconds until each has a verdict, printing each result with its link, and a summary. Under each started run it prints its watch link: a no-login link to follow the run live and read its result, for whoever reads the log. On GitHub the links are also the step output watch-urls and a column of the job summary; the JUnit report carries them in each case's system-out.

Large suites are checked in batches until every started run has a result. With --project, a test that cannot start (for example, the workspace has used its run allowance) is listed with the reason and included as an error in JUnit, and the command exits 2 even if the runs that did start all pass. With --test, a test that cannot start stops the command with the reason and exit 2. A missing run result remains unverified and cannot make the suite pass.

Flag
--modeauto (default), cold or warm: see learned paths.
--timeoutHow long to wait: 30s, 45m (default), 1h; a bare number is minutes.
--junit <file>Write a JUnit report: one case per started run or test that could not start; a failure as <failure>, any other non-pass as <error>.
--fail-onResults that make it exit 1. Default failed,error. Also blocked, inconclusive, cancelled.
--no-waitPrint the run ids as JSON; exit 0 if every selected test started, or 2 if any could not start.
--buildApp tests run these builds. A file is uploaded first, unless that exact file (same sha256) is already there; a raw .app folder is zipped for you; an https link is imported server-side; an ab_ id is used as is. Repeat it for several apps: each app test gets the build of its own app.
--deviceApp tests run on a phone or tablet this time; the tests keep their own setting.
--os-versionApp tests run on this OS version this time: latest, "iOS 26", "Android 14"… (testsy-ai devices lists them). It applies to every app test of the run, so in a project with both iPhone and Android tests use latest, or run each platform's tests with --test. Website tests named with --test cannot take --device, --os-version or --orientation.
--orientationApp tests start in this orientation this time: default (the device's own: phones and iPads upright, Android tablets on their side), portrait or landscape; the tests keep their own setting.
--headerWith a link: a request header for it, "Name: value", repeatable (Authorization or X-…).
--labelA label for uploaded builds. Default: the commit (the first 12 characters of GITHUB_SHA, or CI_COMMIT_SHORT_SHA).
--fingerprintStored with a single uploaded build: a hash of the app's native inputs, for build find later.
--urlWebsite tests start at this address instead of their saved one — a preview or staging deploy of the same site; the run explores from it. App tests are unaffected.

build upload uploads a build in parts (three at a time) and prints its id, or the whole build with --json. On GitHub, build upload and build ensure set the step outputs build-id and build-reused, and build import sets build-id; run sets only watch-urls. With --upload <link> it uploads to the signed links from the API's create_build_upload (an AI agent's shell), with no API key.

build import fetches a build from an https link server-side and prints its id. build ensure uploads only when the project does not already hold the file (by sha256) or, with --fingerprint, that native build; either way it prints the build id. build find only asks: with --file it hashes the file; it prints the id and exits 0 when a build exists, exits 1 when it must be built, and sets build-id and build-needed on GitHub (--dotenv <file> writes TESTSY_AI_BUILD_NEEDED and TESTSY_AI_BUILD_ID for GitLab). See skipping the build.

builds, tests and projects list ids; status prints runs as JSON; devices lists the phones, tablets and OS versions app tests can use.

In CI#

The tool recognises GitHub Actions, GitLab, CircleCI, Bitbucket, Buildkite, Azure Pipelines and Jenkins, and sends the commit, branch, job and job link with each run. On GitHub it adds a results table to the job summary. Each start sends an Idempotency-Key, and requests are retried on network errors, 5xx answers and 429 (rate limit), so a retry never starts a run twice.

Exit codes#

0 every run passed (or none ended in a --fail-on verdict) · 1 a run ended in a --fail-on verdict · 2 a setup or API problem · 3 timed out.