AskUIDocs
Running Tests

CLI reference

The askui run command reference, targets, plans, devices, model selection, reports, exit codes, and CI usage.

The CLI runs the exact Projects you build in AskUI Desktop. The same tests/, plans/, procedures/, utils/, and devices.json drive both, author in the app, run anywhere with the CLI. See Install the CLI for setup and authentication.

askui run [<target>] [options]

Run from your Project root, or pass --project <dir>. Without arguments, askui run executes the whole tests folder (tests/, or the folder askui.json names as the tests path) on the Project's device (see Choosing the device).

askui --help and askui run --help print every option, the environment variables, and the exit codes. askui --version prints the CLI version. askui configure and askui config set up the machine the CLI runs on, see Configure the CLI.

On a machine with AskUI Desktop

On a machine where AskUI Desktop is installed, askui run runs a Project the way a run started in the app does. AskUI Desktop and the CLI share one configuration per machine and user: what you set in the app, the CLI uses, and what you set with askui config, the app shows.

SettingFrom this machineWhat overrides it
ModelThe model you chose in the app or with askui config: AskUI Inference with its hosted model, or, with a license, your own model (AskUI AirGap, AskUI ModelBridge), with its truncation settings--model-provider, --model-id, the ASKUI_GLOBALMODEL__*, ASKUI_RUNS__MODEL__* and ASKUI_PROVIDERS__* variables
In-Flight Guidance modelThe Project's In-Flight Guidance model, else the global modelthe ASKUI_INFLIGHTGUIDANCE__MODEL__* variables
SecretsThe Project's secrets in the app, including the ones the agent may typeAn environment variable of the same name
Network proxyThe proxy of this machineHTTPS_PROXY, HTTP_PROXY, ALL_PROXY, NO_PROXY, the ASKUI_NETWORK__PROXY__* variables
Reporting modelThe Project's reporting model on Extending → Reporting, else the global modelthe ASKUI_REPORTING__MODEL__* variables
AgentOS controllerThe controller path under Settings → This machine → ComputerASKUI_SETUP__AGENTOS__CONTROLLERPATH, ASKUI_CONTROLLER_PATH

A flag wins over the file --config names, which wins over an environment variable, which wins over the Project's .env, which wins over the Project's settings and this machine's value (Which value wins).

The credentials come from the CLI's own askui login or from the environment (ASKUI_WORKSPACE_ID and ASKUI_TOKEN), never from the app's sign-in (see Install the CLI, step Authenticate).

What the Project's device profile says, its display, user session and proxy setting, always applies, on every machine: a desktop connects the way the app connects it.

To ignore what is stored on the machine, as on a CI runner, pass --ignore-app-settings, or set ASKUI_IGNORE_APP_SETTINGS=1 for a whole pipeline. The CLI's own settings, your credentials, and the environment variables still apply. askui status prints what a run would use, with where each value comes from: the credentials, the workspace, the entitlement, the model, and the proxy. Every run names its model and workspace, and their source, in its first line.

What a run does

For every test, the agent works in phases: the folder's setup.md (if present) runs first, then the tests, then teardown.md, with any rules.md applied throughout. Each phase is one autonomous agent execution that reads the test file, drives the UI, and records the test's result. When you target a nested folder tree, setups run top-down, teardowns bottom-up, and rules.* and ui.* accumulate per level, always starting at the tests root, so tests/rules.md and tests/ui.md apply to every run shape; a failing setup blocks the tests it guards, they show as SKIPPED.

The target

TargetBehavior
(none)Runs the Project's tests/ folder.
A folderRuns every test in the folder recursively, with per-folder setup/teardown lifecycle.
A single fileRuns one test, its ancestor folders' setups still run first (top-down) and teardowns after (bottom-up).

Relative targets resolve against --project. Supported test file types: .txt, .md, .pdf, .csv, .json. A target that does not exist, or a file of another type, stops the run with exit code 3.

Test plans

