CLI Command Reference
Complete reference for Ansight CLI commands, subcommands, aliases, global options, identifier discovery, and process exit codes.
This page lists every command currently published by the Ansight CLI. The installed executable remains authoritative for version-specific details:
ansight help
ansight help --beta
ansight <command> --help
Canonical interface. Use this reference for command discovery and confirm version-specific details against the help shipped with the installed CLI.
Experimental commands are separately marked Beta feature throughout this reference and appear in ansight help --beta.
Local developer tools are free and source available. Capture, inspection, local automation and replay require no account or subscription. Sign in for cloud sharing, uploads and remote job delegation. Cloud services enforce their own permissions and usage limits; cloud access denials return exit code 6. Use ansight account access --json to verify cloud sign-in.
Local tools work before sign-in. Optional cloud account commands:
ansight help
ansight --help
ansight <command> help
ansight <command> --help
ansight version
ansight info
ansight --version
ansight doctor [options]
ansight capabilities [options]
ansight host status [options]
ansight host stop [options]
ansight config list
ansight config get explorer-path
ansight config get explorer-port
ansight config set explorer-path <path>
ansight config set explorer-port <port>
ansight config unset explorer-path
ansight config unset explorer-port
ansight account [open]
ansight account access [--json]
ansight account login [options]
ansight account refresh
ansight account status
ansight account logout [--local]
ansight auth login [options]
ansight auth refresh
ansight auth status
ansight auth logout [--local]
Syntax and global options
ansight <command> [subcommand] [arguments] [options]
| Option | Meaning |
|---|---|
--help, -h, -? | Show help for the selected command family. |
--version | Show the CLI version, daily build number, and installed update channel. |
--beta | Include beta feature commands in CLI help. |
--json | Emit a versioned machine-readable result. |
--silent | Suppress stdout and stderr, overriding JSON output. |
--verbose | Include debug, telemetry, and app-event diagnostics. |
--headless | Do not open simulator/emulator windows for device launches during this command. Windows are shown by default. |
--data-dir <path> | Select host state; also supported through ANSIGHT_DATA_DIR. |
--adb-path <path> | Select an ADB executable or Android SDK directory. |
--xcode-path <path> | Select an Xcode app or Developer directory. |
--secret-store-file <path> | Use an encrypted file instead of the OS credential vault. |
--secret-key-file <path> | Read the encrypted store’s AES key from a protected file. |
--discovery-port <port> | Override the UDP SDK discovery port. |
--websocket-port <port> | Override the SDK WebSocket port. |
--node-path <path> | Select the Node.js runtime used for repository modules. |
Headless device launches
Add --headless to any command that can start a device, including device start
(boot), app execute, app-graph explore --launch, replay, test run,
test run-all, and profile dotnet|ios|android start. It also applies to
device starts performed by agent tools during execution, graph runs, or tasks.
The option is preserved when forwarding to a resident host and for detached profiling.
On iOS, Ansight boots the simulator without opening Simulator.app. On Android,
new emulators use -no-window. Physical devices are unaffected. The flag does
not close existing windows or restart already-running emulators; reused sessions
keep their existing window state.
Use the flag on the command doing the work, not just on host run. It applies
to every selected target in a multi-device run. It is independent of --json,
--silent, and --open; CI does not change the visible-by-default policy.
# Boot a device without its native viewer.
ansight device start ios <simulator-id> --headless
ansight device boot android <avd-name> --headless
# Launch an app for execution or App Graph exploration.
ansight app execute --app-id com.example.app --device-id <device-id> \
--prompt "Verify the home screen" --headless
ansight app-graph explore com.example.app --launch --headless
# Run tests or replay recorded behavior without opening device windows.
ansight test run . onboarding.smoke --headless --json
ansight test run-all . --headless --json
ansight replay ansight <recorded-session-id> --device-id <device-id> --headless
# Start a profiling capture; the flag also works without --wait on a resident host.
ansight profile dotnet start ./App.apk --app-id com.example.app \
--device-id <android-device-id> --headless --wait
ansight profile ios start ./App.app --app-id com.example.app \
--device-id <simulator-id> --headless --wait
ansight profile android start ./App.apk --app-id com.example.app \
--device-id <android-device-id> --headless --wait
app-graph run, connected-session app execute, test run-inline, task run,
and repo task run also accept the flag for any device starts their tools
request. It does not replace those commands’ live-session prerequisites.
After installing a newer CLI, compare ansight version --json with
ansight host status --json. A running host keeps its loaded code until it is
restarted; coordinate that restart before relying on newly added launch options.
See Update the CLI.
Command index
Version and updates
ansight version [--json]
ansight update check [--channel public|preview] [--json]
ansight update [--channel public|preview] [--json]
ansight update --version <version> --build-number <YYYYMMDDNN>
The build identity combines the human version string with the monotonically
increasing daily integer build number. The public or preview update channel is
stored in the installation receipt, so promoting an identical preview archive
does not alter its embedded build identity. update check is read-only;
update downloads the platform installer and changes the active version only
after its archive checksum and executable are validated.
| Option | Applies to | Meaning |
|---|---|---|
--json | version, update check, update | Emit the complete versioned build or update result. |
--channel <public|preview> | update check, update | Check or select a release channel. Without this flag, the installed channel is used. |
--version <version> | update check, update | Select an exact human-readable release version. It must be supplied with --build-number. |
--build-number <YYYYMMDDNN> | update check, update | Select the exact positive daily build number. It must be supplied with --version. |
analytics
Mandatory engagement analytics records pseudonymous daily active use, any CLI command at most once per 24 hours without its name, and one engaged event per hour after two local actions. Help, version, update, authentication, diagnostics, analytics, and failed commands do not count as active use. The installer separately records successful installs and updates. Detailed analytics requires sign-in and explicit opt-in for that account, then adds normalized command, action, category, feature scope, outcome, duration bucket, and interactive-use fields; it does not include raw arguments, paths, identifiers, prompts, logs, or captured content.
| Option | Meaning |
|---|---|
--data-dir <path> | Read or change analytics settings in a non-default Ansight data directory. |
--json | Emit the versioned analytics status result. |
config
Stores local CLI defaults in the selected Ansight data directory. The
settings command is an alias for config.
ansight config list
ansight config get explorer-path
ansight config get explorer-port
ansight config set explorer-path <path>
ansight config set explorer-port <port>
ansight config unset explorer-path
ansight config unset explorer-port
The built-in explorer path is /ansight/. explorer-path accepts / or one
URL-safe path segment when a different fixed path is needed. Explicit
host run --serve-path and serve --path values take precedence over the
configured setting.
The built-in explorer port is 47231, making the default local URL
http://127.0.0.1:47231/ansight/. explorer-port accepts an integer from 1
through 65535 when a different fixed port is needed. host run --serve-port
and serve --port can supply a one-run override. Restart a running resident
host after changing either setting.
Fixed paths are easier for other local software to discover than the random
capability path, so only configure one on a trusted machine. Use
ansight config unset explorer-path to restore the random path and
ansight config unset explorer-port to restore automatic port selection.
| Option | Meaning |
|---|---|
--data-dir <path> | Read or change settings in a non-default Ansight data directory. |
--json | Emit the versioned ansight.cli-config/v1 result. |
The JSON result identifies the selected setting for get, set, and unset
and includes the complete settings collection so clients can discover both
configured values without parsing terminal text.
account
ansight account, ansight account open, and the
portal alias open app.ansight.ai in the default
browser. If the browser cannot be opened, the command prints the portal URL and
the browser warning and returns exit code 1.
account login, refresh, status, and logout delegate to the corresponding
auth commands, so scripts can manage authentication from either
family.
account grants reports the plan, effective access
status, validity period, retention, limits, and enabled cloud capabilities for
every accessible organisation. Pass --team-id <uuid> to inspect one
organisation. account grant is an alias.
account access verifies cloud sign-in with the
server and reports isAuthorized, reason, evaluatedAt, and authorizedUntil.
It remains available after expiry and returns exit code 6 when access cannot
be verified. auth status reports sign-in state, not cloud service permissions.
account usage reports the selected organisation,
the operational AI token bucket, and the workload-identity OpenAI billing
allowance as separate balances. It also reports whether the billing period is
current and whether hosted execution is presently available. account budget
is an alias. When one current organisation permits hosted computation it is
selected automatically; otherwise pass --team-id <uuid>.
| Option | Meaning |
|---|---|
--team-id <uuid> | For account grants or account usage, select one organisation by non-empty UUID. |
--json | For portal, grants, and usage operations, emit the complete versioned result. Authentication actions use the authentication options. |
serve
Starts a transient loopback web explorer and SDK host until interrupted.
ansight serve [--session <id>] [--port <port>] [--path <path>] [--open]
| Option | Meaning |
|---|---|
--session <id> | Select the session shown when the explorer opens. |
--port <port> | Override the configured explorer-port; 0 selects an available HTTP port for this run. |
--path <path> | Override the configured explorer-path with / or a fixed URL-safe segment. Fixed paths are easier to discover. |
--open | Open the explorer in the default browser after it starts. |
--enable-repository-automations | Permit trusted repository trigger execution in this host. This is the default. |
--disable-repository-automations | Disable repository trigger execution for this host. |
--automation-repository <path> | Load a trusted trigger repository at startup. Repeat the flag to load more than one repository. |
host
host run prints and records its CLI version, daily build number, abbreviated commit,
and host log path at startup. CLI-host diagnostics are persisted as
<data-directory>/logs/host-<timestamp>-<pid>.log; use ansight host logs instead
of locating that path manually. Captured application logs belong to sessions:
find them with ansight session list --has-logs, then query them with
ansight session logs <session-id>.
On macOS and Windows, the tray menu can restart the resident host. It shows
Update Ansight only when the installed channel reports a newer compatible CLI;
the update installs in the background, and Restart Ansight activates it.
host run options
| Option | Meaning |
|---|---|
--pair <app-id> | Start the host and create a one-use phone enrollment code and terminal QR for the supplied app ID. |
--name <name> | Set a human-readable name on the invitation created by --pair. |
--duration <duration> | Set the pairing lifetime using mo, w, d, h, or m, such as 15m or 1h. The default is one month. |
--host-address <LAN-IP> | Put an address reachable by the phone into the pairing payload instead of relying on automatic host-address selection. |
--serve-port <port> | Override the configured explorer-port; 0 selects an available local explorer port for this run. |
--serve-path <path> | Override the configured explorer-path with / or a fixed URL-safe explorer path. |
--open | Open the local explorer in the default browser after the host starts. |
--no-serve | Run without the local explorer. It cannot be combined with --open, --serve-port, or --serve-path. |
--companion-access [session|always] | Publish simulators to the signed-in macOS companion app. Omitting the value selects session; always keeps access enabled for CLI management. |
--machine-name <name> | Set the required name submitted with this machine’s companion registration. The saved name is reused by later host runs. |
--team-id <uuid> | Select the organisation for companion access. This is optional when exactly one eligible organisation has the feature enabled. |
--enable-repository-automations | Permit trusted repository trigger execution in this host. This is the default. |
--disable-repository-automations | Disable repository trigger execution for this host. |
--automation-repository <path> | Connect a trusted trigger repository when the host starts. Repeat the flag to connect more than one. |
The global options select the data directory,
SDK ports, platform tool locations, Node.js runtime, output format, and
diagnostic verbosity for run, status, logs, and stop.
Use ansight config set explorer-path <path> and
ansight config set explorer-port <port> to change the pinned local explorer
defaults. Unset either setting to use a random path or available port; explicit
--serve-path and --serve-port values still win.
ui
ansight ui snapshot [--session <id>|--app <id>] [options]
ansight ui find --automation-id <id>|--text <text>|--role <role> [options]
ansight ui tap <selector> [options]
ansight ui type <selector> --value <text> [--append]
ansight ui swipe [<selector>] [gesture options]
ansight ui pinch [<selector>] --scale <0.1-4> [gesture options]
ansight ui back [--session <id>|--app <id>]
ansight ui wait <selector> [--condition visible|hidden|stable] [options]
ansight ui assert <selector> [assertion options]
These commands are thin adapters over the host semantic UI service. They use
the same selector resolution, waits, assertions, evidence capture, and real
device-input paths as repository tests and the bounded app agent. Replay widgets
use the separate ansight mcp serve stdio command described below.
Target one connected app with --session <id> or --app <id>. The equivalent
long forms are --session-id and --app-id; use only one target form.
Embedded replay over MCP
Configure a compatible MCP client to launch ansight mcp serve. This serves the
embedded replay viewer over stdio and requires a running local Ansight host.
It needs no separate Node server. The replay tools list local recordings and
show screenshots, recorded touches, and saved annotations. Open full replay
opens that session in the local player’s browser view. Annotation editing and
the complete inspection tools are available there.
UI selector options
Selectors apply to every command except snapshot and back. find, tap,
type, and assert require one; swipe and pinch may instead target the
screen; wait --condition stable does not require a selector.
| Option | Meaning |
|---|---|
--automation-id <id> | Match a stable automation or accessibility identifier. |
--text <text> | Match visible or accessibility text. |
--role <role> | Match a semantic role such as button or textbox. |
--ancestor <automation-id> | Require an ancestor with this automation identifier. |
--index <number> | Select a zero-based match when a selector is not unique. |
--contains | Use substring rather than exact selector matching. |
--case-sensitive | Match selector strings case-sensitively. |
UI operation options
| Option | Applies to | Meaning |
|---|---|---|
--max-nodes <count> | ui snapshot | Return 1–2000 nodes. The default is 256. |
--max-depth <count> | ui snapshot | Traverse 1–64 levels. The default is 32. |
--include-properties <true|false> | ui snapshot | Force detailed framework properties on or off. |
--include-bounds <true|false> | ui snapshot | Include element bounds. The default is true. |
--limit <count> | ui find | Return 1–1000 matches. The default is 100. |
--value <text> | ui type | Set the required text value. |
--append | ui type | Append instead of replacing existing text. |
--direction <up|down|left|right> | ui swipe | Set a direction. The default is up; it cannot be combined with --orientation. |
--orientation <path> | ui swipe | Set a compass path such as SW or E-to-W; it cannot be combined with --direction. |
--length <value> | ui swipe | Set a normalized length from 0.05 through 0.9. |
--start-x, --start-y, --end-x, --end-y | ui swipe | Supply all four normalized 0–1 coordinates for an exact swipe. Exact coordinates cannot be combined with direction, orientation, or length. |
--scale <value> | ui pinch | Set the required scale from 0.1 through 4; values below 1 pinch inward. |
--center-x, --center-y | ui pinch | Set both normalized 0–1 center coordinates. |
--start-distance <value> | ui pinch | Set the normalized starting contact distance from 0.05 through 0.8. |
--angle-degrees <value> | ui pinch | Rotate the contact axis by this finite angle. |
--duration-ms <ms> | ui swipe, ui pinch | Set a duration from 50 through 2000 milliseconds. |
--condition <visible|hidden|stable> | ui wait | Select the wait condition. The default is visible. |
--timeout-ms <ms> | ui wait | Set a timeout from 100 through 60000 milliseconds. The default is 10000. |
--poll-ms <ms> | ui wait | Poll every 100–5000 milliseconds. The default is 250. |
--stable-samples <count> | ui wait | Require 2–20 unchanged samples for a stable wait. |
--absent | ui assert | Assert that no match exists; equivalent to --exists false or --count 0. |
--exists <true|false> | ui assert | Assert whether any matching element exists. |
--count <count> | ui assert | Assert an exact match count from 0 through 1000000. |
--expected-text <text> | ui assert | Assert the selected node’s text. |
--expected-value <value> | ui assert | Assert the selected node’s value. |
--expected-visible <true|false> | ui assert | Assert the selected node’s visibility. |
--expected-enabled <true|false> | ui assert | Assert the selected node’s enabled state. |
--json | All UI commands | Emit the versioned ansight.ui-operation/v1 result. |
keyboard
ansight keyboard open <selector> [target options]
ansight keyboard is-open [target options]
ansight keyboard dismiss [target options]
These commands use the same keyboard operations as repository tasks. open
focuses a selected text input and verifies that the software keyboard appears;
is-open captures fresh keyboard state; and dismiss sends device input only
when the keyboard is open, then verifies that it closes. Android reads the
system input-method state because UIAutomator does not reliably include Gboard
or other IME windows on physical devices.
Use --session/--session-id for an exact connected session. Use
--app/--app-id with --device/--device-id to select an application on an
exact simulator, emulator, or physical device. A device can be used by itself
only when exactly one connected Ansight app session is running on it; otherwise
the command requires an app or session identifier. An exact session target
cannot be combined with app or device options.
keyboard open accepts the UI selector options and
requires at least one selector. --json emits the versioned
ansight.keyboard-operation/v1 result.
doctor
ansight doctor [options]
Checks the data directory, credential vault, encrypted secret store, .NET profiling tools, Node.js, image/OCR runtimes, Android and Apple device backends, Android video, and physical-iOS input.
| Option | Meaning |
|---|---|
--data-dir <path> | Inspect a non-default host state directory. |
--secret-store-file <path> | Inspect an encrypted file store instead of the operating-system credential vault. |
--secret-key-file <path> | Validate the externally protected AES key used by the encrypted file store. |
--adb-path <path> | Check an explicit ADB executable or Android SDK directory. |
--xcode-path <path> | Check an explicit Xcode app or Developer directory. |
--require <check-name> | Make a named optional quick check release-blocking. Repeat for multiple checks; cannot be combined with --full. |
--full | Collect system state: OS, installation, dependencies, apps, devices, agents and existing skills. |
--output <report.json> | Save the full report as JSON; requires --full. |
--include-secret-metadata | Explicitly include Ansight secret aliases and recorded revisions, never values or secret hashes; requires --full. |
--json | Emit ansight.doctor/v1 with per-check justification and installation guidance, or ansight.system-report/v1 with --full. |
ansight doctor --full --json --output system-report.json
ansight doctor --full --include-secret-metadata --json
Full reports inspect existing state and do not modify installations or skills.
Unknown versions and unavailable inventories remain explicit. A generated
report returns success even if incomplete; inspect isComplete and section
statuses. Secret metadata is not collected without the explicit flag, including
when JSON, file output or verbosity is enabled. Use the flag without an assigned
value. No report is uploaded.
See System Requirements and Dependencies for what each check enables and how green, amber, and red results behave.
device
Device options
| Option | Applies to | Meaning |
|---|---|---|
--ios | device list | Return only iOS targets. |
--android | device list | Return only Android targets. |
--simulator | device list | Return only iOS simulators. --simulators is an alias. |
--headless | device start, device boot | Boot without opening a simulator/emulator window; windows are shown by default. |
--emulator | device list | Return only Android emulators. --emulators is an alias. |
--physical | device list | Return only physical devices. --physical-devices is an alias. |
--phone | device list, bare devices | Return only phones. --phones is an alias. |
--tablet | device list, bare devices | Return only tablets. --tablets is an alias. |
--app-id <id> | device list, bare devices | Return only targets where the exact bundle or package ID is installed, and include its version/build plus available installation timestamps in each matching row. Shutdown iOS simulators are inspected from disk; stopped Android and disconnected physical targets are skipped with a concise warning. Use --verbose for per-target diagnostics. |
--app-version <value> | device list, bare devices | With --app-id, match a user-facing version. * matches any sequence and ? matches one character. --version is an alias in device listings. Quote wildcard patterns in the shell, for example --version '2.10.*'. |
--app-build <value> | device list, bare devices | With --app-id, match a build/version code. Supports the same * and ? wildcards. |
--offline | device list | Include offline, shut-down, unauthorized, and unavailable targets. |
--all | device list, bare devices | Alias for --offline; include every discovered target. |
--latitude <number> | device location set | Set the latitude. This flag and --longitude are both required. |
--longitude <number> | device location set | Set the longitude. This flag and --latitude are both required. |
--mode <recorded|fixed-speed> | device location play | Use the route timestamps, or replay at a fixed speed. The default is recorded; recorded-timing and fixed are accepted aliases. |
--speed <number> | device location play | Set a positive recorded-timing multiplier. The default is 1. |
--fixed-speed-kph <number> | device location play | Set a positive fixed replay speed in kilometres per hour. The default is 30; --speed-kph is an alias. |
--loop | device location play | Repeat the route until it is stopped. |
--wait | device location play | Keep the command attached until resident-host playback finishes. Transient playback waits automatically. |
--output <path> | device screenshot | Write the screenshot to this path instead of a timestamped default path. |
Use the global --adb-path and --xcode-path options to override platform-tool
discovery.
By default, device list and the bare devices alias show only live devices: booted
virtual targets and connected physical devices. Use --all or --offline to include
offline, shut-down, unauthorized, and otherwise unavailable targets.
Use --phone or --tablet to filter by form factor. These flags compose with
platform, device-kind, live/offline, and app-ID filters; passing both includes
both form factors. The JSON inventory reports the detected formFactor on each
classified target and excludes unknown device classes from either filter.
Use ansight devices --app-id com.example.app to search live targets, or add --all
or --offline to search every discovered target. Platform and device-kind filters are
applied before installed apps are inspected. Shut-down iOS Simulators are inspected
from their local Simulator data without booting them. Android and disconnected physical
targets that cannot expose their installed apps remain non-matches and produce a warning.
Matching text rows include version=<value> and, when available, build=<value>,
installed=<timestamp>, and updated=<timestamp>. Android reports package-manager
first-install and last-update times. Simulator installation time is a best-effort bundle
container creation time. Physical iOS timestamps remain absent unless devicectl supplies
them. JSON output includes the same fields under applicationMatches.
audio
Start with the Microphone Audio Input setup guide for driver installation, permissions, per-run routing and troubleshooting.
iOS audio workflows must run serially on one selected simulator, including when
using execute or workspace tests. See
audio concurrency restrictions.
Deliver a local WAV to an existing Ansight-connected virtual device’s microphone.
Both commands require --session <id>; --session-id is an alias. The resident
host uses that session’s device and does not launch the app or choose another
session. Start recording and grant microphone permission through the app first.
ansight audio capabilities --session <live-session-id> --json
ansight audio inject --session <live-session-id> \
--file ./fixtures/audio/quote.wav --timeout-ms 30000 --json
| Command or option | Meaning |
|---|---|
audio capabilities --session <id> | Inspect provider, route, readiness and limits without playing a test sound. |
audio inject --session <id> --file <path.wav> | Block through audio delivery and cleanup. |
--file <path> | RIFF/WAVE PCM16, mono, 16 kHz, at most 15 seconds and 1 MiB. Relative paths use the calling CLI’s working directory. |
--timeout-ms <100–60000> | Bound the complete injection operation; default 30000. |
--wait-for-microphone-ms <0–10000> | Bound the microphone-readiness wait; default 0 runs provider preflight without waiting. |
JSON output preserves the host’s ansight.audio-capabilities/v1 or
ansight.audio-injection/v1 payload. Completed injection records fixture hash,
format, frame count, provider timing and a retained delivery evidence ID. It does
not prove app capture or transcription: assert the app’s resulting transcript or
saved recording separately. Failures retain diagnostic codes and partial-delivery
evidence. Ctrl+C requests cancellation and keeps the control connection open for
up to 10 seconds for the host’s final cleanup acknowledgement. If that grace
expires or the connection fails, the CLI reports unconfirmed cleanup and possibly
partial delivery; it does not claim the audio stopped successfully. Interrupted
audio is never retried automatically.
On iOS, install a loopback provider such as BlackHole separately and select it as
Simulator audio input. The provider verifies the effective route; the Mac’s default
microphone and speakers are unchanged. A loopback route may be shared by multiple
simulators, so the current provider requires exactly one booted iOS simulator and
serializes injections across the host route. The configured Xcode’s Simulator UI
must already be running, with English Audio Input/Sound Input menus and macOS
Accessibility access available for route verification. The default device UID is
BlackHole2ch_UID; set ANSIGHT_AUDIO_DEVICE_UID in the resident host’s environment
to select another supported virtual duplex device. On macOS 14.2 or later, a
readiness wait can observe an active input client on that host device; this does
not identify the target app’s recording stream. With the default zero wait, iOS
verifies the route only; the caller must already have started app recording.
Before iOS audio tests, run this preflight from the same Terminal, IDE, or launcher that starts the resident Ansight host:
ansight doctor --require permission.accessibility --require device.ios.audio.blackhole
The Accessibility check queries the bundled audio helper without prompting or requiring a booted Simulator. A missing grant fails this preflight. To set it up:
open 'x-apple.systempreferences:com.apple.preference.security?Privacy_Accessibility'
Enable the host launcher in Privacy & Security > Accessibility, using +
if it is missing, then rerun doctor. Restart the host from that launcher if access
is still denied. macOS normally remembers the grant across restarts; switching
launchers or changing signing identity may require approval again. Doctor cannot
grant this permission. Permission and driver checks do not establish that the
correct Simulator audio input is selected; audio capabilities checks the route.
On Android, active guest capture, disabled host microphone access, and healthy
authenticated emulator gRPC are required. Unsupported or degraded states fail with
diagnostics. Android Emulator 37.1.11 has an observed native audio-injection race
that can crash the emulator. Readiness guards mitigate known unsafe states but do
not guarantee stability on that version; Ansight does not restart the emulator or
retry injection automatically. Physical devices are unsupported. Use ansight doctor
for local dependencies.
The tasks TypeScript API
exposes the same host operation as ansight.device.injectMicrophoneAudio. Task fixture paths
are relative to the pinned repository root. Local CLI forwarding is not a remote
file upload; hosted workers need the fixture present in their own workspace.
input
Android uses ADB display-pixel coordinates. iOS Simulator input uses the packaged
macOS Simulator HID bridge and logical screen-point coordinates, normalized against
the current screenshot orientation; check the bridge with ansight doctor. iOS HID
swipe and pinch durations are clamped to the supported 50–2000 millisecond range.
Input options
| Option | Applies to | Meaning |
|---|---|---|
--x <coordinate> | input tap | Required horizontal display coordinate: Android pixels or iOS logical points. |
--y <coordinate> | input tap | Required vertical display coordinate: Android pixels or iOS logical points. |
--start-x <coordinate> | input swipe | Required horizontal coordinate where the swipe begins. |
--start-y <coordinate> | input swipe | Required vertical coordinate where the swipe begins. |
--end-x <coordinate> | input swipe | Required horizontal coordinate where the swipe ends. |
--end-y <coordinate> | input swipe | Required vertical coordinate where the swipe ends. |
--center-x <points> | input pinch | Required iOS logical-point horizontal center. |
--center-y <points> | input pinch | Required iOS logical-point vertical center. |
--start-span <points> | input pinch | Required initial distance between the two horizontal contacts. |
--end-span <points> | input pinch | Required final distance between the two horizontal contacts. |
--duration-ms <ms> | input swipe, input pinch | Set the gesture duration from 1 to 60000 milliseconds. The default is 300. |
--value <text> | input text | Required text to send through the platform input bridge. |
app
app watch
Save monitors for installed apps on iOS simulators, Android emulators, or one explicitly selected physical iOS or Android phone. The resident host must be running to capture; monitor definitions survive restarts. The host discovers booted virtual devices, including those booted later. No device registration is required. See External App Monitoring for the local UI and capability limits.
| Command | Purpose |
|---|---|
app watch add <app-id> | Add a monitor; re-adding the same app/platform/device selection updates and enables it. |
app watch configure <watch-id> --screenshot-interval-ms <ms> | Save this monitor’s screenshot interval and apply it to active recordings without restarting them; other settings are preserved. |
app watch list | Show monitor state, per-device capture/session IDs, and errors. |
app watch enable <watch-id> | Resume a saved monitor. |
app watch disable <watch-id> | Stop its active captures and keep the definition. |
app watch remove <watch-id> | Stop its active captures and remove the definition. Recorded sessions remain available. |
| Option | Applies to | Meaning |
|---|---|---|
--platform ios|android | app watch add | Restrict discovery to one platform; omit for both. |
--device-id <id> | app watch add | Select an exact iOS device ID, Android serial, or AVD name; omit for automatic virtual-device discovery. A physical phone also requires its --platform. |
--capture-file <path> | app watch add | Repeatable data-sandbox-relative path: at most 16 files, 16 MiB each; unavailable for physical iOS. |
--instruments | app watch add | Attach Activity Monitor to an explicitly selected physical iPhone; retain the trace and ingest CPU and memory samples when Xcode exports its process table. |
--screenshot-interval-ms <ms> | app watch add, app watch configure | Target interval between screenshot captures, 100–60000 ms (default 2000). Saved per monitor; omitted on re-add preserves the existing interval. Slow devices may capture less often. |
--json | All app-watch commands | Return structured monitor state and errors. |
ansight app watch add com.example.notes --platform ios \
--capture-file Documents/notes.sqlite
ansight app watch list --json
For a physical iPhone with a store-installed app, set up Appium/XCUITest and a provisioned WebDriverAgent, then run:
ansight app watch add <app-id> --platform ios \
--device-id <coredevice-id> --instruments
This captures screenshots and accessible UI. --instruments retains an
Activity Monitor trace and adds CPU and memory channels if its process table
exports. Native logs and private sandbox files remain unavailable. See
external monitoring
for signing and capture setup.
Virtual-device capture follows the process lifetime. A physical iPhone watch ends after two observations with the app outside the foreground. Exit-file copies are best effort on exit, disable, removal, or host shutdown, and are skipped on observed restarts or device loss. One capture can own a virtual device at a time. App registration and workspace linking do not themselves create a monitor.
Execute against an external session
app execute <live-session-id> --prompt <text> can attach to a monitored
session. Its capture source determines execution mode, and one execution
reserves it at a time. Normal completion or cancellation releases the
reservation while leaving the app monitor running. To launch without an
existing session, use --execution-mode device:
ansight app execute --app-id com.example.notes --platform android \
--device-id <emulator-serial> --execution-mode device \
--prompt "Create a note and verify it appears in the list"
Device mode supports visible UI and available host evidence. SDK app tools and App Graph execution require an SDK session; unavailable operations are refused with capability guidance. See workspace tests without the SDK for installed-app reuse and build artifact restrictions.
App options
| Option | Applies to | Meaning |
|---|---|---|
--name <name> | app register | Set the app’s human-readable name. |
--codebase <path> | app register | Link a trusted repository root for automatic monitoring and repository definitions. |
--arguments <JSON> | app call | Pass an inline JSON object to the tool. It cannot be combined with --arguments-file. |
--arguments-file <path> | app call | Read the tool’s JSON object from a file. Comments and trailing commas are accepted. It cannot be combined with --arguments. |
--if-revision <revision> | app tools | Return a compact unchanged catalog when the app still has this revision. |
--query <text> | app tools | Partially match all words across indexed tool IDs, names, descriptions, categories, and keywords. Schemas are fetched only after selection. |
--feature <text> | app tools | Match all words in a feature or domain hint such as mapbox, routing, or preferences. |
--category <category> | app tools | Match one exact category, case-insensitively. |
--id-prefix <prefix> | app tools | Match tool IDs beginning with the supplied prefix, case-insensitively. |
--tool-id <id> | app tools | Match one exact tool ID, case-insensitively. |
--policy <read|write|critical> | app tools | Match one exact tool policy. |
--executable-only | app tools | Exclude tools blocked by live availability, the local guard, or the paired-client policy. Focused searches use this behavior by default. |
--include-unavailable | app tools | Include blocked or currently unavailable tools in a focused search. It cannot be combined with --executable-only. |
--max-results <count> | app tools | Return from 1 through 50 direct matches; the default is 20 whenever filtered retrieval is active. Required prerequisites that pass the selected availability mode are supplemental. |
--detail <summary|full> | app tools | Return compact catalog metadata without schemas, or complete matching definitions. The default is full. |
--after <JSON> / --after-file <path> | app call | Capture explicit post-call visual-tree or screenshot evidence. |
--after-tree / --after-screenshot | app call | Request common post-call evidence without writing JSON. |
--after-delay-ms <ms> | app call | Wait from 0 through 2000 milliseconds before evidence capture. |
--calls <JSON> / --calls-file <path> | app batch | Supply an ordered JSON array of {toolId, arguments, after, callId} objects. |
--continue-on-error | app batch | Continue later calls after a failed call. |
--prompt <text> | app execute | Natural-language app goal to execute and verify. It cannot be combined with --prompt-file. |
--prompt-file <path> | app execute | Read the complete execution prompt from a file. It cannot be combined with --prompt. |
--secret <alias> | app execute | Grant one host-managed app secret without exposing its value to the model. Repeatable. |
--reasoning <mode> | app execute | Select reasoning mode: fast (default), balanced, or deep. The server resolves the model and reasoning budget using the client’s configuration. |
--model-transport <mode> | app execute | Model connection: auto (default), websocket (ws), or http. auto allows HTTP fallback; websocket requires WebSocket. |
--team-id <uuid> | app execute | Select an organisation when more than one signed-in organisation permits agent execution for the app. |
--app-graph | app execute | Beta feature. Explicitly opt in to authorized published App Graph route guidance. Ansight includes only graphs for the exact registered app ID and selected organisation. |
--trace | app execute | Explicitly capture the full model context, assistant text, tool payloads, App Graph plan details, and exportable execution graph. Without it, the audit keeps only lightweight status, timing, token, count, and payload-hash metadata. |
--app <path> | app execute | Install and launch an .app, .ipa, or .apk artifact. Ansight reads its bundle or package identifier unless --app-id is also supplied. --application-path is a generic alias; --ipa accepts only an .ipa. |
--app-id <id> | app execute | Launch an installed app, or provide the identifier explicitly for an artifact. |
--device-id <id> | app execute | Select an exact launch target. Repeat it to execute the same prompt concurrently across an explicit device set. A connected session can bind only one device. --device is an alias. |
--platform <name> | app execute | Constrain launch to ios or android. |
--execution-mode sdk|device | app execute | Launch with SDK capture (default) or external device capture. Device mode supports only simulators/emulators. An existing session determines its mode; an explicit mismatch is rejected. |
--device-kind <kind> | app execute | Constrain launch to simulator, emulator, or physical. |
--headless | app execute | Do not open simulator/emulator windows during launch or execution. |
--close-app-on-completion | app execute | Close only the target app process after success, failure, or cancellation. Opt-in; the app stays open by default. Leaves the device, its window, and the host running. |
--wait-seconds <n> | app execute | Set the launched app’s Ansight session connection timeout. The default is 45. |
--max-turns <count> | app execute | Limit agent turns from 1 to 512; default 64. |
--max-round-trips <count> | app execute | Limit model round trips from 1 to 4096; default 64. |
--max-tool-calls <count> | app execute | Limit tool calls from 1 to 16384; default 512. |
--stop-on-failure | app execute | Stop an ordered execution after its first failed instruction. |
--sandbox-root <root> | app push-file | Select one of the sandbox roots published by the connected app. |
--file-name <name> | app push-file | Override the destination filename; otherwise the local filename is used. |
--overwrite | app push-file | Replace an existing destination file. |
--no-create-directory | app push-file | Fail unless the remote directory already exists. |
With --app-graph, the agent first classifies a published shortest-path route as
full coverage, partial coverage, or no match. It follows compatible graph
bindings and their postconditions, then continues only the uncovered part of the
prompt. Without the flag, App Graphs are not fetched or included in model
context. Repository tasks use the same full/partial/no-match check before the
agent falls back to live UI exploration.
Full evaluation traces are also opt-in. Add --trace when the run must be
reviewed in the local player or exported with test export; normal runs retain
lightweight audit metadata without storing model context or tool payload bodies.
app tools uses the same authorization vocabulary as every SDK. Each catalog
entry has one ordered policy: read, write, or critical. Friendly output
prints the policy and either executable or blocked:<denial-code>; JSON output
includes a denial object only when the current app state, local guard, or
paired-client maximum prevents execution.
With no catalog filter, app tools preserves the legacy behavior and returns
the complete full catalog. Supplying a query, feature, category, ID, policy,
availability flag, or result limit activates focused retrieval: direct matches
default to 20 and executable-only. --detail alone also activates bounded
retrieval, but it does not exclude unavailable tools. Use
--include-unavailable when inspecting a denial or unavailable exact ID.
Use a focused --detail summary search to select an exact tool ID, then fetch
that ID with --tool-id <id> --detail full before calling it. For example:
ansight app tools <session-id> --query "mapbox surface" --policy read --detail summary --json
ansight app tools <session-id> --tool-id redpoint.mapbox.query_surface_contents --detail full --json
Query the catalog before app call or app batch so stale availability is
visible before acting. The host filters the compact index before requesting full
definitions, includes published prerequisite tools, and handles conditional
revisions and compressed SDK responses transparently; see the Remote Tool
Protocol for the underlying contract.
With --json, the CLI returns the ansight.app-tool/v1 wrapper and places the
catalog in envelope.payload. A filtered catalog reports totalToolCount,
matchedToolCount, returnedToolCount, includedPrerequisiteToolCount,
isTruncated, and the applied filters. Refine the filters when isTruncated
is true; prerequisite entries can make returnedToolCount exceed the direct
match limit.
Persistent interactive connection
ansight app interact --session <session-id> --repository <repository-root> --jsonl
Keep the process open and write one JSON object per stdin line. The resident-host
pipe remains connected; no agent is started. ready automatically contains a
persisted screenshot. Every gesture or task captures and retains its resulting
screenshot and timeline event, including failed input. No capture flag is needed.
The schema is ansight.app-interaction/v1; correlate responses by id.
The bridge is tree-first: ui includes a fresh accessibility/visual-tree source,
timestamp, persisted snapshot ID, and up to 128 visible semantic nodes (text fields
bounded to 256 characters). ui.truncated identifies omitted detail. Prefer
automation IDs or exact text with role/ancestor constraints. Semantic targets are
resolved afresh before input; zero or multiple matches fail safely. Device
accessibility is preferred, with SDK tree fallback and a cached fallback capability
choice. Tree failure is reported as ui.status: "unavailable"; screenshots remain
available for coordinate fallback. Image viewing is not required for ordinary
tree-described navigation.
{"id":"query","command":"type","target":{"automationId":"search-field"},"value":"Kalymnos"}
{"id":"select","command":"tap","target":{"text":"Kalymnos","role":"button","ancestorAutomationId":"search-results"}}
Use observed selectors, not these example IDs. target is supported for tap
and type; never mix it with coordinates. Targeted typing focuses and replaces
by default; replaceExisting:false appends. Role/ancestor alone are insufficient.
{"id":"tap","command":"tap","x":0.5,"y":0.8}
{"id":"swipe","command":"swipe","x":0.5,"y":0.8,"endX":0.5,"endY":0.2}
{"id":"pinch","command":"pinch","x":0.5,"y":0.5,"scale":1.5}
{"id":"type","command":"type","value":"Kalymnos"}
{"id":"back","command":"back"}
{"id":"observe","command":"snapshot"}
{"id":"catalog","command":"tasks"}
{"id":"run","command":"task","taskId":"search.find","input":{"query":"Kalymnos"}}
{"id":"group","command":"batch","commands":[{"id":"focus","command":"tap","x":0.5,"y":0.8},{"id":"query","command":"type","value":"Kalymnos"}]}
{"id":"done","command":"exit"}
Coordinates are normalized to the screenshot (0–1). type appends to the focused
field. Swipe and pinch accept durationMs from 50–2000 (default 250); pinch scale
is 0.1–4. Read the screenshot before choosing an unknown target. snapshot is an
optional refresh for asynchronous state, not an evidence prerequisite. Responses
include screenshot.artifactPath, frame IDs, previousScreenshot (the previously
observed frame, not a new before-capture), and input/capture/total timings.
Automatic screenshots wait for 300 ms of visual quietness, allowing 900 ms for
an unchanged post-input screen to begin transitioning, within a 2 s sampling
window (in-flight capture/persistence can extend it; command timeout still applies).
Small 256-pixel probes bracket the final 1024-pixel screenshot; only the final frame
is added to session image evidence. screenshot.settling reports status
(stable, unchanged, timed_out), probeCount, and elapsedMs.
Continuing animation returns ui_unsettled with retained evidence and stops a
batch. No input is replayed. Visual quietness does not establish semantic or
network completion; use returned UI state or task assertions. Do not routinely
send another snapshot after each action.
--repository is optional for gestures but required for tasks and task.
The task catalog and normal task engine are scoped to the connection’s fixed
repository, app and session. Choose exact IDs and inputs from the catalog.
The returned task includes status, assertions and tool calls; only Passed
succeeds, and a task with no assertions is Inconclusive.
Discover matching maintained tasks before manually duplicating their steps. A task
that enters and selects a search query should receive that query directly, without
an extra preceding focus/type sequence.
Batches contain 1–32 commands, including tasks. They are validated in full before
any child executes, run sequentially with evidence for each action, and stop at
the first failure. The response contains ordered results and skippedIds, plus
the last executed child’s ui and screenshot at the top level (no stale fallback
when that child has no evidence). Top-level timing sums child input/capture times
and measures actual host batch wall time, excluding agent/tool orchestration.
Check all child statuses and inspect final state; intermediate images are optional.
Nothing is rolled back or replayed. All IDs within a batch must be unique;
nested batches and exit children are rejected. Batch only known sequences
that do not require intermediate decisions. Every input line is limited to
65536 characters; unknown properties are rejected.
--timeout-ms bounds each ordinary command (default 15000, range 100–60000).
--task-timeout-ms bounds each task (default 120000, range 100–300000).
Timeout or disconnect can leave execution uncertain and interrupt evidence
capture; do not blindly retry commands or partially completed batches. Missing
evidence prevents further gestures until automatic capture recovers.
exit or stdin EOF detaches without stopping the app or host; Ctrl+C cancels
the connection. Both CLI and resident host must support this protocol. Coordinate
any restart of a shared host after upgrading.
Agent-driven execution
app execute accepts three target forms. Pass a connected session ID to keep using that
session, pass --app ./Example.app or --app ./Example.apk to install and launch a build,
or pass --device-id <id> --app-id com.example.app to launch an already installed app on
an exact target. Launch mode boots the target when necessary, installs an artifact when
supplied, waits for the app’s Ansight SDK session, and then starts the bounded agent run.
Repeat --device-id in launch mode to run the same prompt concurrently on every selected
device. The command waits for every device run and reports one aggregate result; it succeeds
only when all device runs succeed.
ansight app execute --app-id com.example.app \
--device-id <ios-simulator-id-1> \
--device-id <ios-simulator-id-2> \
--device-id <android-emulator-id> \
--prompt "Open settings and verify notifications are enabled"
Each selected target is booted when necessary. Supplying --app installs the artifact only
when its checksum differs from the copy already installed on that target; a matching build is
reused. Target preparation and prompt execution happen concurrently.
By default, app execute leaves the app open. Add --close-app-on-completion to
close only the app process when execution finishes, including failure or
cancellation. It applies to both launched apps and an app selected through an
existing session; with multiple devices, each run closes its own app instance.
The simulator/emulator remains running, its window is left open, and the Ansight
host is not stopped. This option is independent of --headless.
ansight app execute <session-id> --prompt "Verify the home screen" --close-app-on-completion
ansight app execute --app-id com.example.app --device-id <device-id> \
--prompt "Verify the home screen" --headless --close-app-on-completion
Cleanup is also attempted if a successfully launched app never connects to
Ansight. Existing sessions must resolve to a known host device; use --device-id
when the session cannot report it, such as a physical iOS target. A device that
conflicts with the session is rejected before execution. Cleanup has a separate
30-second timeout, including on cancellation. A cleanup failure is reported as
[app.close.warning] on stderr without replacing the execution result or exit
code; the app may still be running. Forced process termination cannot guarantee
cleanup. This option belongs to app execute, not test run-inline or App Graph
commands.
Agent runs use an eligible organisation’s entitlement and obtain model credentials
automatically through Ansight. If more than one organisation permits the app, pass
--team-id. The agent runs on the machine driving the app. The model connection
uses Ansight cloud authorization and a brokered credential or proxy. Setting
OPENAI_API_KEY or ANSIGHT_AI_TRANSPORT does not enable a local key mode.
For unattended runs, set ANSIGHT_RUNNER_API_KEY and ANSIGHT_TEAM_ID with an
app-scoped key granting ai:execute. This supports app execution, AI tests,
replay, App Graph execution/exploration, and task extraction/refinement without a
saved user login. Keys use the hosted model proxy and the organisation’s existing
AI permissions and allowance. See runner key issuance.
Use local App Graph storage with runner keys; --graph-store hosted still
requires the existing signed-in cloud storage access.
Restart an older resident host after upgrading so it can accept credentials scoped
to an individual AI command; these credentials are not saved to host settings.
App execution, test runs, replay, App Graph runs and exploration share the same
Reasoning mode setting as task extraction. Use --reasoning fast|balanced|deep;
omitting it selects fast. Fast prioritises speed and economical execution,
Balanced balances speed with additional reasoning, and Deep allocates more
reasoning to complex workflows. Every mode follows the same requested steps and
verification requirements.
The server resolves the mode using the client’s configuration. The initial model
mappings are Fast → gpt-5.6-luna, Balanced → gpt-5.6-terra, and Deep →
gpt-5.6-sol, each with provider reasoning effort medium. Run audits record the
resolved model, provider reasoning effort, and configuration revision.
ansight app execute --app-id com.example.app --reasoning fast --prompt "Open Settings and verify the account details."
ansight test run ./ansight smoke-test --reasoning deep
The legacy --model flag remains available for diagnostics; it cannot be combined
with an explicit --reasoning selection.
--model-transport auto tries WebSocket when available and falls back to HTTP on a
WebSocket transport failure. Use --model-transport websocket to require WebSocket,
or --model-transport http to use HTTP.
--openai-transport has been renamed to --model-transport.
app-graph
Beta feature. App Graph commands are experimental and may change before general availability. They are omitted from default CLI help; run ansight help --beta to include all beta feature commands.
| Command | Purpose |
|---|---|
app-graph list --team-id <uuid> | List organisation App Graphs. The action defaults to list when omitted. |
app-graph show <graph-id> | Show the current graph version and binding count. |
app-graph validate <graph-id> | Validate topology, bindings, and observable postconditions. |
app-graph plan <graph-id> | Compile a semantic path through the current graph. |
app-graph run <graph-id> <live-session-id> | Execute a compiled path and record step evidence. |
app-graph explore [<app-id>] | Discover screens, dialogs, named states, and the element actions that connect them. |
app-graph explore builds a semantic navigation directory rather than executing a user goal. Each destination records
a canonical name, evidence-backed synonyms, and its user-facing purpose. Each transition records the interacted
element’s stable automation ID and the product-level meaning of using it, alongside its executable binding. The command
performs up to 1024 safe navigation actions and receives a dedicated allowance of 1024 model round trips by default. It
refuses destructive and financially meaningful interactions, records its agent audit, and creates a live_exploration
observation. When targeting an existing graph, the graph remains unchanged until a
reviewer accepts that observation in the portal and creates a new immutable draft version. A successful exploration
that creates a new graph instead uses the candidate for its initial draft and attaches the observation to that version.
The ansight.app-graph/v1 graph contract accepts only screen, dialog, and state destinations. Destinations require
name and purpose; named states also require parentScreen. Every edge requires action.automationId and
action.semanticMeaning. Workflow node kinds and alternate graph fields are rejected rather than inferred.
The command targets an App ID rather than a generated session ID: the resident host selects the most recently active
linked session for that app from its connection and feedback activity.
Use --session-id <id> only to override that selection when the app has multiple connected instances. When no linked
session is live, an interactive invocation offers to launch the installed app on a compatible simulator or device and
waits up to 45 seconds for its Ansight connection. Scripts and JSON callers can opt in with --launch; use
--wait-seconds, --device-id, --platform, or --device-kind to constrain startup, and --no-launch to suppress the
prompt.
The App ID is optional when the current folder is connected to one Ansight workspace app. Interactive terminals prompt
when the folder maps to multiple apps or no workspace app can be inferred; scripts and JSON callers should pass
--app-id <id>. With no --graph, the command reuses the app’s Default graph or creates it as a reviewable draft
after the exploration succeeds. --graph <name-or-id> selects an existing graph, while --new-graph <name> deliberately
starts another one. Use --team-id <uuid> when the app is registered with multiple organisations, --focus <text> to
prioritise an app area, --max-actions to adjust the bound, --no-save for local output only, and --result-file <path>
to retain the structured candidate. Advanced runs can lower the exploration allowance with --max-turns,
--max-round-trips, and --max-tool-calls.
App Graph options
| Option | Applies to | Meaning |
|---|---|---|
--team-id <uuid> | list, explore | Select an organisation by non-empty UUID. It is required for list and when app registration is otherwise ambiguous. |
--search <text> | list | Search graph names and metadata. |
--published | show, validate, plan, run, explore | Use the published version instead of the current draft. A new graph cannot be published during exploration. |
--target <destination> | plan, run | Match a destination ID, name, synonym, or purpose. |
--parameters <JSON> | run | Supply an inline JSON object for {{name}} binding substitutions. It cannot be combined with --parameters-file. |
--parameters-file <path> | run | Read binding parameters from a JSON object file. It cannot be combined with --parameters. |
--reasoning <mode> | run, explore | Select reasoning mode for fallback bindings or exploration: fast (default), balanced, or deep. The server resolves the model and reasoning budget. |
--model-transport <mode> | run, explore | Model connection: auto (default), websocket (ws), or http. auto allows HTTP fallback; websocket requires WebSocket. |
--device-id <id> | run, explore | Target a specific simulator or device. --device is an alias. |
--headless | run, explore | Do not open simulator/emulator windows during automatic launch or agent-driven device starts. |
--trace | run, explore | Capture the full exportable agent trace. |
--app-id <id> | explore | Select the target app explicitly instead of using the optional positional App ID or workspace inference. |
--workspace <path> | explore | Select the workspace used for implicit app selection. The default is the current directory. |
--session-id <id> | explore | Override the latest linked live session selected for the app. |
--launch | explore | Launch the app non-interactively when no linked session is connected. |
--no-launch | explore | Suppress the interactive launch prompt. It cannot be combined with --launch. |
--wait-seconds <seconds> | explore | Set the app-to-host connection timeout. The default is 45. |
--platform <ios|android> | explore | Restrict automatic launch to one platform. |
--device-kind <physical|virtual> | explore | Restrict automatic launch to one device kind. |
--graph <name-or-id> | explore | Add a reviewable observation to an existing graph. It cannot be combined with --new-graph. |
--new-graph <name> | explore | Create a separate draft graph after successful exploration. |
--focus <text> | explore | Prioritise an app area without turning it into a user goal. |
--max-actions <count> | explore | Set the safe-navigation action bound from 1 through 1024. The default is 1024. |
--max-turns <count> | explore | Set model work turns from 1 through 1024. The default is 1023. |
--max-round-trips <count> | explore | Set organisation model round trips from 1 through 1024. The default is 1024. |
--max-tool-calls <count> | explore | Set Ansight tool calls from 1 through 4000. The default is 4000. |
--notes <text> | explore | Add notes to the reviewable observation. |
--no-save | explore | Return the candidate without uploading an observation or registering an inferred app. |
--result-file <path> | explore | Also write the structured result to a local file. |
pairing
Pairing options
| Option | Applies to | Meaning |
|---|---|---|
--code | pairing issue | Print the one-use pairing code for manual entry. |
--qr | pairing issue | Render a scannable QR in the terminal. A resident host must be running. |
--qr-output <path> | pairing issue | Write the QR as a PNG at this path. A resident host must be running. |
--host-address <LAN-IP> | pairing issue | Put an address reachable by the phone into the pairing payload instead of relying on automatic selection. |
--overwrite | pairing issue | Replace an existing file selected by --qr-output. |
--name <name> | pairing issue | Set a human-readable invitation name. |
--duration <duration> | pairing issue | Set the invitation lifetime using mo, w, d, h, or m. The default is one month. |
--app-id <app-id> | pairing list | Return invitations for one application ID. |
--active-only | pairing list | Hide consumed, revoked, and expired invitations. |
The pairing code is a one-use credential. Request it with --code, --qr, or
--qr-output; when one of those flags is present, --json returns the
credential in the structured issue result instead of rendering terminal QR
artwork.
companion
Companion options
| Option | Applies to | Meaning |
|---|---|---|
--mode <session|always> | companion access enable | Use session to publish only for the current host lifetime, or always to keep access enabled for later CLI management. The default is session. |
--include-revoked | companion machines list | Include revoked developer-machine registrations. |
--force | companion machines delete | Confirm permanent deletion. Without it, use revoke for the recoverable operation. |
Start a CLI companion host with ansight host run --companion-access session --machine-name "Development Mac".
Use the same global --data-dir on management commands when the resident host
uses a custom state directory.
Companion access must first be enabled for the organisation by a superadmin.
The organisation then allows new named, hardware-fingerprinted machines by
default or requires administrator authorization. Required-authorization
requests email organisation admins; approval in the portal emails the
requesting member. Use --team-id when the signed-in member has more than one
eligible organisation.
machine aliases machines; connection aliases connections; show
aliases machines get; remove aliases permanent machines delete; and
--mode once aliases --mode session.
profile
Beta feature. Profiling commands are experimental and may change before general availability. They are omitted from default CLI help; run ansight help --beta to include them.
The first argument selects ios, android, dotnet, or sample. Use
ansight profile <technology> --help for the technology-specific reference.
Native profiling
| Command | Purpose |
|---|---|
profile ios tools | Report Xcode and Instruments availability; alias requirements. |
profile ios start <app-path> --app-id <id> --device-id <id> | Capture an Instruments profile for an iOS Simulator or physical device. |
profile ios status <capture-id> | Show native capture state; alias get. |
profile ios cancel <capture-id> | Cancel an active Instruments capture. |
profile ios list | List recent iOS native captures. |
profile ios manifest <capture-id> | Show the immutable capture manifest and .trace artifact inventory. |
profile ios artifact <capture-id> | Resolve the authoritative .trace bundle path; alias trace. |
profile ios overview <capture-id> | Summarize artifacts, timing, Instruments runs, schemas, and processes; alias inspect. |
profile ios toc <capture-id> | Inventory the retained xctrace table-of-contents XML. |
profile android tools | Report ADB capture and local Trace Processor inspection availability; alias requirements. |
profile android start <app-path> --app-id <id> --device-id <id> | Capture a Perfetto trace for an Android emulator or physical device. |
profile android status <capture-id> | Show native capture state; alias get. |
profile android cancel <capture-id> | Cancel an active Perfetto capture. |
profile android list | List recent Android native captures. |
profile android manifest <capture-id> | Show the immutable capture manifest and .perfetto-trace artifact inventory. |
profile android artifact <capture-id> | Resolve the authoritative .perfetto-trace path; alias trace. |
profile android overview <capture-id> | Summarize artifacts, configuration data sources, and core trace counts; alias inspect. |
profile android query <capture-id> --sql <query> | Run one bounded read-only PerfettoSQL query; alias sql. |
Native profiling options
| Option | Applies to | Meaning |
|---|---|---|
--wait | Native start | Keep the command attached until capture completion. A detached capture requires a resident host. |
--headless | Native start | Do not open simulator/emulator windows; windows are shown by default. |
--preset <name> | profile ios start | Select launch (default), cpu, memory, or leaks. |
--preset <name> | profile android start | Select system (default), launch, memory, native-heap, or managed-heap. Native heap capture requires Android 10 or newer; managed heap capture requires Android 11 or newer. |
--duration-seconds <n> | Native start | Set the capture duration from 1 to 300 seconds. The default is 30. |
--app-id <id> | Native start | Supply the required bundle or package ID. |
--device-id <id> | Native start | Select the required Simulator/device UDID or emulator/device serial. |
--limit <count> | Native list | Return between 1 and 1000 recent captures. The default is 100. |
--sql <query> | profile android query | Supply one read-only SELECT or WITH statement. Multiple or mutating statements are rejected. |
--limit <rows> | profile android query | Return between 1 and 10000 rows. The default is 1000; Ansight applies the bound before executing the query. |
The authoritative iOS artifact is an Instruments .trace bundle, which
Ansight validates by exporting its table of contents. The authoritative Android
artifact is a raw .perfetto-trace file. Inspection never modifies either
authoritative artifact. Android overview and query use trace_processor or
trace_processor_shell from PATH; set ANSIGHT_TRACE_PROCESSOR_PATH to an
executable or containing directory when it is installed elsewhere. Overview
still reports the retained manifest and Perfetto configuration when Trace
Processor is unavailable.
Resident hosts expose the same inspection layer through
ansight_native_list_captures, ansight_native_get_capture_manifest,
ansight_native_get_capture_artifact, ansight_native_get_trace_overview,
ansight_ios_get_instruments_toc, and ansight_android_query_perfetto.
Inspection responses are produced from artifacts under the capture directory;
ad-hoc Perfetto query results are returned to the caller and are not added to
the immutable capture manifest.
Local process stack sampling
profile sample wraps the macOS /usr/bin/sample tool and attaches to an
already-running local process. It supports macOS applications, Mac Catalyst
applications, and iOS Simulator application processes. It cannot attach to an
application process running on a physical iOS device.
| Command | Purpose |
|---|---|
profile sample tools | Report whether /usr/bin/sample is available; alias requirements. |
profile sample start <pid> | Capture sampled thread stacks and a call graph from a local process. |
profile sample status <capture-id> | Show stack-sample capture state; alias get. |
profile sample cancel <capture-id> | Cancel an active stack sample. |
profile sample list | List recent process stack samples. |
profile sample manifest <capture-id> | Show the retained capture manifest and artifact inventory. |
profile sample artifact <capture-id> | Print the retained sampled call-graph path; alias output. |
| Option | Meaning |
|---|---|
--wait | Keep the command attached until capture completion. A detached capture requires a resident host. |
--duration-seconds <n> | Sample for 1 to 300 seconds. The default is 3. |
--interval-milliseconds <n> | Wait 1 to 1000 milliseconds between samples. The default is 1. |
--limit <count> | Return between 1 and 1000 recent samples. The default is 100. |
For example:
ansight profile sample start 12345 --duration-seconds 3 --interval-milliseconds 1 --wait
The authoritative artifact is the plain-text sampled call graph produced by
sample. Ansight retains it alongside a manifest and diagnostic capture log.
.NET profiling
Profiling capture options
Ansight never restores, builds, publishes, or modifies an application. The
supplied artifact must already have .NET diagnostics enabled and use the
target-specific DiagnosticConfiguration. --app-id and --device-id are
required for capture.
| Target | DiagnosticConfiguration |
|---|---|
| Android emulator | 10.0.2.2:9000,suspend,connect |
| Android physical device | 127.0.0.1:9000,suspend,connect |
| iOS Simulator or physical device | 127.0.0.1:9000,suspend,listen |
For an exact application-ready boundary, the app can emit a StartupComplete
event from an EventSource named Ansight-DotNet-Startup. Without that event,
startup analysis uses runtime and trace-boundary milestones.
The recommended way to prepare the app is the opt-in
Ansight.Profiling.DotNet package. Reference it normally, then enable it only
for a dedicated profiling configuration owned by the app. Use Version="*"
to resolve the latest published release:
<ItemGroup>
<PackageReference Include="Ansight.Profiling.DotNet" Version="*" />
</ItemGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Profile'">
<AnsightProfilingEnabled>true</AnsightProfilingEnabled>
<AnsightProfilingTarget>android-emulator</AnsightProfilingTarget>
</PropertyGroup>
Supported values are android-emulator, android-device, ios-simulator,
and ios-device. The package configures the diagnostic endpoint and embeds
ansight/dotnet-profiling.json. Ansight validates that manifest against the
selected device before installation. Artifacts configured manually remain
supported when the manifest is absent.
Call the package API when the first usable screen is ready:
using Ansight.Profiling;
AnsightProfiler.ApplicationReady();
The call is idempotent and supplies the exact application-ready boundary. The app or its CI remains responsible for building the artifact; Ansight never invokes this build.
| Option | Applies to | Meaning |
|---|---|---|
--wait | profile dotnet start | Keep the command attached until capture completion. A detached capture requires a resident host. |
--headless | profile dotnet start | Do not open simulator/emulator windows; windows are shown by default. |
--duration-seconds <n> | profile dotnet start | Set the capture duration from 1 to 300 seconds. The default is 30. |
--app-id <id> | profile dotnet start, profile dotnet import | Supply the bundle/package ID to launch, or associate an imported trace. |
--device-id <id> | profile dotnet start | Target an exact simulator, emulator, or physical device. |
--symbols <path> | profile dotnet start | Copy a portable PDB file or directory into capture storage. |
--limit <count> | profile dotnet list | Return between 1 and 1000 recent captures. The default is 100. |
--application-path <path> | profile dotnet import | Associate an imported .nettrace with an application artifact. |
Profiling analysis options
| Option | Applies to | Meaning |
|---|---|---|
--start-ms <n> | All analysis commands | Set the inclusive start offset from the beginning of the trace. It cannot be negative. |
--end-ms <n> | All analysis commands | Set the inclusive end offset. It cannot be negative or earlier than --start-ms. |
--process-id <id> | All analysis commands | Restrict analysis to one non-negative process ID. |
--thread-id <id> | All analysis commands | Restrict analysis to one non-negative managed or operating-system thread ID. |
--limit <count> | profile dotnet cpu | Return between 1 and 500 hotspots. The default is 50. |
--limit <count> | profile dotnet gc, profile dotnet jit, profile dotnet exceptions | Return between 1 and 1000 results. The default is 100. |
--max-depth <count> | profile dotnet call-tree | Limit tree depth to 1–128. The default is 32. |
--max-children <count> | profile dotnet call-tree | Limit children per node to 1–200. The default is 50. |
Global --json output uses the ansight.dotnet-analysis/v1 schema and includes
the source trace hash and analysis warnings.
The .NET technology aliases are .net and net. Analysis aliases are
startup-timeline/timeline, hotspots/cpu-hotspots, calltree,
thread-activity, gc-summary, and jit-summary.
task
Task options
| Option | Applies to | Meaning |
|---|---|---|
--app-id <app-id> | task list, task run | Required application bundle or package ID. |
--repository <path> | task list, task run | Use this repository root instead of the current directory. |
--device-id <id> | task run | Select the connected session on this simulator or emulator. It cannot be combined with --session-id. |
--session-id <id> | task run | Select an exact connected Ansight session. It cannot be combined with --device-id. |
--headless | task run | Do not open windows for device starts requested by task tools. A live app session is still required. |
--input <JSON> | task run | Pass task input as an inline JSON object. It cannot be combined with --input-file. |
--input-file <path> | task run | Read the task input object from a JSON file. Comments and trailing commas are accepted. It cannot be combined with --input. |
--start <timestamp|offset> | task extract | Required interval start as an ISO-8601 timestamp or seconds after session start. |
--end <timestamp|offset> | task extract | Required interval end as an ISO-8601 timestamp or seconds after session start; it must follow --start. |
--workspace <path> | task extract | Select the workspace root. The default is the current directory; --repository is also accepted. |
--title <title> | task extract | Set the generated task title. The session name or app name is used by default. |
--format <ansight|test|maestro|appium> | task extract | Generate an Ansight TypeScript task (default), Ansight workspace YAML test, Maestro YAML flow, or Appium WebdriverIO JavaScript test. |
--assertion <text> | task extract --format test | Supply an observable final-state assertion. Repeat for multiple assertions. If omitted, the extractor suggests one from a newly visible final UI label when available. |
--validation <text> | task extract --format test | Supply final-state validation instructions. |
--ai / --reasoning <fast|balanced|deep> / --model <model> | task extract --format maestro | Optionally refine the generated flow through Ansight’s authenticated model gateway (signed-in account or ai:execute runner key). Reasoning defaults to fast. |
--output <path> | task extract | Choose an explicit output path. Defaults to ansight/tasks/<suggested-name>.ts, ansight/tests/<suggested-name>.yaml, .maestro/<suggested-name>.yaml, or appium/<suggested-name>.test.mjs according to format. |
--force | task extract | Replace an existing output file. --overwrite is an alias. |
A resident host and matching live app session are required. Global --json
emits the complete versioned task result. See
Task API Reference.
replay
Beta feature. Agentic replay commands are experimental and best-effort. They are omitted from default CLI help; run ansight help --beta to include them. Supervise every live run and be prepared to stop unintended actions.
replay converts recorded interaction evidence into at most 50 semantic steps
and asks the same bounded UI-control agent used by app execute and workspace tests to reproduce
them against a separate live app session. Every plan and run also carries a
prominent beta notice in CLI output.
# Inspect derived actions without controlling an app.
ansight replay ansight <recorded-session-id> --plan-only
ansight replay posthog recording.json --app-id com.example.app --plan-only
# Reproduce an Ansight capture. If necessary, Ansight starts a compatible local
# target, launches the installed app, and waits for its fresh SDK session.
ansight replay ansight <recorded-session-id>
# Select an exact target or install a build before launching it.
ansight replay ansight <recorded-session-id> \
--device-id <simulator-or-emulator-id> \
--app <path-to-app-or-apk> \
--repository <app-repository>
# Download Sentry recording segments without putting the token on the command line.
export SENTRY_AUTH_TOKEN=sntrys_...
ansight replay sentry <replay-id> \
--organization acme --project mobile \
--app-id com.example.app \
--target-session-id <live-session-id>
Replay options
| Option | Meaning |
|---|---|
--plan-only | Print the versioned ansight.replay-plan/v1 plan without requiring or controlling a live target. |
--allow-sparse-frames | Explicitly allow a supervised Ansight replay when screenshot support is rated degraded or unreliable. This does not improve the source evidence. |
--annotation <id> | For an Ansight source, replay this annotation’s range. A point annotation continues to the end of the session. It cannot be combined with --start or --end. |
--app-id <id> | Associate an external Sentry or PostHog recording with the target app. This is optional when --target-session-id supplies the app identity. |
--target-session-id <id> | Control this exact connected Ansight session. --session-id is an alias. The source and target Ansight sessions must be different. |
--device-id <id> | Start and select an exact simulator, emulator, or physical device. --device is an alias. |
--headless | Do not open simulator/emulator windows during replay; windows are shown by default. |
--platform <ios|android> | Restrict automatic target selection to one platform. Ansight captures infer this from recorded device metadata when possible. |
--device-kind <virtual|physical> | Restrict automatic target selection by device kind. |
--app <path> | Install an .app or .apk before launch. --ipa <path> installs an .ipa; --application-path is a generic alias. |
--wait-seconds <count> | Time to wait for the launched app to connect to Ansight. The default is 45 seconds. |
--team-id <uuid> | Select an organisation when more than one organisation permits the app. |
--start <timestamp|offset> | Start an Ansight source range at an ISO-8601 timestamp or a non-negative seconds offset. |
--end <timestamp|offset> | End an Ansight source range at an ISO-8601 timestamp or a non-negative seconds offset. |
--repository <path> | Link trusted repository tasks for the app so the replay agent can use an exact matching task. |
--secret <alias> | Expose a configured host-managed app secret to the run. Repeat for multiple aliases. |
--reasoning <mode> | Select reasoning mode: fast (default), balanced, or deep. The server resolves the replay-agent model and reasoning budget. |
--model-transport <mode> | Model connection: auto (default), websocket (ws), or http. auto allows HTTP fallback; websocket requires WebSocket. |
--max-turns <count> | Limit turns per step to 1–512. The default is 64. |
--max-round-trips <count> | Limit model round trips per step to 1–500. The default is 64. |
--max-tool-calls <count> | Limit total tool calls to 1–4000. The default is 512. |
--stop-on-failure | Stop after the first failed replay step (the default). |
--trace | Capture the full exportable model/tool execution trace. |
--organization <slug> | Select the Sentry organization for API download. |
--project <id|slug> | Select the Sentry project slug or PostHog project ID for API download. |
--host <url> | Override the provider host for a region or self-hosted deployment. |
--token-env <name> | Read the provider token from this environment variable. Defaults are SENTRY_AUTH_TOKEN and POSTHOG_PERSONAL_API_KEY. |
Replay validates its complete option contract before contacting a resident host
or performing target discovery. Unknown options, missing option values, and
values attached to boolean flags return a usage error without starting a device,
launching an app, or driving a session. Use --plan-only to inspect a replay;
--plan is intentionally rejected with a suggestion.
Replay stops after its first failed step because later steps depend on reaching
the preceding recorded state. The --stop-on-failure flag remains accepted for
existing scripts but is no longer needed.
Before target discovery or app launch, an Ansight replay measures screenshot
support around the actions in the selected source range. The plan reports
retained-change FPS, observed frame intervals, the percentage of timed replay
steps with a screenshot within 1.5 seconds, and how many actions have distinct
supporting change frames. Distinct support considers all frames within that
window, assigning each frame to at most one step; two steps sharing a nearest
frame can still have distinct nearby support. Exact consecutive duplicate JPEGs are suppressed, so
quiet frame gaps are reported but do not by themselves reduce the rating.
Support is rated reliable, degraded, or unreliable; degraded and unreliable
captures are blocked unless --allow-sparse-frames is explicit. Prefer making a
new capture over using the override. Sentry and PostHog RRWeb exports use an
event-driven DOM mutation stream rather than periodic Ansight screenshots, so
this screenshot-cadence gate does not apply to those sources.
For Ansight captures, taps are correlated with nearby visual-tree nodes and
screenshots. Ordinary text-entry actions are inferred by matching stable input
nodes across consecutive visual trees and comparing their visual.value
content. Intermediate values in one typing burst are compacted to the final
replacement, while an empty final value becomes a clear-field action. Generated
steps retain source visual-tree, screenshot, and normalized touch-coordinate
references for review; live execution always resolves the current semantic
target instead of reusing a capture-local node ID.
Cancelled touch gestures are omitted with a plan diagnostic. Replaying a cancelled gesture as a completed tap or swipe could perform a different action.
Text inference requires a capture mode that records visual trees. A
touch-triggered tree can observe the final value at the next touch; a session
that ends with the keyboard still open may need screenshot-aligned periodic
trees or an explicit post-edit capture. Secure or provider-omitted values are
never reconstructed. Use --secret <alias> or an explicit repository task input
for those fields. Return/Done/Search keys, shortcuts, selection, cursor movement,
and IME composition are not represented by a value transition.
Because this is state diffing rather than key logging, paste, autofill, and
programmatic value changes can look identical; uncorrelated changes are marked
for review in plan diagnostics.
Sentry and PostHog replay data is also best-effort input: privacy masking can remove field values and labels, coordinates may not map to a different viewport, and unsupported gestures are skipped. These cases are returned as diagnostics in the plan and run output. Provider tokens are used only for the download request and are never included in command output.
Live execution first reuses a compatible connected app session. When none is
available, it uses the same target launcher as workspace tests: it discovers a
compatible local device, boots it when necessary, optionally installs the
supplied app artifact, launches the app, and waits for a fresh Ansight SDK
session. Native Ansight captures infer their platform and, when available, their
native device identifier from the recorded device profile. Ambiguous target
inventories require --device-id; missing installations require --app or
--ipa.
Replay uses the same authenticated test-run preparation and metering path as
workspace tests. A signed-in session with an expired access token is refreshed
automatically when its refresh token is available, then the organisation AI
execution credential is supplied to the replay agent. A runner key with
ai:execute and ANSIGHT_TEAM_ID can use the same flow without a saved login.
Before live control begins, the target session is durably tagged with
replay-driven, replay-beta, replay-source-<provider>, and
replay-status-running. Completion replaces the running tag with the latest
replay-status-succeeded, replay-status-failed, or
replay-status-cancelled value while preserving unrelated user tags.
post-hog is accepted as an alias for the posthog replay source.
repo
Repository options
| Option | Applies to | Meaning |
|---|---|---|
--session-id <id> | repo task run | Select an exact connected session. It cannot be combined with --device-id; without either flag, the newest connected session for the app is used. |
--device-id <id> | repo task run | Select the connected session on this simulator or emulator. It cannot be combined with --session-id. |
--headless | repo task run | Do not open windows for device starts requested by task tools. A live app session is still required. |
--input <JSON> | repo task run | Pass task input as an inline JSON object. It cannot be combined with --input-file. |
--input-file <path> | repo task run | Read the task input object from a JSON file. Comments and trailing commas are accepted. It cannot be combined with --input. |
--limit <count> | repo automation runs | Return between 1 and 500 recent runs. The default is 100. |
automations, trigger, and triggers alias automation. Linked Agent
workspaces restore enabled trigger connections whenever the resident host starts.
workspace
Workspace options
| Option | Applies to | Meaning |
|---|---|---|
--app-id <id> | workspace init | Register this application ID and link it to the new workspace without prompting. It cannot be combined with --no-register. |
--name <name> | workspace init | Set the human-readable name used when --app-id registers the app. |
--no-register | workspace init | Skip app registration without prompting. It cannot be combined with --app-id. |
--app-id <id> | workspace export | Resolve the workspace from this registered app’s linked codebase. Cannot be combined with a workspace path. |
--output <archive.zip> | workspace export | Required output ZIP path, outside the workspace’s ansight/ directory. |
--force | workspace export, workspace import | Replace the output ZIP or conflicting imported files. Other destination files are preserved. --overwrite is an alias. |
--title <text> | workspace add task | Set the task’s human-readable title. |
--description <text> | workspace add task | Set the task’s purpose and expected result. |
--app-id <id> | workspace add task | Restrict the task to one application ID. |
--app-id <id> | workspace add test | Set the required application bundle or package ID. |
--name <text> | workspace add test | Set the test’s human-readable name. |
--prompt <text> | workspace add test | Set the scenario instructions for the test runner. |
--validation <text> | workspace add test | Set the final-state validation instructions. |
--assertion <text> | workspace add test | Add an observable assertion. Repeat the flag to add more than one. |
--required-secret <name> | workspace add test | Declare a required secret alias. Repeat the flag for multiple secrets. |
--event-kind <kind> | workspace add trigger | Select the event handled by the trigger. The default is app.event. |
--app-id <id> | workspace add trigger | Restrict the trigger to one application ID. |
--force | All workspace authoring commands | Replace existing definitions or generated support files. --overwrite is an alias. |
See Workspace for the generated files and authoring APIs.
Workspace ZIPs contain files rooted under ansight/, excluding .git,
node_modules, and .DS_Store. Host secrets, registrations, and session history
are not transferred. Import validates and decompresses the archive before
updating the destination; it does not register or execute imported definitions.
Both commands enforce 100,000 entries (including parent directories) and 2 GiB
expanded size. Unsafe paths, links, duplicate paths, and corrupt entries are
rejected. Use --json for the ansight.workspace-archive/v1 result.
See Export and import a workspace ZIP
for a complete transfer and registration example.
initialize aliases workspace init; create aliases workspace add.
Definition kinds accept their plural forms, automation for trigger, and the
British spellings sanitiser and sanitisers.
auth
sign-in aliases login, and sign-out aliases logout. The same aliases
are accepted beneath account.
Authentication options
With no mode flag, login opens app.ansight.ai. The portal accepts the normal
account sign-in and returns the session to a state-validated HTTP loopback
callback using a form POST, so tokens are not placed in the browser URL. The
portal creates a non-persistent session specifically for the CLI instead of
sharing the browser portal’s rotating refresh token.
Choose at most one alternate login mode:
| Option | Meaning |
|---|---|
--provider <name> | Start browser authorization-code login with PKCE for this provider. |
--email <address> | Sign in with email and a password read through secret input. |
--otp | With --email, request an email one-time code and read that code through secret input instead of reading a password. |
--access-token | Validate and save a Supabase access token read through secret input. |
--device | Use OAuth RFC 8628 device flow. Provider endpoint and client settings must also be supplied by flags or environment variables. |
Additional authentication flags are:
| Option | Applies to | Meaning |
|---|---|---|
--no-browser | Portal or provider login | Print the browser authorization URL instead of opening the browser. |
--callback-port <port> | Portal or provider login | Bind the local callback to a fixed port from 1024 to 65535; otherwise an available port is selected. ANSIGHT_AUTH_CALLBACK_PORT is the environment alternative. |
--timeout <seconds> | Portal or provider login | Set the browser-login timeout from 0 to 1800 seconds. The default is 300. |
--portal-url <url> | Portal login | Override https://app.ansight.ai/. ANSIGHT_PORTAL_URL is the environment alternative; HTTP is accepted only for loopback development. |
--device-authorization-endpoint <url> | Device login | Set the absolute HTTPS authorization endpoint. ANSIGHT_OAUTH_DEVICE_AUTHORIZATION_ENDPOINT is the environment alternative. |
--device-token-endpoint <url> | Device login | Set the absolute HTTPS token endpoint. ANSIGHT_OAUTH_DEVICE_TOKEN_ENDPOINT is the environment alternative. |
--device-client-id <id> | Device login | Set the required OAuth client ID. ANSIGHT_OAUTH_DEVICE_CLIENT_ID is the environment alternative. |
--device-scope <scope> | Device login | Set the requested OAuth scopes. The default is openid email offline_access; ANSIGHT_OAUTH_DEVICE_SCOPE is the environment alternative. |
--supabase-url <url> | auth login, auth refresh, auth logout | Override the configured Supabase project URL. |
--supabase-publishable-key <key> | auth login, auth refresh, auth logout | Override the public Supabase client key. |
--stdin | Email or access-token login | Read the password, OTP, or access token from standard input. |
--from-env <NAME> | Email or access-token login | Read the password, OTP, or access token from the named environment variable. |
--local | auth logout | Clear local credentials without attempting remote session revocation. |
Without --stdin or --from-env, an interactive terminal uses a hidden prompt.
Secret values are never accepted as ordinary command-line arguments or printed.
secret
| Command | Purpose |
|---|---|
secret list <app-id> | List test-secret aliases without values. |
secret set <app-id> <alias> | Create or replace a secret. |
secret remove <app-id> <alias> | Delete a secret; alias delete. |
Secret options
| Option | Applies to | Meaning |
|---|---|---|
--stdin | secret set | Read the secret value from standard input. |
--from-env <NAME> | secret set | Read the secret value from the named environment variable. |
--secret-store-file <path> | All secret commands | Use an encrypted file instead of the operating-system credential vault. |
--secret-key-file <path> | All secret commands | Read the encrypted file store’s AES key from an owner-only file. |
Without an input flag, an interactive terminal uses a hidden prompt. Secret
values are never accepted as ordinary command-line arguments and are never
returned by list.
--from-env copies a value into the configured secret store. Workspace and
inline test runs can instead resolve a requested secret directly from an
environment variable whose name exactly matches the alias. An app-scoped stored
value takes precedence when both sources contain that alias.
test
Test target options
| Option | Applies to | Meaning |
|---|---|---|
--session-id <id> | test run, test run-inline | Reuse an exact connected app session. It is required for run-inline. |
--device-id <id> | test run, test run-inline, test run-all | Select an exact simulator, emulator, or physical device. --device is an alias. For run-inline, this narrows the live app target associated with the selected session. |
--device-kind <physical|virtual> | test run, test run-all | Restrict automatic discovery to physical or virtual targets. |
--headless | test run, test run-all, test run-inline | Do not open native windows for virtual-target launches or tool-requested device starts. Windows are shown by default. Reused connected sessions keep their existing window state; run-inline still requires a live session. |
--platform <ios|android> | test run, test run-all | Restrict automatic target discovery by platform. |
--execution-mode sdk|device | test run, test run-all, test run-inline | Select SDK capture (launch default) or external simulator/emulator capture. An existing session determines the mode; an explicit mismatch is rejected. |
--app <path> | test run, test run-all | Install an .app or .apk before launch. It cannot be combined with --ipa or --application-path. |
--ipa <path> | test run, test run-all | Install a signed physical-device IPA. The path must end in .ipa; the flag cannot be combined with --app or --application-path. |
--application-path <path> | test run, test run-all | Generic application-artifact option. It cannot be combined with --app or --ipa. |
--team-id <uuid> | test run, test run-all | Select the organisation used by hosted execution. The value must be a non-empty UUID. |
Test runner and output options
| Option | Applies to | Meaning |
|---|---|---|
--instruction <text> | test run-inline | Add an instruction to the ordered run. Repeat the flag for multiple instructions; at least one instruction or instruction file is required. |
--instructions-file <path> | test run-inline | Read additional instructions from a text file, one non-empty instruction per line. |
--secret <alias> | test run-inline | Grant an existing app-scoped test secret to the inline run. Repeat the flag for multiple aliases. |
--reasoning <mode> | test run, test run-inline, test run-all | Select reasoning mode: fast (default), balanced, or deep. The server resolves the model and reasoning budget using the client’s configuration. |
--model-transport <mode> | test run, test run-inline, test run-all | Model connection: auto (default), websocket (ws), or http. auto allows HTTP fallback; websocket requires WebSocket. |
--wait-seconds <seconds> | test run, test run-all | Set the app-session connection timeout. The default is 45; the accepted range is 0–86400. |
--max-turns <count> | test run, test run-inline, test run-all | Limit agent turns to 1–512. The default is 64. |
--max-round-trips <count> | test run, test run-inline, test run-all | Limit model round trips to 1–4096. The default is 64. |
--max-tool-calls <count> | test run, test run-inline, test run-all | Limit tool calls to 1–16384. The default is 512. |
--batch <run-id> | test run | Correlate this individual execution with other runs that use the same batch run ID. The execution keeps its own unique run ID. IDs may contain up to 128 letters, numbers, hyphens, or underscores. |
--test <id> | test run-all | Select one test instead of the full catalog. Repeat the flag to select multiple tests. |
--parallel | test run-all | Run each selected test once, distributing tests concurrently across the selected devices. Without this flag, each test runs on every selected device before the next test starts. |
--stop-on-failure | test run, test run-inline, test run-all | Stop continued execution after the first failed instruction or test. Active parallel tests finish, but pending tests are not started after a failure is known. |
--no-workspace-tools | test run, test run-all | Do not expose trusted repository tasks to the test agent. |
--trace | test run, test run-inline, test run-all | Capture the full exportable model/tool execution trace. By default, only lightweight audit metadata is stored. |
--result-file <path> | test run, test run-all | Write the versioned JSON result to this path instead of the generated result path. |
--audit | test run, test run-all | Add token, tool-call, timing, and cost attribution to human-readable output. |
--json | test run, test run-inline, test run-all | Emit the complete versioned result on standard output. |
--silent | test run, test run-inline, test run-all | Suppress standard output and standard error, overriding --json. |
--verbose | test run, test run-inline, test run-all | Include model progress, telemetry, and app events. |
--app-id <id> | test export | Restrict exported session archives to this application ID. |
Concurrent test execution
Repeat --device-id with test run to execute the same test concurrently on every selected
device:
ansight test run . onboarding.complete \
--device-id <ios-simulator-id-1> \
--device-id <ios-simulator-id-2> \
--device-id <android-emulator-id>
Audio APIs reject parallel test batches on both platforms. Do not use
--parallel or select multiple devices. Calls reject with
audio-parallel-execution-unsupported and are logged in test progress and the task
call audit. For iOS, also avoid overlapping audio jobs on the same Mac. Removing --parallel alone does not serialize a multi-device run. See
audio concurrency restrictions.
Without --parallel, test run-all uses matrix scheduling: the current test runs on every
selected device as one concurrent cohort, Ansight waits for the whole cohort, and then the next
test starts.
ansight test run-all . \
--device-id <ios-simulator-id-1> \
--device-id <ios-simulator-id-2> \
--device-id <android-emulator-id>
Pass --parallel to use the selected devices as a worker pool instead. Every selected test runs
exactly once. Each device runs at most one test at a time and receives the next pending test as
soon as it becomes available; extra devices remain idle when there are fewer tests than devices.
ansight test run-all . --parallel \
--device-id <ios-simulator-id-1> \
--device-id <ios-simulator-id-2> \
--device-id <android-emulator-id>
Both modes wait for all active device runs before returning. With --stop-on-failure, active
runs finish, but no pending tests are started after a failure is known. Explicitly selected
stopped devices are started automatically. When --app is supplied, a matching installed
artifact is reused by checksum instead of being reinstalled.
Test history options
| Option | Applies to | Meaning |
|---|---|---|
--app-id <id> | test history | Return history for one application ID. |
--workspace <path> | test history | Restrict batches and executions to one workspace. |
--batch <run-id> | test history | Restrict history to one managed run-all batch or one correlation ID shared by individual runs. |
--limit <count> | test history | Return from 1 to 10000 entries. The default is 100. |
test run-all creates and maintains its own batch run ID automatically. Use
--batch when tests must be launched by separate test run commands but still
reviewed as one correlated group:
ansight test run . onboarding.complete --batch release_20260901
ansight test run . checkout.purchase --batch release_20260901
ansight test history --batch release_20260901
ansight test inspect release_20260901
A correlated batch does not create or overwrite a managed run-all batch
audit. test inspect <batch-id> resolves every locally retained execution with
the matching correlation ID.
trends
| Command | Purpose |
|---|---|
trends history | List stored trends metrics and historical regression comparisons. |
trends rebuild | Re-evaluate stored metrics with the current workspace Trends rules. |
Trends history options
| Option | Meaning |
|---|---|
--app-id <id> | Return one app’s Trends history. |
--metric <key> | Restrict results to one trends-id.metric-id key. |
--decision <id> | Restrict historical comparisons to one decision ID. |
--span-group <name> | Restrict results to one grouped observation-span value. |
--limit <count> | Return from 1 to 10000 metrics and history rows. The default is 100. |
trends rebuild replays stored metrics in chronological order. It
recomputes baselines, pinned release comparisons, and consecutive-run
confirmation from the current registered workspace rules, then replaces the
selected comparisons atomically. It does not re-extract metric values from
session replays.
| Option | Meaning |
|---|---|
--app-id <id> | Rebuild one app. Omit it to rebuild every app that has stored metrics and a registered codebase. |
--app-version <version> | Rebuild only this version of the selected app. Requires --app-id; earlier metrics remain available as baselines. |
--metric <key> | Rebuild only one metric’s regression policy. |
--workspace <path> | Override the selected app’s registered codebase. Requires --app-id. |
--dry-run | Calculate and report the rows that would be replaced without changing the history database. |
session
Inspection
session list filters the lightweight summary index and does not hydrate logs,
telemetry, network requests, screenshots, trees, or artifacts. JSON output uses
ansight.sessions/v3 and reports matchedCount, returnedCount, limit,
isTruncated, nextCursor, and the current sessions page.
Inspection options
| Option | Applies to | Meaning |
|---|---|---|
--app-id <id> | session list | Return sessions for one application ID. |
--connected | session list | Return only currently connected sessions. |
--platform <key> | session list | Require ios, android, macos, windows, or other. Repeat the flag to accept multiple platforms. |
--device-form-factor <value> | session list | Require an exact device form factor. Repeat the flag for multiple values; --form-factor is an alias. |
--os-name <value> | session list | Require an exact operating-system name. Repeat the flag for multiple values. |
--os-version <value> | session list | Require an exact operating-system version. Repeat the flag for multiple values. |
--device-type <value> | session list | Require an exact device type. Repeat the flag for multiple values. |
--physical | session list | Require a physical device. |
--virtual | session list | Require a virtual target. |
--emulator | session list | Require an emulator. --simulator is accepted as an equivalent filter. |
--tag <tag> | session list | Require a session tag. Repeat the flag to require multiple tags. |
--from <utc> | session list | Keep sessions whose capture interval ends at or after this ISO-8601 timestamp. |
--to <utc> | session list | Keep sessions whose capture interval starts at or before this ISO-8601 timestamp. |
--has-logs | session list | Require retained log evidence. |
--has-telemetry | session list | Require retained telemetry evidence. |
--search <text> | session list | Search session identity, app, device, OS, and tags. --contains is an alias. |
--limit <count> | session list | Return a page of 1–1000 session summaries. The default is 20. |
--cursor <cursor> | session list | Continue after the opaque nextCursor returned by a previous JSON page. Keep the same filters between pages. |
--limit <count> | session logs | Return the newest 1–10000 matching logs. The default is 200. |
--contains <text> | session logs | Keep logs whose message contains this text, ignoring case. --query is an alias. |
--stream <id> | session logs | Keep logs from this exact stream. Repeat the flag for multiple streams. |
--tag <tag> | session logs | Keep logs with this exact tag. Repeat the flag for multiple tags. |
--source <source> | session logs | Keep logs from this exact source. Repeat the flag for multiple sources. |
--start <utc> | session logs | Set the inclusive beginning of the ISO-8601 timestamp range. |
--end <utc> | session logs | Set the inclusive end of the ISO-8601 timestamp range. |
--priority <level> | session logs | Keep an exact log priority. |
--minimum-priority <level> | session logs | Keep this priority and higher, using verbose, debug, information, warning, error, or fatal. --minimum-severity and --severity are aliases. |
--id <request-id> | session network | Keep one exact request identifier. |
--method <method> | session network | Keep an exact HTTP method. Repeat the flag for multiple methods. |
--status <code|class> | session network | Keep an exact status, a 2xx–5xx class, or failed/error requests. Repeatable. |
--host <host> | session network | Keep requests whose hostname contains this value. |
--start <utc> | session network | Set the inclusive beginning of the request start-time range. |
--end <utc> | session network | Set the inclusive end of the request start-time range. |
--contains <text> | session network | Search URL, method, and error message. --query is an alias. |
--failed | session network | Keep transport errors and HTTP 4xx/5xx responses. |
--bodies | session network | Include captured request and response bodies in human-readable output. JSON output always retains the structured body fields returned by the command. |
--limit <count> | session network | Return the newest 1–10000 matching requests. The default is 200. |
--limit <count> | session metrics | Return the newest 1–50000 samples. The default is 500. |
--channel <id> | session metrics | Keep samples and channel metadata for numeric channel ID 0–255. |
--limit <count> | session images, touches, trees, artifacts, annotations, analyses | Return the newest 1–10000 collection items. The default is 200. |
Connectivity options
ansight session connectivity <session-id> summary --json
ansight session connectivity <session-id> at --offset 01:15 --json
ansight session connectivity <session-id> events --from 00:30 --to 02:00 --json
ansight session connectivity <session-id> quality --limit 100 --json
ansight session connectivity <session-id> timeline --annotation <annotation-id> --before 120 --after 30 --json
| Option | Meaning |
|---|---|
--from <time>, --to <time> | Bound the query with ISO-8601 timestamps or mm:ss / hh:mm:ss session offsets. |
--offset <time>, --at <time> | Select a time for at. |
--annotation <id> | Use an annotation’s time or range in this session. |
--before <seconds>, --after <seconds> | Expand the annotation window. Defaults: 120 before, 30 after; each accepts 1–3600. |
--kind <kind> | Filter paged observations by snapshot, change, quality, or gap. |
--limit <count> | Bound an observation page to 1–1000 records; default 200. Responses also have a payload-size limit. |
--cursor <cursor> | Continue from nextCursor with the same query filters. Restart if a live capture invalidates the cursor. |
summary is the default. events excludes quality-only observations; quality includes observations carrying quality; timeline includes every kind. Results describe capture bounds, clipping, and supported measurements. An absent flag is unknown, and availability alone does not establish internet or server reachability.
See Connectivity Review for player and agent workflows, Connectivity Capture for SDK setup, and Offline Capture to import a raw SDK ZIP, including password-protected archives.
Telemetry analysis options
| Option | Meaning |
|---|---|
--kind <all|fps-drop|memory-spike> | Select the detectors to run. The default is all; fps and memory are accepted aliases for the two individual detectors. |
--memory-min-percent <percent> | Require a relative memory increase from 1 to 100 percent. The default is 15. |
--memory-min-mb <megabytes> | Require an absolute memory increase from 1 to 4096 MB. The default is 128. |
--max-events <count> | Return at most 1–10000 findings per detector. The default is 12. |
--fail-on-detection | Return exit code 11 when the selected detectors find any event. |
Editing and evidence export
Editing and export options
| Option | Applies to | Meaning |
|---|---|---|
--annotation <id> | session extract | Use the bounds of this annotation. It cannot be combined with --start or --end. |
--start <utc> | session extract, session trim, session annotation upsert | Set the required inclusive start as an ISO-8601 timestamp when explicit bounds are used. |
--end <utc> | session extract, session trim, session annotation upsert | Set the end timestamp. It is required for extraction and trimming and optional for annotations. |
--name <name> | session extract | Set the extracted session name. |
--mode <cut|keep> | session trim | Remove the selected interval or retain only that interval. remove/cut-selection and keep-only/keep-selection are accepted aliases. |
--file <annotation.json> | session annotation upsert | Read the complete annotation from JSON instead of individual annotation flags. |
--annotation-id <id> | session annotation upsert | Set the annotation ID. A new compact GUID is generated by default. |
--label <label> | session annotation upsert | Set the required annotation label when --file is not used. |
--notes <text> | session annotation upsert | Set optional annotation notes. |
--source <source> | session annotation upsert | Set the annotation source. The default is cli. |
--frame-id <id> | session screenshot export | Export a specific frame. Without a frame or timestamp, the newest screenshot is exported. |
--timestamp <utc> | session screenshot export | Export the screenshot nearest this ISO-8601 timestamp. |
--snapshot-id <id> | session artifact export | Select an artifact snapshot. Without it, the newest matching snapshot is used. |
--path <artifact-path> | session artifact export | Select the required artifact path within the snapshot. |
--output <path> | session screenshot export, session artifact export | Write the exported evidence to this required local path. |
--force | session screenshot export, session artifact export | Replace an existing output file. --overwrite is an alias. |
Management and cache
Metadata options
| Option | Meaning |
|---|---|
--name <name> | Set the session’s display name. |
--notes <text> | Set notes, replacing the current value. |
--clear-notes | Remove all notes. |
--tag <tag> | Replace the current tags with the supplied values. Repeat the flag for multiple tags. |
--clear-tags | Remove every tag. |
--pin | Protect the session from cache cleanup. It cannot be combined with --unpin. |
--unpin | Remove cache-cleanup protection. It cannot be combined with --pin. |
Cache options
| Option | Applies to | Meaning |
|---|---|---|
--compaction-age-days <days> | session cache compact | Compact inactive sessions at least 1–365 days old. The default is 30. |
--retention-days <days> | session cache status, plan, prune | Select sessions older than 1–365 days. The default is 90. |
--max-cache <size> | session cache status, plan, prune | Set the target cache limit from 256MiB to 1TiB, using a value such as 5GB or 5GiB. The default is 5GiB. |
--max-cache-size <size> | session cache status, plan, prune | Alias for --max-cache. |
--apply | session cache prune | Delete the sessions in the plan. Without this flag, prune is a dry run. |
Automatic cache maintenance defaults to compacting inactive captures after 30 days and deleting eligible unpinned captures after 90 days. Run compaction on demand with:
ansight session cache compact
ansight session cache compact --compaction-age-days 14
ansight session cache compact --json
Compaction is non-lossy: the expanded session folder becomes a ZIP archive on disk. Opening the session expands it automatically and resets its compaction age, so it must remain unopened for another threshold period before it is compacted again. Live sessions are skipped. Pinned historical sessions may be compacted because their data remains preserved; pinning continues to protect them from deletion.
Replay, sharing, and archives
Replay options
| Option | Applies to | Meaning |
|---|---|---|
--port <port> | session serve | Bind the replay server to this port. The default, 0, selects an available port. |
--open | session serve | Open the replay in the default browser after the server starts. |
Cloud sharing options
| Option | Applies to | Meaning |
|---|---|---|
--team-id <uuid> | session share, session summary, session url | Select an organisation by non-empty UUID. |
--local | session summary | Use the brokered model on selected local evidence and save a local analysis instead of starting a Cloud AI extraction. |
--reasoning <fast|balanced|deep> | session summary --local | Select the brokered model’s reasoning mode; default: fast. |
--model <id> | session summary --local | Diagnostic model override; cannot be combined with --reasoning. |
--team-name <name> | session share | Select an organisation by name when an ID is not supplied. |
--public | session share | Shorthand for public replay access. It cannot be combined with a non-public --access value. |
--access <team|authenticated|public> | session share | Set the replay access level. The default is team. |
--include-native-logs | session share | Include native device logs in the upload. They are excluded by default. |
--sanitize | session share | Apply the built-in PII policy before uploading. Sharing is raw by default. |
--no-sanitize | session share | Explicitly retain the raw-capture default. It cannot be combined with --sanitize, --sanitizer, or --policy. |
--sanitizer <module.ts> | session share | Apply named sanitization functions from this local TypeScript module instead of the built-in policy. |
--policy <module.ts> | session share | Alias for --sanitizer. |
--include-archived | session url | Allow an archived share when resolving the newest replay URL. |
The default session summary action requires an existing team share. Run
session share first when using Cloud AI with a local-only capture. The local
player’s Cloud AI results and Flowchart use the selected capture’s newest cloud
share.
Use session summary <session-id> --local to keep the capture in local storage.
The brokered model receives a bounded selection of session evidence; the session
is not uploaded as a team share. Local describes where the result is saved:
the AI still runs in Ansight’s hosted service and receives selected evidence and
screenshots. Authenticate with a signed-in account, or an app-scoped runner key
with sessions:summarize (or ai:execute) and ANSIGHT_TEAM_ID. The organisation
must permit hosted AI/workspace model runs and have AI allowance remaining.
Use --team-id <uuid> to select an organisation for a signed-in account or assert
the runner key’s organisation. The app is taken from the session and must match
the key. The saved result appears in session analyses and is included when
that session is subsequently shared. Use --json for the summary and analysis ID.
An owner or administrator issues the key once from a signed-in machine:
ansight auth login
ansight cloud app register com.example.app --team-id <team-id>
ansight cloud key issue --team-id <team-id> --app-id com.example.app \
--name "Tester summaries" --scope sessions:summarize --scope sessions:write
Store the returned an_run_... value in your CI or tester secret store. On the
unattended machine, inject it as an environment secret and run:
export ANSIGHT_RUNNER_API_KEY='<secret from the key issuer>'
export ANSIGHT_TEAM_ID='<team-id>'
ansight session summary <session-id> --local --team-id "$ANSIGHT_TEAM_ID" &&
ansight session share <session-id> --team-id "$ANSIGHT_TEAM_ID" --access team
No interactive login is required on that machine. ANSIGHT_API_KEY remains an
alias; ANSIGHT_RUNNER_API_KEY takes precedence. Expired or revoked keys and keys
for another app or organisation are rejected. The issuing member must remain in
the organisation; reissue the key if they leave. Summaries consume the same
organisation AI allowance as signed-in runs. Existing upload-only keys do not
gain AI access.
Archive options
| Option | Applies to | Meaning |
|---|---|---|
--exclude-native-logs | session export, session sanitize | Omit native device logs from the archive. |
--sanitize | session export | Apply the built-in PII policy while exporting. |
--sanitizer <module.ts> | session export, session sanitize | Run named sanitization functions from this local TypeScript module. The file must end in .ts. |
--policy <module.ts> | session export, session sanitize | Alias for --sanitizer. |
--password-env <NAME> | session import | Read an archive password from the named environment variable. |
session share and session export preserve the raw capture unless --sanitize
or --sanitizer is supplied. session sanitize applies the built-in policy when
no custom module is supplied. The built-in policy redacts structured PII, masks
screenshots whose raster content cannot be proven safe, excludes artifacts, and
records its work in sanitization/report.json.
share-url and replay-url alias session url; sanitise aliases
session sanitize.
cloud
Registers cloud App IDs and administers uploaded Trends history, test-run summaries,
sessions, attachments, and hosted analysis. Administration uses the current
auth session. Headless uploads and AI actions can instead use an app-scoped runner
credential through ANSIGHT_RUNNER_API_KEY and ANSIGHT_TEAM_ID. The app
identity is derived from the key; ANSIGHT_APP_ID is only an optional default
for commands that select matching local app data. Registering an App ID expresses cloud intent but does not
start billing. Uploads and other cloud writes require the organisation’s
corresponding trial, paid entitlement, or explicit grant.
Beta feature subset. The cloud app-graph commands are experimental, may change before general availability, and are omitted from default CLI help. Other commands in the cloud family are not covered by this feature-specific beta marker.
| Command | Purpose |
|---|---|
cloud team list | List organisations available to the signed-in account. The action defaults to list; teams is a resource alias. |
cloud app list [--team-id <uuid>] | List registered App IDs available to the account. |
cloud app register <app-id> --team-id <uuid> | Register the exact App ID required by cloud session, Trends, and test uploads. Organisation owner or admin permission is required. |
cloud app remove <app-id> --team-id <uuid> | Remove a registered App ID so new uploads for it are rejected. |
cloud app-graph list --team-id <uuid> | Beta. List organisation App Graphs; accepts --search <text>. |
cloud app-graph show <graph-id> [--published] | Beta. Show a draft or published App Graph. Local planning, validation, execution, and exploration use app-graph. |
cloud trends upload|sync [<app-id>] --team-id <uuid> | Upload idempotent local trends metrics and historical comparisons for portal history. |
cloud test upload <run-id> --team-id <uuid> [--app-id <id>] | Upload one local run or all child runs in a saved batch. |
cloud test sync <app-id> --team-id <uuid> | Upload recent local test-run summaries for one registered App ID. |
cloud test import <results.xml> --format junit|appium-junit | Import each JUnit test case as an idempotent cloud test result. Team and App ID can come from the runner environment. |
cloud key list --team-id <uuid> | List app-scoped runner keys without revealing their secret values. |
cloud key issue --team-id <uuid> --app-id <id> [--scope <scope>] | Issue an an_run_... key. The plaintext value is displayed once; owner or admin permission is required. |
cloud key revoke <key-id> | Revoke a runner key immediately. |
cloud session list | List shared cloud sessions; sessions is a resource alias. |
cloud session download <cloud-session-id> | Download the session archive. |
cloud session archive|restore|delete <cloud-session-id> | Change archival state or permanently delete the shared session. remove aliases delete. |
cloud attachment list <cloud-session-id> | List the session’s attachments; attachments is a resource alias. |
cloud attachment upload <cloud-session-id> <file> | Upload a local file as an attachment. |
cloud attachment download <cloud-session-id> <attachment-id> | Download an attachment to a required local destination. |
cloud attachment delete <cloud-session-id> <attachment-id> | Permanently delete an attachment; alias remove. |
cloud analysis list <cloud-session-id> | List hosted analysis runs; analyses is a resource alias. |
cloud analysis run <cloud-session-id> | Start a hosted analysis over selected session evidence. |
cloud analysis summary <cloud-session-id> | Start the portal-compatible summary preset. summarize and summarise are aliases. |
cloud analysis archive|restore <run-id> | Change the archival state of an analysis run. |
Cloud query and transfer options
| Option | Applies to | Meaning |
|---|---|---|
--search <text> | cloud team list, cloud app-graph list, cloud session list | Search organisation, App Graph, or session results. |
--team-id <uuid> | Cloud app, App Graph, Trends, test, key, and session commands | Select or restrict the organisation. ANSIGHT_TEAM_ID supplies the headless default. |
--include-archived | cloud session list | Include archived sessions. |
--limit <count> | cloud session list | Return from 1 to 1000 sessions. The default is 200. |
--limit <count> | cloud trends upload|sync, cloud test sync | Limit the local history records considered for upload. |
--metric <key> | cloud trends upload|sync | Upload one trends-id.metric-id key. |
--decision <id> | cloud trends upload|sync | Upload one historical comparison decision. |
--span-group <name> | cloud trends upload|sync | Upload one grouped observation-span series. |
--name <name> | cloud app register | Set the portal display name; the App ID is used by default. |
--platform <name> | cloud app register | Add optional platform context. |
--app-id <id> | Cloud test imports/uploads and runner-key issue | Supply the registered App ID. ANSIGHT_APP_ID supplies the headless default. |
--format <junit|appium-junit> | cloud test import | Select the XML dialect. The default is junit. |
--app-version <value> | Cloud test uploads | Add the tested app version. |
--branch <name>, --commit <sha> | Cloud test uploads | Add source-control context without uploading source or prompts. |
--workspace <path> | cloud test sync | Restrict local execution history to one workspace. |
--run-id <id> | cloud test import | Set a stable CI execution prefix. Otherwise the JUnit file digest is used. |
--session-id <id> | cloud test import | Link imported results to the newest uploaded Ansight session with this source ID. |
--scope <scope> | cloud key issue | Grant sessions:write, sessions:summarize, ai:execute, trends:write, tests:write, builds:write, builds:read, workspaces:write, workspaces:read, runners:read, or runners:write; repeat as needed. The three session/trends/test write scopes are granted when omitted. |
--name <name> | cloud key issue | Set the key name. The default is CI runner. |
--expires-at <timestamp> | cloud key issue | Set an optional future ISO-8601 expiry. |
--output <path> | cloud session download | Set the archive destination. The default is ansight-cloud-<session-id>.zip in the current directory. |
--output <path> | cloud attachment download | Set the required local attachment destination. |
--name <name> | cloud attachment upload | Set the attachment name. The local filename is used by default. |
--notes <text> | cloud attachment upload | Add attachment notes. |
--force | Cloud downloads | Replace an existing destination file. --overwrite is an alias. |
For all CLI AI actions, issue an explicit ai:execute key instead of the
summary-only scope. Add upload scopes separately when the workflow uploads data:
ansight cloud key issue --team-id <team-id> --app-id com.example.app \
--name "CI AI" --scope ai:execute --scope sessions:write --scope tests:write
With that key and ANSIGHT_TEAM_ID configured, session summary on an existing
share and cloud analysis run|summary|list|archive|restore work without login.
Session discovery and analysis results are restricted to the key’s app and team.
ai:execute also covers local summaries, app execution, AI tests, replay,
App Graph AI execution/exploration, and task extraction/refinement. It does not
grant uploads, key administration, remote runner administration or unrelated
cloud access. Default key scopes remain sessions:write, trends:write, and
tests:write; neither AI scope is granted automatically.
Hosted analysis options
| Option | Meaning |
|---|---|
--kind <analysis|mermaid|trends> | Select the analysis result kind. The default is analysis. |
--mode <fast|thorough> | Select the analysis depth. cloud analysis run defaults to fast; cloud analysis summary and session summary default to thorough. |
--provider <openai|anthropic|gemini> | Select the hosted provider. The default is openai. |
--model <id> | Override the provider’s default model. |
--source-part <part> | Include session_metadata, logs, screenshots, visual_tree, metrics, annotations, or artifacts. Repeat the flag for multiple parts. Generic runs default to all evidence parts except metadata; summary presets default to metadata, logs, and screenshots. |
--slice-start-ms <value> | Set a non-negative inclusive start offset in milliseconds. |
--slice-end-ms <value> | Set a non-negative inclusive end offset in milliseconds. |
--instructions <text> | Add instructions for the hosted analysis. |
Every cloud resource accepts its plural alias. Runner-key aliases are keys,
runner-key, and runner-keys; add aliases app registration; and delete
aliases app removal. remove aliases session, attachment, and key deletion or
revocation as appropriate.
licenses
| Command | Purpose |
|---|---|
licenses list | Show bundled and optional external software attribution. |
licenses export <output.md|output.json> | Export Markdown or versioned JSON. |
| Option | Applies to | Meaning |
|---|---|---|
--format <markdown|json> | licenses export | Override the format inferred from the .md, .markdown, or .json output extension. |
--force | licenses export | Replace an existing output file. |
Exit codes
| Code | Meaning |
|---|---|
0 | Success. |
1 | General failure. |
2 | Invalid command usage. |
3 | Configuration is invalid or incomplete. |
4 | Required Ansight host or app session is unavailable. |
5 | Target capability is unavailable. |
6 | A cloud operation lacks authentication or cloud permission, or cloud access cannot be verified. |
10 | A test or required assertion failed. |
11 | Telemetry findings were detected with --fail-on-detection. |
130 | Operation cancelled. |