Skip to main content

CLI commands

The Aucert CLI provides three commands in Phase 1: init, run, and status.

aucert init

Initialize a new Aucert project in the current directory. Creates an aucert.config.yaml with default test configuration.

Syntax

aucert init [--app <path>] [--platform <android|ios>] [--force]

Flags

FlagDescriptionDefaultRequired
--appPath to APK/AAB fileAuto-detected from ./app/build/outputs/No
--platformTarget platformandroidNo
--forceOverwrite existing configfalseNo

Examples

Basic initialization — auto-detects your APK:

cd my-android-app
aucert init
Output
✓ Detected APK: ./app/build/outputs/apk/debug/app-debug.apk
✓ Platform: android
✓ Created aucert.config.yaml

Explicit APK path — useful when multiple build variants exist:

aucert init --app ./app/build/outputs/apk/release/app-release.apk

Re-initialize — overwrite an existing config:

aucert init --force

Exit codes

CodeMeaning
0Config created successfully
1Config already exists (use --force to overwrite)
2No APK found and --app not specified

aucert run

Execute a test run against your application. This is the primary command — it triggers the full AI testing pipeline.

Syntax

aucert run [--scope <scope>] [--watch] [--output <format>] [--max-tests <n>]

Flags

FlagDescriptionDefaultRequired
--scopeTest scope: navigation, user-flows, regression, or allallNo
--watchStream results in real-time as tests completefalseNo
--outputOutput format: json, junit, htmlFrom config (default: json)No
--max-testsMaximum number of test scenarios to generateFrom config (default: 100)No

Examples

Run all tests — default behavior:

aucert run
Output
▶ Starting test run...
Platform: android
APK: ./app/build/outputs/apk/debug/app-debug.apk
Scope: all (navigation, user-flows, regression)

⏳ Generating test scenarios... (12 scenarios)
⏳ Executing on emulator... [████████████████████] 12/12
⏳ Analyzing results...

✓ Test run complete
Passed: 10/12
Failed: 2/12
Confidence: 94.2% average

Results saved to ./aucert-results/run-2026-04-07T10-30-00Z.json

Run with live streaming — see results as each test completes:

aucert run --watch
Output (streaming)
▶ [1/12] Login → Home navigation ........................ PASS (98.1%)
▶ [2/12] Login with invalid credentials ................. PASS (97.5%)
▶ [3/12] Search → Product detail → Cart ................ PASS (95.3%)
▶ [4/12] Cart → Checkout → Payment ..................... FAIL (72.1%)
⚠ Expected: payment form displayed
⚠ Actual: loading spinner persisted after 5s timeout
...

Navigation tests only — fastest scope, tests screen transitions:

aucert run --scope navigation

Generate JUnit XML — for CI/CD test summary integration:

aucert run --output junit
Output location
Results saved to ./aucert-results/run-2026-04-07T10-30-00Z.xml

Exit codes

CodeMeaning
0All tests passed
1One or more tests failed
2Configuration error (missing config, invalid APK path)
3Authentication error (missing or invalid API key)
4Network error (cannot reach Aucert API)
tip

In CI/CD, exit code 1 (test failures) should fail the build. Exit codes 24 indicate setup problems that need fixing before tests can run.


aucert status

Check the status of current or past test runs. Useful for polling run completion in scripts or reviewing historical results.

Syntax

aucert status [--latest] [--run-id <id>] [--format <format>]

Flags

FlagDescriptionDefaultRequired
--latestShow the most recent runfalseNo
--run-idShow a specific run by IDNo
--formatOutput format: table, jsontableNo

Examples

Show all recent runs:

aucert status
Output
Run ID                               Status    Tests   Passed  Failed  Date
───────────────────────────────────────────────────────────────────────────────
a1b2c3d4-e5f6-7890-abcd-ef1234567890 complete 12 10 2 2026-04-07 10:30
f9e8d7c6-b5a4-3210-fedc-ba0987654321 complete 8 8 0 2026-04-06 14:15
11223344-5566-7788-99aa-bbccddeeff00 running 15 — — 2026-04-07 11:00

Show the latest run:

aucert status --latest

Show a specific run with JSON output — useful for scripting:

aucert status --run-id a1b2c3d4-e5f6-7890-abcd-ef1234567890 --format json
Output
{
"run_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"status": "complete",
"started_at": "2026-04-07T10:30:00Z",
"completed_at": "2026-04-07T10:32:15Z",
"scenarios": 12,
"passed": 10,
"failed": 2,
"average_confidence": 0.942
}

Exit codes

CodeMeaning
0Status retrieved successfully
1Run ID not found
3Authentication error

Global flags

These flags work with any command:

FlagDescription
--help, -hShow help for a command
--version, -vShow CLI version
--verboseShow debug-level output
--config <path>Use a custom config file path (default: ./aucert.config.yaml)
--no-colorDisable colored output (auto-disabled in non-TTY environments)

Authentication

The CLI authenticates via API key. Two methods:

  1. Environment variable (recommended for CI/CD):

    export AUCERT_API_KEY=your-api-key
    aucert run
  2. Interactive login (recommended for local development):

    aucert auth login

    Stores the token in ~/.aucert/credentials.

What's next