askui run --plan smoke

--plan <name> loads plans/<name>.yaml, a test plan, and runs exactly the tests it selects, in plan order, on the plan's device. A plan that does not exist or does not parse is exit code 3. A plan that selects no tests is exit code 4: nothing ran, so the pipeline never shows green for nothing.

Run options

OptionDefaultDescription
<target>testsTest folder or single test file, relative to --project.
--plan <name>noneTest plan from <project>/plans/<name>.yaml (name without extension).
--project <dir>current directoryThe AskUI Project root (tests/, procedures/, plans/, utils/, devices.json).
--output <dir><project>/agent_workspace/<timestamp>Results directory for the Developer Report, the summary, the recorded results, and screenshots. Named in local time, as AskUI Desktop names its runs.
--reporter <list>html,mdReports the console names, comma-separated: html, md, junit. junit also writes junit.xml. See Reports.
--device <profile>the plan's device, or the only profileDevice profile from devices.json, by id or by a name only one profile has.
--surface <kind>noneAd-hoc run without a profile: agent-os, web, android, or ios. Excludes --device.
--cache on|offthe Project's setting, else offTrajectory caching for this run. See Caching.
--cache-dir <dir><project>/.askui_cacheFolder of the recorded trajectories.
--cache-set <name>=<value>the Project's settingOne caching setting for this run. Repeatable.

Choosing the device

The CLI runs on the device profiles your team keeps in the Project's devices.json, so a Project that runs in the app runs on the same device from the CLI. The profile's name and prompt text join the agent's system prompt, the same device knowledge as an in-app run.

The CLI picks the device in this order:

  1. --device <profile>: a profile by its id, or by its name when only one profile has that name.
  2. --surface <kind>: an ad-hoc device with the defaults of its kind, no profile needed (see below).
  3. The plan's device: with --plan, the profile the plan names. A device id that is no longer in devices.json is skipped with a note.
  4. The only profile: when devices.json holds exactly one profile.

When several profiles fit, the CLI asks you to pick one at a terminal. In a pipeline it never asks: it stops with exit code 3 and lists the profile ids, so you add --device. A Project without devices.json needs --surface.

# The profile named "Staging browser"
askui run --device "Staging browser"

# A plan, on the device the plan names
askui run --plan smoke

# Ad-hoc: a browser, no profile needed
askui run --surface web

Ad-hoc devices with --surface

SurfaceWhat the agent drives
agent-osThis computer, through a local AgentOS on localhost:23000, display 1. The CLI starts it when it is not running.
webA Chromium browser in a visible window.
androidThe first device adb devices lists.
iosA booted simulator through an idb_companion you started, on localhost:10882.

For anything else, a remote AgentOS, a second display, a specific Android serial, a headless browser, or a start URL, create a profile in AskUI Desktop and select it with --device.

Environment variables in a profile

A profile can leave its connection details to the machine that runs it. Write ${VAR} in the host, serial, udid, start URL, or browser field, and the CLI fills it from the environment (or the Project's .env):

devices.json (excerpt)
{
  "id": "a1b2c3",
  "name": "Test VM",
  "type": "agent-os",
  "host": "${AGENTOS_HOST}",
  "port": 23000
}

The profile travels with the test repository, and each runner supplies its own host or serial. A ${VAR} that nothing sets stops the run with exit code 3, it never falls back to an empty value. A remote host is attached to; the CLI starts AgentOS only on localhost.

Devices the CLI starts

The CLI connects a profile the way AskUI Desktop does. A profile that provisions an Android emulator or an iOS simulator gets it started for the run, and the CLI prints each phase (booting, waiting for the device) as it goes. After the run, the profile's setting decides whether the device stops or keeps running. A device that is already running is reused when the profile says so.

Multi computer profiles and phones driven through the AskUI Remote Companion run as in the app.

A provisioned device that AskUI Desktop holds right now stops the run with exit code 3. Disconnect it in the app first, so the two do not share the device.

Profiles the CLI does not run

These profiles stop the run with exit code 3 and a message that names the reason:

  • A profile that provisions a remote VM. Connect it in AskUI Desktop, then run on a profile that points at its host.
  • A multi-surface profile that combines several kinds of device.
  • A managed iOS simulator without a udid.

A web profile's start URL opens once the browser connects. A start URL that does not load stops the run with exit code 3, and the message names the URL.

Model options

On a machine with AskUI Desktop, the run uses the model of this machine, chosen in the app or with askui config (see above). The options below win over it for one run. Otherwise, inference runs through AskUI Inference, billed to your workspace and authenticated with your askui login or with ASKUI_WORKSPACE_ID and ASKUI_TOKEN. AskUI Inference serves more than one model. Missing credentials stop the run with exit code 3 before the first model call. Credentials the provider rejects, such as an expired token or a wrong API key, also stop the run with exit code 3. The message names the provider and says where to fix them.

OptionDefaultDescription
--model-provider <p>askuiaskui (AskUI Inference), airgap (AskUI AirGap), or your own anthropic, openai, openai-compatible, or vertex.
--model-id <id>provider defaultThe model to use. With askui, selects the hosted model: claude-sonnet-5-5, claude-opus-5-5, claude-haiku-5-5 or gemini-3.8-flash; default is the model chosen in AskUI Desktop, else claude-sonnet-5-5.
--model-endpoint <url>noneEndpoint URL. Required for openai-compatible; a URL ending in /chat/completions is used as-is, a base URL gets the path appended.
--model-api-key <key>noneAPI key, sent as x-api-key or Authorization, per provider.
--model-token <token>noneBearer token, e.g. an OAuth access token (Entra, gateways).
--model-headers <k=v,..>noneAuthentication headers, comma-separated name=value pairs, sent instead of --model-api-key and --model-token.
--model-provider-vertex-project <id>noneVertex AI: the Google Cloud project with the model enabled. Required for vertex.
--model-provider-vertex-location <loc>noneVertex AI: the location, such as global, us, or eu. It decides where requests are processed. Required for vertex.
--model-provider-vertex-credentials <file>Application Default CredentialsVertex AI: a service-account key or user login (JSON). Without it, GOOGLE_APPLICATION_CREDENTIALS, then gcloud auth application-default login.

--model-endpoint, --model-api-key, --model-token, and --model-headers work with airgap and your own provider only (anthropic, openai, or openai-compatible); with askui they are a usage error (exit code 2). airgap needs --model-endpoint (your AskUI AirGap Hosting) and --model-id; the key is optional. As in the app, a Claude model at an endpoint that does not end in /v1 speaks the Anthropic API, every other model the OpenAI-compatible one. vertex takes the --model-provider-vertex-* options instead, and these options work with vertex only.

# Hosted models on the AskUI hub
askui run                                   # the app's model, else Claude Sonnet 5.5
askui run --model-id gemini-3.8-flash       # hosted Gemini

# Bring your own model
askui run --model-provider anthropic --model-api-key "$ANTHROPIC_API_KEY"
askui run --model-provider openai-compatible \
  --model-endpoint http://localhost:8000/v1 \
  --model-id Qwen/Qwen3-VL-30B-A3B-Instruct
askui run --model-provider openai-compatible \
  --model-endpoint https://gateway.example.com/v1 \
  --model-token "$GATEWAY_TOKEN"

# A model on your AskUI AirGap Hosting
askui run --model-provider airgap \
  --model-endpoint http://airgap.internal:8000/v1 \
  --model-id Qwen/Qwen3-VL-235B-A22B-Instruct

# Claude on Vertex AI, in your own Google Cloud project
askui run --model-provider vertex --model-id claude-sonnet-5-5 \
  --model-provider-vertex-project my-project \
  --model-provider-vertex-location eu \
  --model-provider-vertex-credentials service-account.json

Pass keys and tokens from the environment, as above, so they never land in a pipeline file.

The agent drives the UI from screenshots, so BYOM models must be vision-capable: a text-only model will connect but can't see the screen.

Output and modes

The CLI talks in one of two modes. The mode changes only how it talks, never what it runs or which exit code it returns.

  • Interactive at a terminal: colored output, and a prompt when several devices fit.
  • CI when the CI environment variable is set (any value), or stdin or stdout is redirected: one plain line per event, and never a prompt.
OptionDescription
--ciForce CI mode.
--interactiveForce interactive mode.
--no-colorDisable colored output. The NO_COLOR environment variable (any value) does the same.
-v, --verboseMore output: also the agent's messages.
-q, --quietErrors only.

These options work before or after run. --ci with --interactive, and --verbose with --quiet, are usage errors. Errors always go to stderr.

Signing in

CommandWhat it does
askui loginSigns the CLI in with your AskUI account, in the browser. Without a browser (SSH, no display) it shows a link and a code to confirm on any device.
askui login --use-device-codeAlways uses the link and the code.
askui login --workspace <name>Picks the workspace when your account has several.
askui config set workspace <name>Switches the workspace later, by name or id, without signing in again.
askui statusShows the signed-in account and the day the sign-in ends, the workspace and the model a run would use.
askui logoutEnds the sign-in at AskUI and deletes it on this machine.

A run of hours keeps its sign-in valid as it goes. The sign-in itself lasts 90 days: askui status shows the day it ends, and in the last 14 days every run reminds you to run askui login again. It belongs to the CLI alone; signing out of AskUI Desktop does not sign out the CLI, and the other way round. ASKUI_WORKSPACE_ID and ASKUI_TOKEN, when set, win over the sign-in.

askui login signs in existing accounts only. If it says your account is not finished, confirm your email address and accept the terms in the AskUI Hub or in AskUI Desktop, then run it again. On macOS the sign-in is kept in the Keychain; in an SSH session the Keychain is locked, so unlock it first with security unlock-keychain.

Environment variables

askui run --help lists every environment variable a run reads:

VariableWhat it does
ASKUI_WORKSPACE_IDYour AskUI workspace, for AskUI Inference.
ASKUI_TOKENAn access token of that workspace, from the AskUI Hub.
ASKUI_IGNORE_APP_SETTINGS1 or true: as --ignore-app-settings, for a whole pipeline.
ASKUI_COMPONENT_REGISTRY_FILEThe AgentOS component registry that names the installed controller.
ASKUI_INSTALLATION_DIRECTORYThe AgentOS installation folder to find the controller in.
CIAny value forces CI mode.
NO_COLORAny value turns colors off.

Every setting has a variable too, ASKUI_ and its key in capitals with __ between the levels, such as ASKUI_GLOBALMODEL__MODELID or ASKUI_PROVIDERS__AZURE_PROD__APIKEY. It wins over the stored value and the Project's .env. A few settings also answer to an earlier name: ASKUI_INFERENCE_ENDPOINT, ASKUI_CONTROLLER_PATH, ASKUI_ADB_PATH, ASKUI_LICENSE_KEY, ASKUI_IDP_BASE_URL, ASKUI_IDP_CONSOLE_URL, ASKUI_IDP_API_KEY, and HTTPS_PROXY, HTTP_PROXY, ALL_PROXY and NO_PROXY for the system proxy. ASKUI_NUGET_TIMEOUT_SECONDS is gone: set ASKUI_CUSTOMTOOLS__NUGETTIMEOUTMS in milliseconds. askui run --help lists every variable, and Configure the CLI lists the settings.

Credentials and .env

The CLI loads a .env file from the Project root at the start of every run, variables already set in the environment win. This carries the hub credentials (ASKUI_WORKSPACE_ID, ASKUI_TOKEN), the ${VAR} values of your device profiles, and the values of your secrets.

A new Project comes with a .gitignore that keeps .env and agent_workspace/ out of git, so a commit carries no secret and no run results.

Treat access tokens like passwords: in CI, inject them from the secret store instead of committing a .env file. See Workspaces & access tokens.

Secrets

On a machine with AskUI Desktop, the run takes the Project's secrets from the app, as a run in the app does: a secret marked Agent may use this secret is one the agent can type by name, and every secret resolves ${NAME} (in a tool config or an MCP header) and os-keychain://NAME. An environment variable of the same name wins over the app's value. The run then warns, on the console and in the report, because it types another value than a run started in the app.

On a CI runner the environment takes the secret store's place: ${NAME} and os-keychain://NAME resolve from the environment variable NAME. Set QA_PASSWORD in the pipeline's secret store, and a tool config that references ${QA_PASSWORD} gets its value. On a runner without AskUI Desktop the agent gets no secrets to type, and the Read MFA Code tool has no authenticators: a test that needs either runs where AskUI Desktop is installed.

Custom tools and MCP servers

The CLI extends the agent exactly as the app does: the Project's custom tools in utils/custom_tools/, the tools enabled in utils/tools.json, and the MCP servers in utils/mcp.json. Custom tools compile at run start, so the runner needs NuGet access for their #:package lines.

As in the app, a custom tool that does not compile stops the run before the first model call (exit code 3), and an enabled MCP server that cannot be reached is a warning: the run goes on without its tools.

Caching

The CLI caches as the Project says: Extending → Caching in the app writes utils/caching.json, and askui run reads the same file. A Project without that file caches nothing. Flags change the Project's setting for one run, and a flag you pass always wins:

  • --cache on or --cache off turns caching on or off.
  • --cache-dir <dir> moves the recordings out of <project>/.askui_cache.
  • --cache-set <name>=<value> changes one setting. Repeat it for more.

--cache-set takes the names of utils/caching.json:

NameValues
delaySecondsSeconds between replayed actions, 0 to 30
skipVisualValidationtrue or false
visualThresholdHow much a screen may differ, 0 to 64
visualRegionSizePixels compared around each action, 1 to 1000
visualMethodphash, ahash, or none
parameterStrategyllm or preset
askui run --cache on --cache-set delaySeconds=2 --cache-set visualMethod=ahash

A wrong name or a value out of range is exit code 2. --cache-set alone does not turn caching on: only --cache on or the Project's setting do.

Reports

Each run writes its results into the output directory (see --output), the same files as a run in the app. --reporter decides which of them the console names at the end, and adds JUnit:

FormatFile
htmlreport.html, the Developer Report: the run with every step and screenshot. AskUI Desktop opens the same file from Developer Report on the Runs page. Always written.
mdsummary_report.md: the run at a glance, totals with per-status counts and run duration, one table over all tests with status and duration each, and detail sections quoting the recorded reason of every warned, failed, or broken test. Always written.
junitjunit.xml, for the test report view of your CI system. Written only with junit.

The default is html,md. For CI, add JUnit: --reporter html,md,junit.

Each test also gets its execution report, as in the app: the Project's Create report setting on the Reporting tab decides for which tests. The CLI writes the reports while the next test runs and waits for the last ones before it ends. Each report is one more model call, so set Create report to failures only or off to save it in a pipeline.

Every run also writes the recorded results and the run's history:

FileHolds
<test_name>/<test_name>_result.jsonThe recorded result: status, reason, start and end time.
<folder>_setup_result.jsonThe recorded result of a folder's setup, directly in the run folder. Teardowns write <folder>_teardown_result.json.
conversation.json, run_meta.jsonThe run's conversation, model, cost, and planned tests. With them the run shows up in AskUI Desktop's run history and dashboard like a run started in the app, marked as a CLI run.

Files a web test downloads land in <output>/downloads, as in the app, unless the profile names another folder. After Ctrl+C, the results cover what the run reached.

JUnit mapping

AskUI has more outcomes than JUnit, so the mapping is fixed:

AskUI statusIn junit.xml
PASSEDpassed
WARNINGpassed, with the warning in system-out
FAILEDfailure
BROKENerror, with the reason
SKIPPED, DISCARDED, DEPRECATEDskipped

A test that never started is SKIPPED, so it appears as skipped.

junit.xml and summary_report.md count the same recorded results.

The console

The console shows each phase as it starts and finishes ([test] tests/login.md -> passed), with each test's recorded result, and ends with one summary line that counts the passed, failed, broken, and warned tests. A test the run never started is SKIPPED; when the run stopped before all its tests started, the line adds how many as not executed, and the run does not pass.

Exit codes

CodeMeaningWho acts
0All tests passed. Warnings are allowed.nobody
1At least one test failed or broke, a setup failed, or the run stopped before all its tests started. Tests a failed setup kept from starting are SKIPPED and add nothing beyond the setup's failure.the product team
2Usage error: an unknown option, a missing or bad value, or two options that exclude each other.the pipeline author
3Environment or configuration error: missing or rejected credentials; a project, target, or plan that cannot be read; a custom tool that does not compile; a device that cannot be reached; a test that declares several platforms; a profile the CLI cannot run; an unset ${VAR}; a start URL that does not load; a provisioned device that AskUI Desktop holds.the pipeline author
4No tests ran: the selection was empty, or no test result was produced.the pipeline author
130Canceled (Ctrl+C). The results written so far are kept.whoever pressed Ctrl+C

A usage error or a configuration error ends the CLI before the first model call, or at it when the provider rejects the credentials, so it costs nothing. A warning never changes the exit code.

Of the setups and teardowns, only a failed or broken setup counts: it fails the run, and exit code 1 follows. A teardown's result and a setup's warning appear in summary_report.md but never change the exit code. A failed teardown never stops the run, it goes on with the next folder.

Upgrading from an earlier CLI

Exit code 2 used to cover configuration errors too; those are exit code 3 now. Caching used to run by default. It now follows the Project and is off without utils/caching.json, so pass --cache on to keep the old behavior. Several flags were renamed or removed. An old flag is a usage error (exit code 2), so an old pipeline fails loudly instead of running something else:

OldNow
--project-root--project
--workspace--output
--api-key, --endpoint-url--model-api-key, --model-endpoint
--controller-host, --controller-port, --display, --device-seriala device profile, selected with --device
--cache-strategy auto|none--cache on|off
--cache-delay-between-actions, --cache-skip-visual-validation, --cache-visual-validation-threshold, --cache-visual-validation-region-size, --cache-visual-verification-method, --cache-parameter-identification-strategy--cache-set with delaySeconds, skipVisualValidation, visualThreshold, visualRegionSize, visualMethod, parameterStrategy

Running in CI

The exit codes make askui run CI-native: the job fails exactly when tests fail, and a broken runner fails with a different code than a failed test. A minimal GitHub Actions job:

.github/workflows/ui-tests.yml
jobs:
  ui-tests:
    runs-on: [self-hosted, askui]   # a runner with the CLI and the device it needs
    env:
      ASKUI_WORKSPACE_ID: ${{ vars.ASKUI_WORKSPACE_ID }}
      ASKUI_TOKEN: ${{ secrets.ASKUI_TOKEN }}
    steps:
      - uses: actions/checkout@v4
      - run: askui run --plan smoke --output ./run-artifacts --reporter html,md,junit
      - uses: actions/upload-artifact@v4
        if: always()
        with:
          name: askui-run
          path: ./run-artifacts

Pin --output to a fixed path so the artifact upload finds the reports, and upload with if: always() so failing runs keep their evidence. Set other settings for the pipeline as environment variables too, such as ASKUI_GLOBALMODEL__MODELID or HTTPS_PROXY (In CI). For installing the CLI on a runner, publishing junit.xml as a test report, and what each device needs on the runner, see AskUI in CI.

On this page