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]
OptionMeaning
--help, -h, -?Show help for the selected command family.
--versionShow the CLI version, daily build number, and installed update channel.
--betaInclude beta feature commands in CLI help.
--jsonEmit a versioned machine-readable result.
--silentSuppress stdout and stderr, overriding JSON output.
--verboseInclude debug, telemetry, and app-event diagnostics.
--headlessDo 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

Command familyCommands and argumentsAliases
versionversioninfo, --version
updateupdate check [options]
update [options]
upgrade
analyticsstatus
detailed enable
detailed disable
—
configlist
get explorer-path
get explorer-port
set explorer-path <path>
set explorer-port <port>
unset explorer-path
unset explorer-port
settings
accountaccount
open
access [--json]
grants [--team-id <uuid>]
login [options]
refresh
status
logout [--local]
portal for open; grant for grants; authentication actions delegate to auth
serveserve [--session <id>] [--port <port>] [--path <path>] [--open]—
hostrun [options]
status
logs
stop
—
uisnapshot
find
tap
type
swipe
pinch
back
wait
assert
—
keyboardopen
is-open
dismiss
—
audiocapabilities --session <id>
inject --session <id> --file <path.wav>
—
app watchadd <app-id> [options]
list
enable <watch-id>
disable <watch-id>
remove <watch-id>
Automatic external capture on simulators and emulators
doctordoctor [options]capabilities
devicelist [filters]
start <ios|android> <device-id>
shutdown <ios|android> <device-id>
apps <ios|android> <device-id>
install <ios|android> <device-id> <app-path>
launch <ios|android> <device-id> <app-id>
terminate <ios|android> <device-id> <app-id>
location set <platform> <device-id>
location clear <platform> <device-id>
location play <platform> <device-id> <route>
location status
location stop
screenshot <platform> <device-id>
devices
inputtap <platform> <device-id> --x <px> --y <px>
swipe <platform> <device-id> [options]
pinch ios <device-id> [options]
text <platform> <device-id> --value <text>
button <platform> <device-id> <button>
type for text
applist
get <app-id>
register <app-id> [options]
remove <app-id>
tools <session-id>
call <session-id> <tool-id> [options]
batch <session-id> [options]
execute <session-id> --prompt <text>
push-file <session-id> <local-path> <remote-directory> [options]
—
app-graphlist --team-id <uuid>
show <graph-id>
validate <graph-id>
plan <graph-id>
run <graph-id> <live-session-id>
explore [<app-id>]
Beta feature; app-graphs
pairingissue [app-id] [options]
list [options]
get <invite-id>
revoke <invite-id>
enrollment
companionaccess status
access enable [--mode session|always]
access disable
machines list
machines get <machine-id>
machines rename <machine-id> <name>
machines revoke <machine-id>
machines restore <machine-id>
machines delete <machine-id> --force
connections list
connections disconnect <session-id>
connections disconnect-all
remote, remote-simulator
profileios tools|start|status|cancel|list|manifest
android tools|start|status|cancel|list|manifest
dotnet tools
dotnet start <app-path> [options]
dotnet status <capture-id>
dotnet cancel <capture-id>
dotnet list
dotnet manifest <capture-id>
dotnet import <trace.nettrace>
dotnet speedscope <capture-id>
dotnet overview <capture-id>
dotnet startup <capture-id>
dotnet cpu <capture-id>
dotnet call-tree <capture-id>
dotnet threads <capture-id>
dotnet gc <capture-id>
dotnet jit <capture-id>
dotnet exceptions <capture-id>
Beta feature; profiling; .net and net for dotnet
tasklist --app-id <app-id> [options]
run <task-id> --app-id <app-id> [options]
extract <session-id> --start <value> --end <value> [options]
tasks
replayansight <session-id> [options]
sentry <export.json|replay-id> [options]
posthog <export.json|recording-id> [options]
Beta feature
repotasks <app-id> <repository-path>
task run <app-id> <repository-path> <task-id>
automation inspect <app-id> <repository-path>
automation connect <app-id> <repository-path>
automation disconnect <app-id>
automation list
automation runs <app-id>
repository
workspacelist
init <path> [options]
export <path> --output <archive.zip>
export --app-id <id> --output <archive.zip>
import <archive.zip> <path>
add task <path> <id>
add test <path> <id> --app-id <id>
add trigger <path> <id>
add sanitizer <path> <id>
workspaces
authlogin [options]
refresh
status
logout [--local]
Authentication actions are also available below account
secretlist <app-id>
set <app-id> <alias> [input option]
remove <app-id> <alias>
secrets
testlist <workspace-path>
validate <workspace-path>
run <workspace-path> <test-id> [options]
run-inline --session-id <id> --instruction <text> [options]
run-all <workspace-path> [options]
history [options]
inspect <run-id>
export <run-id> <output.zip>
tests
trendshistory [options]
rebuild [options]
—
sessionlist [options]
show <session-id>
logs <session-id> [options]
network <session-id> [options]
metrics <session-id> [options]
telemetry analyze <session-id> [options]
images <session-id>
touches <session-id>
trees <session-id>
artifacts <session-id>
annotations <session-id>
analyses <session-id>
extract <session-id> [options]
trim <session-id> [options]
normalize <session-id>
annotation upsert <session-id> [options]
annotation delete <session-id> <annotation-id>
analysis delete <session-id> <analysis-id>
screenshot export <session-id> [options]
artifact export <session-id> [options]
metadata <session-id> [options]
cache status
cache plan
cache prune [--apply]
cache compact
disconnect <session-id>
delete <session-id>
serve <session-id> [options]
serve stop <session-id>
share <session-id> [options]
url <session-id>
export <session-id> <output.zip>
sanitize <session-id> <output.zip>
import <archive.zip>
sessions; requests for network; normalise/compact for normalize
cloudteam list [options]
app list|register|remove
app-graph list|show
trends upload|sync [<app-id>]
test upload <run-id>
test sync <app-id>
test import <results.xml>
key list|issue|revoke
session list [options]
session download <id> [options]
session archive|restore|delete <id>
attachment list <session-id>
attachment upload <session-id> <file> [options]
attachment download <session-id> <attachment-id> [options]
attachment delete <session-id> <attachment-id>
analysis list <session-id>
analysis run <session-id> [options]
analysis summary <session-id> [options]
analysis archive|restore <run-id>
plural resource aliases are accepted; cloud App Graphs are beta
licenseslist
export <output.md|output.json> [options]
license, licence, licences, notice, notices, attribution, attributions

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.

OptionApplies toMeaning
--jsonversion, update check, updateEmit the complete versioned build or update result.
--channel <public|preview>update check, updateCheck or select a release channel. Without this flag, the installed channel is used.
--version <version>update check, updateSelect an exact human-readable release version. It must be supplied with --build-number.
--build-number <YYYYMMDDNN>update check, updateSelect the exact positive daily build number. It must be supplied with --version.

analytics

CommandPurpose
analytics statusShow mandatory engagement tracking, detailed consent, and local settings path.
analytics detailed enable|disableOpt in to signed-in detailed analytics, or disable it and remove unsent detailed events.

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.

OptionMeaning
--data-dir <path>Read or change analytics settings in a non-default Ansight data directory.
--jsonEmit 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.

OptionMeaning
--data-dir <path>Read or change settings in a non-default Ansight data directory.
--jsonEmit 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>.

OptionMeaning
--team-id <uuid>For account grants or account usage, select one organisation by non-empty UUID.
--jsonFor 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]
OptionMeaning
--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.
--openOpen the explorer in the default browser after it starts.
--enable-repository-automationsPermit trusted repository trigger execution in this host. This is the default.
--disable-repository-automationsDisable 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

CommandPurpose
ansight host runStart the resident SDK, explorer, and CLI control host.
ansight host statusReport host state, CLI version/build, ports, data directory, explorer link, and current host log.
ansight host logsPrint the host log directory and current or most recent CLI-host log. host log is an alias.
ansight host stopStop the resident host and release its ports and data lock.

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

OptionMeaning
--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.
--openOpen the local explorer in the default browser after the host starts.
--no-serveRun 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-automationsPermit trusted repository trigger execution in this host. This is the default.
--disable-repository-automationsDisable 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.

OptionMeaning
--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.
--containsUse substring rather than exact selector matching.
--case-sensitiveMatch selector strings case-sensitively.

UI operation options

OptionApplies toMeaning
--max-nodes <count>ui snapshotReturn 1–2000 nodes. The default is 256.
--max-depth <count>ui snapshotTraverse 1–64 levels. The default is 32.
--include-properties <true|false>ui snapshotForce detailed framework properties on or off.
--include-bounds <true|false>ui snapshotInclude element bounds. The default is true.
--limit <count>ui findReturn 1–1000 matches. The default is 100.
--value <text>ui typeSet the required text value.
--appendui typeAppend instead of replacing existing text.
--direction <up|down|left|right>ui swipeSet a direction. The default is up; it cannot be combined with --orientation.
--orientation <path>ui swipeSet a compass path such as SW or E-to-W; it cannot be combined with --direction.
--length <value>ui swipeSet a normalized length from 0.05 through 0.9.
--start-x, --start-y, --end-x, --end-yui swipeSupply all four normalized 0–1 coordinates for an exact swipe. Exact coordinates cannot be combined with direction, orientation, or length.
--scale <value>ui pinchSet the required scale from 0.1 through 4; values below 1 pinch inward.
--center-x, --center-yui pinchSet both normalized 0–1 center coordinates.
--start-distance <value>ui pinchSet the normalized starting contact distance from 0.05 through 0.8.
--angle-degrees <value>ui pinchRotate the contact axis by this finite angle.
--duration-ms <ms>ui swipe, ui pinchSet a duration from 50 through 2000 milliseconds.
--condition <visible|hidden|stable>ui waitSelect the wait condition. The default is visible.
--timeout-ms <ms>ui waitSet a timeout from 100 through 60000 milliseconds. The default is 10000.
--poll-ms <ms>ui waitPoll every 100–5000 milliseconds. The default is 250.
--stable-samples <count>ui waitRequire 2–20 unchanged samples for a stable wait.
--absentui assertAssert that no match exists; equivalent to --exists false or --count 0.
--exists <true|false>ui assertAssert whether any matching element exists.
--count <count>ui assertAssert an exact match count from 0 through 1000000.
--expected-text <text>ui assertAssert the selected node’s text.
--expected-value <value>ui assertAssert the selected node’s value.
--expected-visible <true|false>ui assertAssert the selected node’s visibility.
--expected-enabled <true|false>ui assertAssert the selected node’s enabled state.
--jsonAll UI commandsEmit 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.

OptionMeaning
--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.
--fullCollect system state: OS, installation, dependencies, apps, devices, agents and existing skills.
--output <report.json>Save the full report as JSON; requires --full.
--include-secret-metadataExplicitly include Ansight secret aliases and recorded revisions, never values or secret hashes; requires --full.
--jsonEmit 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

CommandPurpose
device listList live virtual and physical devices, state, kind, and capability warnings. The bare devices alias does the same.
device start <ios|android> <device-id>Boot a virtual target or verify a physical iOS target; alias boot.
device shutdown <ios|android> <device-id>Shut down a virtual target; alias stop.
device apps <ios|android> <device-id>List user-installed apps.
device install <ios|android> <device-id> <app-path>Install a supported .app or .apk.
device launch <ios|android> <device-id> <app-id>Launch an installed app.
device terminate <ios|android> <device-id> <app-id>Stop an app.
device location set <platform> <device-id>Set a simulated GPS coordinate.
device location clear <platform> <device-id>Clear simulated GPS.
device location play <platform> <device-id> <route.gpx|route.kml>Replay a GPX or KML route; alias replay.
device location statusShow the active resident-host route playback.
device location stopStop the active resident-host route playback.
device screenshot <platform> <device-id>Capture the target display.

Device options

OptionApplies toMeaning
--iosdevice listReturn only iOS targets.
--androiddevice listReturn only Android targets.
--simulatordevice listReturn only iOS simulators. --simulators is an alias.
--headlessdevice start, device bootBoot without opening a simulator/emulator window; windows are shown by default.
--emulatordevice listReturn only Android emulators. --emulators is an alias.
--physicaldevice listReturn only physical devices. --physical-devices is an alias.
--phonedevice list, bare devicesReturn only phones. --phones is an alias.
--tabletdevice list, bare devicesReturn only tablets. --tablets is an alias.
--app-id <id>device list, bare devicesReturn 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 devicesWith --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 devicesWith --app-id, match a build/version code. Supports the same * and ? wildcards.
--offlinedevice listInclude offline, shut-down, unauthorized, and unavailable targets.
--alldevice list, bare devicesAlias for --offline; include every discovered target.
--latitude <number>device location setSet the latitude. This flag and --longitude are both required.
--longitude <number>device location setSet the longitude. This flag and --latitude are both required.
--mode <recorded|fixed-speed>device location playUse the route timestamps, or replay at a fixed speed. The default is recorded; recorded-timing and fixed are accepted aliases.
--speed <number>device location playSet a positive recorded-timing multiplier. The default is 1.
--fixed-speed-kph <number>device location playSet a positive fixed replay speed in kilometres per hour. The default is 30; --speed-kph is an alias.
--loopdevice location playRepeat the route until it is stopped.
--waitdevice location playKeep the command attached until resident-host playback finishes. Transient playback waits automatically.
--output <path>device screenshotWrite 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 optionMeaning
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

CommandPurpose
input tap <platform> <device-id> --x <coordinate> --y <coordinate>Tap an absolute coordinate.
input swipe <platform> <device-id> ...Swipe between two absolute coordinates.
input pinch ios <device-id> ...Pinch between two horizontal contact spans.
input text <platform> <device-id> --value <text>Type through the device bridge; alias type.
input button <platform> <device-id> <button>Send a platform button such as back, home, enter, or menu.

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

OptionApplies toMeaning
--x <coordinate>input tapRequired horizontal display coordinate: Android pixels or iOS logical points.
--y <coordinate>input tapRequired vertical display coordinate: Android pixels or iOS logical points.
--start-x <coordinate>input swipeRequired horizontal coordinate where the swipe begins.
--start-y <coordinate>input swipeRequired vertical coordinate where the swipe begins.
--end-x <coordinate>input swipeRequired horizontal coordinate where the swipe ends.
--end-y <coordinate>input swipeRequired vertical coordinate where the swipe ends.
--center-x <points>input pinchRequired iOS logical-point horizontal center.
--center-y <points>input pinchRequired iOS logical-point vertical center.
--start-span <points>input pinchRequired initial distance between the two horizontal contacts.
--end-span <points>input pinchRequired final distance between the two horizontal contacts.
--duration-ms <ms>input swipe, input pinchSet the gesture duration from 1 to 60000 milliseconds. The default is 300.
--value <text>input textRequired text to send through the platform input bridge.

app

CommandPurpose
app listList registered apps and apps discovered from sessions.
app get <app-id>Show app metadata and session counts.
app register <app-id>Add or update app metadata and its trusted codebase; alias add.
app remove <app-id>Remove linked app metadata; alias delete.
app tools <session-id>Search or read the authenticated live app-tool catalog.
app call <session-id> <tool-id>Invoke one tool using its published JSON argument schema.
app batch <session-id>Execute up to 32 ordered app-tool calls with optional per-call evidence.
app interact --session <id>Keep one interactive JSONL process/pipe open for gestures, batches and saved tasks, with automatic evidence.
app execute [<session-id>] --prompt <text>Interpret a natural-language goal, launch or connect to the app, act, and verify the result.
app push-file <session-id> <local-path> <remote-directory>Upload through app file tools.

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.

CommandPurpose
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 listShow 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.
OptionApplies toMeaning
--platform ios|androidapp watch addRestrict discovery to one platform; omit for both.
--device-id <id>app watch addSelect 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 addRepeatable data-sandbox-relative path: at most 16 files, 16 MiB each; unavailable for physical iOS.
--instrumentsapp watch addAttach 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 configureTarget 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.
--jsonAll app-watch commandsReturn 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

OptionApplies toMeaning
--name <name>app registerSet the app’s human-readable name.
--codebase <path>app registerLink a trusted repository root for automatic monitoring and repository definitions.
--arguments <JSON>app callPass an inline JSON object to the tool. It cannot be combined with --arguments-file.
--arguments-file <path>app callRead the tool’s JSON object from a file. Comments and trailing commas are accepted. It cannot be combined with --arguments.
--if-revision <revision>app toolsReturn a compact unchanged catalog when the app still has this revision.
--query <text>app toolsPartially match all words across indexed tool IDs, names, descriptions, categories, and keywords. Schemas are fetched only after selection.
--feature <text>app toolsMatch all words in a feature or domain hint such as mapbox, routing, or preferences.
--category <category>app toolsMatch one exact category, case-insensitively.
--id-prefix <prefix>app toolsMatch tool IDs beginning with the supplied prefix, case-insensitively.
--tool-id <id>app toolsMatch one exact tool ID, case-insensitively.
--policy <read|write|critical>app toolsMatch one exact tool policy.
--executable-onlyapp toolsExclude tools blocked by live availability, the local guard, or the paired-client policy. Focused searches use this behavior by default.
--include-unavailableapp toolsInclude blocked or currently unavailable tools in a focused search. It cannot be combined with --executable-only.
--max-results <count>app toolsReturn 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 toolsReturn compact catalog metadata without schemas, or complete matching definitions. The default is full.
--after <JSON> / --after-file <path>app callCapture explicit post-call visual-tree or screenshot evidence.
--after-tree / --after-screenshotapp callRequest common post-call evidence without writing JSON.
--after-delay-ms <ms>app callWait from 0 through 2000 milliseconds before evidence capture.
--calls <JSON> / --calls-file <path>app batchSupply an ordered JSON array of {toolId, arguments, after, callId} objects.
--continue-on-errorapp batchContinue later calls after a failed call.
--prompt <text>app executeNatural-language app goal to execute and verify. It cannot be combined with --prompt-file.
--prompt-file <path>app executeRead the complete execution prompt from a file. It cannot be combined with --prompt.
--secret <alias>app executeGrant one host-managed app secret without exposing its value to the model. Repeatable.
--reasoning <mode>app executeSelect reasoning mode: fast (default), balanced, or deep. The server resolves the model and reasoning budget using the client’s configuration.
--model-transport <mode>app executeModel connection: auto (default), websocket (ws), or http. auto allows HTTP fallback; websocket requires WebSocket.
--team-id <uuid>app executeSelect an organisation when more than one signed-in organisation permits agent execution for the app.
--app-graphapp executeBeta feature. Explicitly opt in to authorized published App Graph route guidance. Ansight includes only graphs for the exact registered app ID and selected organisation.
--traceapp executeExplicitly 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 executeInstall 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 executeLaunch an installed app, or provide the identifier explicitly for an artifact.
--device-id <id>app executeSelect 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 executeConstrain launch to ios or android.
--execution-mode sdk|deviceapp executeLaunch 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 executeConstrain launch to simulator, emulator, or physical.
--headlessapp executeDo not open simulator/emulator windows during launch or execution.
--close-app-on-completionapp executeClose 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 executeSet the launched app’s Ansight session connection timeout. The default is 45.
--max-turns <count>app executeLimit agent turns from 1 to 512; default 64.
--max-round-trips <count>app executeLimit model round trips from 1 to 4096; default 64.
--max-tool-calls <count>app executeLimit tool calls from 1 to 16384; default 512.
--stop-on-failureapp executeStop an ordered execution after its first failed instruction.
--sandbox-root <root>app push-fileSelect one of the sandbox roots published by the connected app.
--file-name <name>app push-fileOverride the destination filename; otherwise the local filename is used.
--overwriteapp push-fileReplace an existing destination file.
--no-create-directoryapp push-fileFail 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.

CommandPurpose
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

OptionApplies toMeaning
--team-id <uuid>list, exploreSelect an organisation by non-empty UUID. It is required for list and when app registration is otherwise ambiguous.
--search <text>listSearch graph names and metadata.
--publishedshow, validate, plan, run, exploreUse the published version instead of the current draft. A new graph cannot be published during exploration.
--target <destination>plan, runMatch a destination ID, name, synonym, or purpose.
--parameters <JSON>runSupply an inline JSON object for {{name}} binding substitutions. It cannot be combined with --parameters-file.
--parameters-file <path>runRead binding parameters from a JSON object file. It cannot be combined with --parameters.
--reasoning <mode>run, exploreSelect reasoning mode for fallback bindings or exploration: fast (default), balanced, or deep. The server resolves the model and reasoning budget.
--model-transport <mode>run, exploreModel connection: auto (default), websocket (ws), or http. auto allows HTTP fallback; websocket requires WebSocket.
--device-id <id>run, exploreTarget a specific simulator or device. --device is an alias.
--headlessrun, exploreDo not open simulator/emulator windows during automatic launch or agent-driven device starts.
--tracerun, exploreCapture the full exportable agent trace.
--app-id <id>exploreSelect the target app explicitly instead of using the optional positional App ID or workspace inference.
--workspace <path>exploreSelect the workspace used for implicit app selection. The default is the current directory.
--session-id <id>exploreOverride the latest linked live session selected for the app.
--launchexploreLaunch the app non-interactively when no linked session is connected.
--no-launchexploreSuppress the interactive launch prompt. It cannot be combined with --launch.
--wait-seconds <seconds>exploreSet the app-to-host connection timeout. The default is 45.
--platform <ios|android>exploreRestrict automatic launch to one platform.
--device-kind <physical|virtual>exploreRestrict automatic launch to one device kind.
--graph <name-or-id>exploreAdd a reviewable observation to an existing graph. It cannot be combined with --new-graph.
--new-graph <name>exploreCreate a separate draft graph after successful exploration.
--focus <text>explorePrioritise an app area without turning it into a user goal.
--max-actions <count>exploreSet the safe-navigation action bound from 1 through 1024. The default is 1024.
--max-turns <count>exploreSet model work turns from 1 through 1024. The default is 1023.
--max-round-trips <count>exploreSet organisation model round trips from 1 through 1024. The default is 1024.
--max-tool-calls <count>exploreSet Ansight tool calls from 1 through 4000. The default is 4000.
--notes <text>exploreAdd notes to the reviewable observation.
--no-saveexploreReturn the candidate without uploading an observation or registering an inferred app.
--result-file <path>exploreAlso write the structured result to a local file.

pairing

CommandPurpose
pairing issue [app-id]Create an invitation; alias create.
pairing listList enrollment invitations.
pairing get <invite-id>Inspect one invitation without exposing its secret.
pairing revoke <invite-id>Revoke an invitation; aliases remove, delete.

Pairing options

OptionApplies toMeaning
--codepairing issuePrint the one-use pairing code for manual entry.
--qrpairing issueRender a scannable QR in the terminal. A resident host must be running.
--qr-output <path>pairing issueWrite the QR as a PNG at this path. A resident host must be running.
--host-address <LAN-IP>pairing issuePut an address reachable by the phone into the pairing payload instead of relying on automatic selection.
--overwritepairing issueReplace an existing file selected by --qr-output.
--name <name>pairing issueSet a human-readable invitation name.
--duration <duration>pairing issueSet the invitation lifetime using mo, w, d, h, or m. The default is one month.
--app-id <app-id>pairing listReturn invitations for one application ID.
--active-onlypairing listHide 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

CommandPurpose
companion access statusInspect companion access.
companion access enableEnable companion access.
companion access disableDisable access.
companion machines listList developer-machine registrations.
companion machines get <machine-id>Show one machine.
companion machines rename <machine-id> <name>Rename a machine.
companion machines revoke <machine-id>Revoke a machine.
companion machines restore <machine-id>Restore a machine.
companion machines delete <machine-id> --forcePermanently delete a machine.
companion connections listList live remote sessions.
companion connections disconnect <session-id>Disconnect one remote session.
companion connections disconnect-allDisconnect every remote session.

Companion options

OptionApplies toMeaning
--mode <session|always>companion access enableUse session to publish only for the current host lifetime, or always to keep access enabled for later CLI management. The default is session.
--include-revokedcompanion machines listInclude revoked developer-machine registrations.
--forcecompanion machines deleteConfirm 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

CommandPurpose
profile ios toolsReport 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 listList 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 toolsReport 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 listList 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

OptionApplies toMeaning
--waitNative startKeep the command attached until capture completion. A detached capture requires a resident host.
--headlessNative startDo not open simulator/emulator windows; windows are shown by default.
--preset <name>profile ios startSelect launch (default), cpu, memory, or leaks.
--preset <name>profile android startSelect 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 startSet the capture duration from 1 to 300 seconds. The default is 30.
--app-id <id>Native startSupply the required bundle or package ID.
--device-id <id>Native startSelect the required Simulator/device UDID or emulator/device serial.
--limit <count>Native listReturn between 1 and 1000 recent captures. The default is 100.
--sql <query>profile android querySupply one read-only SELECT or WITH statement. Multiple or mutating statements are rejected.
--limit <rows>profile android queryReturn 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.

CommandPurpose
profile sample toolsReport 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 listList 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.
OptionMeaning
--waitKeep 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

CommandPurpose
profile dotnet toolsReport profiling requirements; alias requirements.
profile dotnet start <app-path>Install and profile a supplied .app, .apk, or .ipa.
profile dotnet status <capture-id>Show capture state; alias get.
profile dotnet cancel <capture-id>Cancel an active capture.
profile dotnet listList captures.
profile dotnet manifest <capture-id>Show the immutable manifest and artifact inventory.
profile dotnet import <trace.nettrace>Import an existing trace.
profile dotnet speedscope <capture-id>Resolve the derived SpeedScope profile path; alias export-speedscope.
profile dotnet overview <capture-id>Summarize events, CPU, GC, JIT, exceptions, and symbolication.
profile dotnet startup <capture-id>Show startup milestones and application-ready evidence.
profile dotnet cpu <capture-id>Rank sampled CPU hotspots.
profile dotnet call-tree <capture-id>Show the bounded sampled call tree.
profile dotnet threads <capture-id>Rank process and thread activity.
profile dotnet gc <capture-id>Summarize garbage-collection intervals.
profile dotnet jit <capture-id>Summarize JIT work and largest methods.
profile dotnet exceptions <capture-id>Group thrown exceptions by type and message.

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.

TargetDiagnosticConfiguration
Android emulator10.0.2.2:9000,suspend,connect
Android physical device127.0.0.1:9000,suspend,connect
iOS Simulator or physical device127.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.

OptionApplies toMeaning
--waitprofile dotnet startKeep the command attached until capture completion. A detached capture requires a resident host.
--headlessprofile dotnet startDo not open simulator/emulator windows; windows are shown by default.
--duration-seconds <n>profile dotnet startSet the capture duration from 1 to 300 seconds. The default is 30.
--app-id <id>profile dotnet start, profile dotnet importSupply the bundle/package ID to launch, or associate an imported trace.
--device-id <id>profile dotnet startTarget an exact simulator, emulator, or physical device.
--symbols <path>profile dotnet startCopy a portable PDB file or directory into capture storage.
--limit <count>profile dotnet listReturn between 1 and 1000 recent captures. The default is 100.
--application-path <path>profile dotnet importAssociate an imported .nettrace with an application artifact.

Profiling analysis options

OptionApplies toMeaning
--start-ms <n>All analysis commandsSet the inclusive start offset from the beginning of the trace. It cannot be negative.
--end-ms <n>All analysis commandsSet the inclusive end offset. It cannot be negative or earlier than --start-ms.
--process-id <id>All analysis commandsRestrict analysis to one non-negative process ID.
--thread-id <id>All analysis commandsRestrict analysis to one non-negative managed or operating-system thread ID.
--limit <count>profile dotnet cpuReturn between 1 and 500 hotspots. The default is 50.
--limit <count>profile dotnet gc, profile dotnet jit, profile dotnet exceptionsReturn between 1 and 1000 results. The default is 100.
--max-depth <count>profile dotnet call-treeLimit tree depth to 1–128. The default is 32.
--max-children <count>profile dotnet call-treeLimit 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

CommandPurpose
task list --app-id <app-id>Discover repository tasks.
task run <task-id> --app-id <app-id>Run a task against a connected session.
task extract <session-id> --start <value> --end <value>Generate an Ansight task, workspace YAML test, Maestro flow, or Appium script from a recorded session interval.

Task options

OptionApplies toMeaning
--app-id <app-id>task list, task runRequired application bundle or package ID.
--repository <path>task list, task runUse this repository root instead of the current directory.
--device-id <id>task runSelect the connected session on this simulator or emulator. It cannot be combined with --session-id.
--session-id <id>task runSelect an exact connected Ansight session. It cannot be combined with --device-id.
--headlesstask runDo not open windows for device starts requested by task tools. A live app session is still required.
--input <JSON>task runPass task input as an inline JSON object. It cannot be combined with --input-file.
--input-file <path>task runRead the task input object from a JSON file. Comments and trailing commas are accepted. It cannot be combined with --input.
--start <timestamp|offset>task extractRequired interval start as an ISO-8601 timestamp or seconds after session start.
--end <timestamp|offset>task extractRequired interval end as an ISO-8601 timestamp or seconds after session start; it must follow --start.
--workspace <path>task extractSelect the workspace root. The default is the current directory; --repository is also accepted.
--title <title>task extractSet the generated task title. The session name or app name is used by default.
--format <ansight|test|maestro|appium>task extractGenerate an Ansight TypeScript task (default), Ansight workspace YAML test, Maestro YAML flow, or Appium WebdriverIO JavaScript test.
--assertion <text>task extract --format testSupply 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 testSupply final-state validation instructions.
--ai / --reasoning <fast|balanced|deep> / --model <model>task extract --format maestroOptionally 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 extractChoose 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.
--forcetask extractReplace 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.

CommandPurpose
replay ansight <session-id>Build a plan from recorded Ansight touches plus visual-tree target and input-value transitions, then run it against a connected session for the same app.
replay sentry <export.json|replay-id>Parse a local Sentry RRWeb export, or download recording segments through the Sentry replay API.
replay posthog <export.json|recording-id>Parse a PostHog recording JSON export, or request the recording snapshots endpoint.
# 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

OptionMeaning
--plan-onlyPrint the versioned ansight.replay-plan/v1 plan without requiring or controlling a live target.
--allow-sparse-framesExplicitly 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.
--headlessDo 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-failureStop after the first failed replay step (the default).
--traceCapture 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

CommandPurpose
repo tasks <app-id> <repository-path>Inspect task definitions.
repo task run <app-id> <repository-path> <task-id>Run one repository task.
repo automation inspect <app-id> <repository-path>Validate triggers without connecting them.
repo automation connect <app-id> <repository-path>Connect trusted triggers to the resident host.
repo automation disconnect <app-id>Disconnect triggers for an app.
repo automation listList connected trigger catalogs.
repo automation runs <app-id>Show recent trigger attempts; alias history.

Repository options

OptionApplies toMeaning
--session-id <id>repo task runSelect 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 runSelect the connected session on this simulator or emulator. It cannot be combined with --session-id.
--headlessrepo task runDo not open windows for device starts requested by task tools. A live app session is still required.
--input <JSON>repo task runPass task input as an inline JSON object. It cannot be combined with --input-file.
--input-file <path>repo task runRead the task input object from a JSON file. Comments and trailing commas are accepted. It cannot be combined with --input.
--limit <count>repo automation runsReturn 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

CommandPurpose
workspace listList app registrations linked to trusted repository workspaces.
workspace init <path>Create the ansight/ tree, README templates, schemas, and TypeScript support.
workspace export <path> --output <archive.zip>Export the workspace’s ansight/ directory and supporting files to a ZIP.
workspace export --app-id <id> --output <archive.zip>Export the workspace linked to this registered App ID. Use workspace list to find linked workspaces.
workspace import <archive.zip> <path>Validate and import a workspace ZIP into the destination’s ansight/ directory.
workspace add task <path> <id>Add a typed task module.
workspace add test <path> <id> --app-id <id>Add an end-to-end test.
workspace add trigger <path> <id>Add an event trigger.
workspace add sanitizer <path> <id>Add a typed sanitizer.

Workspace options

OptionApplies toMeaning
--app-id <id>workspace initRegister this application ID and link it to the new workspace without prompting. It cannot be combined with --no-register.
--name <name>workspace initSet the human-readable name used when --app-id registers the app.
--no-registerworkspace initSkip app registration without prompting. It cannot be combined with --app-id.
--app-id <id>workspace exportResolve the workspace from this registered app’s linked codebase. Cannot be combined with a workspace path.
--output <archive.zip>workspace exportRequired output ZIP path, outside the workspace’s ansight/ directory.
--forceworkspace export, workspace importReplace the output ZIP or conflicting imported files. Other destination files are preserved. --overwrite is an alias.
--title <text>workspace add taskSet the task’s human-readable title.
--description <text>workspace add taskSet the task’s purpose and expected result.
--app-id <id>workspace add taskRestrict the task to one application ID.
--app-id <id>workspace add testSet the required application bundle or package ID.
--name <text>workspace add testSet the test’s human-readable name.
--prompt <text>workspace add testSet the scenario instructions for the test runner.
--validation <text>workspace add testSet the final-state validation instructions.
--assertion <text>workspace add testAdd an observable assertion. Repeat the flag to add more than one.
--required-secret <name>workspace add testDeclare a required secret alias. Repeat the flag for multiple secrets.
--event-kind <kind>workspace add triggerSelect the event handled by the trigger. The default is app.event.
--app-id <id>workspace add triggerRestrict the trigger to one application ID.
--forceAll workspace authoring commandsReplace 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

CommandPurpose
auth loginOpen app.ansight.ai, sign in, and return the authenticated session to the waiting CLI. Explicit provider, email, access-token, and device modes remain available.
auth refreshRefresh the saved account session.
auth statusShow identity, authentication method, and expiry without token values.
auth logoutRevoke remotely when possible and clear credentials; --local skips revocation.

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:

OptionMeaning
--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.
--otpWith --email, request an email one-time code and read that code through secret input instead of reading a password.
--access-tokenValidate and save a Supabase access token read through secret input.
--deviceUse OAuth RFC 8628 device flow. Provider endpoint and client settings must also be supplied by flags or environment variables.

Additional authentication flags are:

OptionApplies toMeaning
--no-browserPortal or provider loginPrint the browser authorization URL instead of opening the browser.
--callback-port <port>Portal or provider loginBind 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 loginSet the browser-login timeout from 0 to 1800 seconds. The default is 300.
--portal-url <url>Portal loginOverride https://app.ansight.ai/. ANSIGHT_PORTAL_URL is the environment alternative; HTTP is accepted only for loopback development.
--device-authorization-endpoint <url>Device loginSet the absolute HTTPS authorization endpoint. ANSIGHT_OAUTH_DEVICE_AUTHORIZATION_ENDPOINT is the environment alternative.
--device-token-endpoint <url>Device loginSet the absolute HTTPS token endpoint. ANSIGHT_OAUTH_DEVICE_TOKEN_ENDPOINT is the environment alternative.
--device-client-id <id>Device loginSet the required OAuth client ID. ANSIGHT_OAUTH_DEVICE_CLIENT_ID is the environment alternative.
--device-scope <scope>Device loginSet 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 logoutOverride the configured Supabase project URL.
--supabase-publishable-key <key>auth login, auth refresh, auth logoutOverride the public Supabase client key.
--stdinEmail or access-token loginRead the password, OTP, or access token from standard input.
--from-env <NAME>Email or access-token loginRead the password, OTP, or access token from the named environment variable.
--localauth logoutClear 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

CommandPurpose
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

OptionApplies toMeaning
--stdinsecret setRead the secret value from standard input.
--from-env <NAME>secret setRead the secret value from the named environment variable.
--secret-store-file <path>All secret commandsUse an encrypted file instead of the operating-system credential vault.
--secret-key-file <path>All secret commandsRead 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

CommandPurpose
test list <workspace-path>List test definitions and warnings.
test validate <workspace-path>Validate all workspace definitions.
test run <workspace-path> <test-id>Run one end-to-end test.
test run-inline --session-id <id> --instruction <text>Compatibility alias for ordered app execution. Prefer app execute for new prompt-driven workflows.
test run-all <workspace-path>Run all tests or repeated --test <id> selections. Pass --parallel to run each selected test once across the selected devices.
test historyList persisted managed batches, correlated individual runs, and model/tool execution audits.
test inspect <run-id>Inspect one managed or correlated batch, or one execution audit, including child tests and tool-call summaries.
test export <run-id> <output.zip>Export trace JSON and associated portable session archives as one evaluation ZIP.

Test target options

OptionApplies toMeaning
--session-id <id>test run, test run-inlineReuse an exact connected app session. It is required for run-inline.
--device-id <id>test run, test run-inline, test run-allSelect 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-allRestrict automatic discovery to physical or virtual targets.
--headlesstest run, test run-all, test run-inlineDo 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-allRestrict automatic target discovery by platform.
--execution-mode sdk|devicetest run, test run-all, test run-inlineSelect 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-allInstall an .app or .apk before launch. It cannot be combined with --ipa or --application-path.
--ipa <path>test run, test run-allInstall 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-allGeneric application-artifact option. It cannot be combined with --app or --ipa.
--team-id <uuid>test run, test run-allSelect the organisation used by hosted execution. The value must be a non-empty UUID.

Test runner and output options

OptionApplies toMeaning
--instruction <text>test run-inlineAdd 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-inlineRead additional instructions from a text file, one non-empty instruction per line.
--secret <alias>test run-inlineGrant 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-allSelect 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-allModel connection: auto (default), websocket (ws), or http. auto allows HTTP fallback; websocket requires WebSocket.
--wait-seconds <seconds>test run, test run-allSet 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-allLimit agent turns to 1–512. The default is 64.
--max-round-trips <count>test run, test run-inline, test run-allLimit model round trips to 1–4096. The default is 64.
--max-tool-calls <count>test run, test run-inline, test run-allLimit tool calls to 1–16384. The default is 512.
--batch <run-id>test runCorrelate 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-allSelect one test instead of the full catalog. Repeat the flag to select multiple tests.
--paralleltest run-allRun 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-failuretest run, test run-inline, test run-allStop 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-toolstest run, test run-allDo not expose trusted repository tasks to the test agent.
--tracetest run, test run-inline, test run-allCapture the full exportable model/tool execution trace. By default, only lightweight audit metadata is stored.
--result-file <path>test run, test run-allWrite the versioned JSON result to this path instead of the generated result path.
--audittest run, test run-allAdd token, tool-call, timing, and cost attribution to human-readable output.
--jsontest run, test run-inline, test run-allEmit the complete versioned result on standard output.
--silenttest run, test run-inline, test run-allSuppress standard output and standard error, overriding --json.
--verbosetest run, test run-inline, test run-allInclude model progress, telemetry, and app events.
--app-id <id>test exportRestrict 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

OptionApplies toMeaning
--app-id <id>test historyReturn history for one application ID.
--workspace <path>test historyRestrict batches and executions to one workspace.
--batch <run-id>test historyRestrict history to one managed run-all batch or one correlation ID shared by individual runs.
--limit <count>test historyReturn 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.

CommandPurpose
trends historyList stored trends metrics and historical regression comparisons.
trends rebuildRe-evaluate stored metrics with the current workspace Trends rules.
OptionMeaning
--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.

OptionMeaning
--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-runCalculate and report the rows that would be replaced without changing the history database.

session

Inspection

CommandPurpose
session listList recorded and live session summaries with bounded cursor pagination.
session show <session-id>Show identity, connection state, and evidence totals.
session logs <session-id>Read recorded logs.
session network <session-id>Query captured HTTP requests; alias requests.
session connectivity <session-id> [summary|events|quality|timeline|at]Inspect OS connection state, changes, gaps, and quality in live or imported captures.
session metrics <session-id>Read telemetry channels and samples.
session telemetry analyze <session-id>Detect FPS drops and memory spikes.
session images <session-id>Read screenshot frames; alias screenshots.
session touches <session-id>Read touch events, including available Apple Pencil and Android stylus details from SDK captures.
session trees <session-id>Read persisted visual trees; alias visual-trees.
session artifacts <session-id>Read artifact snapshots.
session annotations <session-id>Read user and agent annotations.
session analyses <session-id>Read saved analyses.

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

OptionApplies toMeaning
--app-id <id>session listReturn sessions for one application ID.
--connectedsession listReturn only currently connected sessions.
--platform <key>session listRequire ios, android, macos, windows, or other. Repeat the flag to accept multiple platforms.
--device-form-factor <value>session listRequire an exact device form factor. Repeat the flag for multiple values; --form-factor is an alias.
--os-name <value>session listRequire an exact operating-system name. Repeat the flag for multiple values.
--os-version <value>session listRequire an exact operating-system version. Repeat the flag for multiple values.
--device-type <value>session listRequire an exact device type. Repeat the flag for multiple values.
--physicalsession listRequire a physical device.
--virtualsession listRequire a virtual target.
--emulatorsession listRequire an emulator. --simulator is accepted as an equivalent filter.
--tag <tag>session listRequire a session tag. Repeat the flag to require multiple tags.
--from <utc>session listKeep sessions whose capture interval ends at or after this ISO-8601 timestamp.
--to <utc>session listKeep sessions whose capture interval starts at or before this ISO-8601 timestamp.
--has-logssession listRequire retained log evidence.
--has-telemetrysession listRequire retained telemetry evidence.
--search <text>session listSearch session identity, app, device, OS, and tags. --contains is an alias.
--limit <count>session listReturn a page of 1–1000 session summaries. The default is 20.
--cursor <cursor>session listContinue after the opaque nextCursor returned by a previous JSON page. Keep the same filters between pages.
--limit <count>session logsReturn the newest 1–10000 matching logs. The default is 200.
--contains <text>session logsKeep logs whose message contains this text, ignoring case. --query is an alias.
--stream <id>session logsKeep logs from this exact stream. Repeat the flag for multiple streams.
--tag <tag>session logsKeep logs with this exact tag. Repeat the flag for multiple tags.
--source <source>session logsKeep logs from this exact source. Repeat the flag for multiple sources.
--start <utc>session logsSet the inclusive beginning of the ISO-8601 timestamp range.
--end <utc>session logsSet the inclusive end of the ISO-8601 timestamp range.
--priority <level>session logsKeep an exact log priority.
--minimum-priority <level>session logsKeep this priority and higher, using verbose, debug, information, warning, error, or fatal. --minimum-severity and --severity are aliases.
--id <request-id>session networkKeep one exact request identifier.
--method <method>session networkKeep an exact HTTP method. Repeat the flag for multiple methods.
--status <code|class>session networkKeep an exact status, a 2xx–5xx class, or failed/error requests. Repeatable.
--host <host>session networkKeep requests whose hostname contains this value.
--start <utc>session networkSet the inclusive beginning of the request start-time range.
--end <utc>session networkSet the inclusive end of the request start-time range.
--contains <text>session networkSearch URL, method, and error message. --query is an alias.
--failedsession networkKeep transport errors and HTTP 4xx/5xx responses.
--bodiessession networkInclude captured request and response bodies in human-readable output. JSON output always retains the structured body fields returned by the command.
--limit <count>session networkReturn the newest 1–10000 matching requests. The default is 200.
--limit <count>session metricsReturn the newest 1–50000 samples. The default is 500.
--channel <id>session metricsKeep samples and channel metadata for numeric channel ID 0–255.
--limit <count>session images, touches, trees, artifacts, annotations, analysesReturn 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
OptionMeaning
--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

OptionMeaning
--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-detectionReturn exit code 11 when the selected detectors find any event.

Editing and evidence export

CommandPurpose
session extract <session-id>Create a separate session from an annotation interval or explicit timestamp range.
session trim <session-id>Remove a selected interval or keep only that interval in the existing session.
session normalize <session-id>Remove consecutive duplicate screenshots and consecutive duplicate visual trees within each tree type. Aliases are normalise and compact.
session annotation upsert <session-id>Add or update an annotation from JSON or individual fields. Aliases include add, create, and update.
session annotation delete <session-id> <annotation-id>Delete an annotation; alias remove.
session analysis delete <session-id> <analysis-id>Delete a saved analysis; alias remove.
session screenshot export <session-id>Export the selected or latest screenshot to a local file. Aliases include get, read, and download.
session artifact export <session-id>Export one artifact file from a selected or latest snapshot. Aliases include get, read, and download.

Editing and export options

OptionApplies toMeaning
--annotation <id>session extractUse the bounds of this annotation. It cannot be combined with --start or --end.
--start <utc>session extract, session trim, session annotation upsertSet the required inclusive start as an ISO-8601 timestamp when explicit bounds are used.
--end <utc>session extract, session trim, session annotation upsertSet the end timestamp. It is required for extraction and trimming and optional for annotations.
--name <name>session extractSet the extracted session name.
--mode <cut|keep>session trimRemove the selected interval or retain only that interval. remove/cut-selection and keep-only/keep-selection are accepted aliases.
--file <annotation.json>session annotation upsertRead the complete annotation from JSON instead of individual annotation flags.
--annotation-id <id>session annotation upsertSet the annotation ID. A new compact GUID is generated by default.
--label <label>session annotation upsertSet the required annotation label when --file is not used.
--notes <text>session annotation upsertSet optional annotation notes.
--source <source>session annotation upsertSet the annotation source. The default is cli.
--frame-id <id>session screenshot exportExport a specific frame. Without a frame or timestamp, the newest screenshot is exported.
--timestamp <utc>session screenshot exportExport the screenshot nearest this ISO-8601 timestamp.
--snapshot-id <id>session artifact exportSelect an artifact snapshot. Without it, the newest matching snapshot is used.
--path <artifact-path>session artifact exportSelect the required artifact path within the snapshot.
--output <path>session screenshot export, session artifact exportWrite the exported evidence to this required local path.
--forcesession screenshot export, session artifact exportReplace an existing output file. --overwrite is an alias.

Management and cache

CommandPurpose
session metadata <session-id>Set name, notes, tags, or pinned state.
session cache statusShow cache size, protected sessions, and candidates.
session cache planPreview retention and size-limit cleanup.
session cache prunePreview or perform cleanup.
session cache compactZIP inactive session folders that have reached the compaction threshold.
session disconnect <session-id>Disconnect a live SDK session.
session delete <session-id>Permanently remove local session data; alias remove.

Metadata options

OptionMeaning
--name <name>Set the session’s display name.
--notes <text>Set notes, replacing the current value.
--clear-notesRemove all notes.
--tag <tag>Replace the current tags with the supplied values. Repeat the flag for multiple tags.
--clear-tagsRemove every tag.
--pinProtect the session from cache cleanup. It cannot be combined with --unpin.
--unpinRemove cache-cleanup protection. It cannot be combined with --pin.

Cache options

OptionApplies toMeaning
--compaction-age-days <days>session cache compactCompact inactive sessions at least 1–365 days old. The default is 30.
--retention-days <days>session cache status, plan, pruneSelect sessions older than 1–365 days. The default is 90.
--max-cache <size>session cache status, plan, pruneSet 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, pruneAlias for --max-cache.
--applysession cache pruneDelete 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

CommandPurpose
session serve <session-id>Start a capability-protected loopback replay.
session serve stop <session-id>Stop a resident-host replay.
session share <session-id>Export and upload a team, authenticated, or public replay.
session summary <session-id>Start the portal-compatible AI summary preset for the newest cloud share of this local session. summarize and summarise are aliases.
session summary <session-id> --localSummarize local capture evidence using the existing brokered agent model and save the result with the local session. session summary-local is an alias.
session url <session-id>Resolve the newest existing cloud replay URL.
session export <session-id> <output.zip>Write a portable archive.
session sanitize <session-id> <output.zip>Write a sanitized archive without changing the local capture.
session import <archive.zip>Import a portable archive.

Replay options

OptionApplies toMeaning
--port <port>session serveBind the replay server to this port. The default, 0, selects an available port.
--opensession serveOpen the replay in the default browser after the server starts.

Cloud sharing options

OptionApplies toMeaning
--team-id <uuid>session share, session summary, session urlSelect an organisation by non-empty UUID.
--localsession summaryUse 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 --localSelect the brokered model’s reasoning mode; default: fast.
--model <id>session summary --localDiagnostic model override; cannot be combined with --reasoning.
--team-name <name>session shareSelect an organisation by name when an ID is not supplied.
--publicsession shareShorthand for public replay access. It cannot be combined with a non-public --access value.
--access <team|authenticated|public>session shareSet the replay access level. The default is team.
--include-native-logssession shareInclude native device logs in the upload. They are excluded by default.
--sanitizesession shareApply the built-in PII policy before uploading. Sharing is raw by default.
--no-sanitizesession shareExplicitly retain the raw-capture default. It cannot be combined with --sanitize, --sanitizer, or --policy.
--sanitizer <module.ts>session shareApply named sanitization functions from this local TypeScript module instead of the built-in policy.
--policy <module.ts>session shareAlias for --sanitizer.
--include-archivedsession urlAllow 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

OptionApplies toMeaning
--exclude-native-logssession export, session sanitizeOmit native device logs from the archive.
--sanitizesession exportApply the built-in PII policy while exporting.
--sanitizer <module.ts>session export, session sanitizeRun named sanitization functions from this local TypeScript module. The file must end in .ts.
--policy <module.ts>session export, session sanitizeAlias for --sanitizer.
--password-env <NAME>session importRead 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.

CommandPurpose
cloud team listList 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-junitImport 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 listList 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

OptionApplies toMeaning
--search <text>cloud team list, cloud app-graph list, cloud session listSearch organisation, App Graph, or session results.
--team-id <uuid>Cloud app, App Graph, Trends, test, key, and session commandsSelect or restrict the organisation. ANSIGHT_TEAM_ID supplies the headless default.
--include-archivedcloud session listInclude archived sessions.
--limit <count>cloud session listReturn from 1 to 1000 sessions. The default is 200.
--limit <count>cloud trends upload|sync, cloud test syncLimit the local history records considered for upload.
--metric <key>cloud trends upload|syncUpload one trends-id.metric-id key.
--decision <id>cloud trends upload|syncUpload one historical comparison decision.
--span-group <name>cloud trends upload|syncUpload one grouped observation-span series.
--name <name>cloud app registerSet the portal display name; the App ID is used by default.
--platform <name>cloud app registerAdd optional platform context.
--app-id <id>Cloud test imports/uploads and runner-key issueSupply the registered App ID. ANSIGHT_APP_ID supplies the headless default.
--format <junit|appium-junit>cloud test importSelect the XML dialect. The default is junit.
--app-version <value>Cloud test uploadsAdd the tested app version.
--branch <name>, --commit <sha>Cloud test uploadsAdd source-control context without uploading source or prompts.
--workspace <path>cloud test syncRestrict local execution history to one workspace.
--run-id <id>cloud test importSet a stable CI execution prefix. Otherwise the JUnit file digest is used.
--session-id <id>cloud test importLink imported results to the newest uploaded Ansight session with this source ID.
--scope <scope>cloud key issueGrant 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 issueSet the key name. The default is CI runner.
--expires-at <timestamp>cloud key issueSet an optional future ISO-8601 expiry.
--output <path>cloud session downloadSet the archive destination. The default is ansight-cloud-<session-id>.zip in the current directory.
--output <path>cloud attachment downloadSet the required local attachment destination.
--name <name>cloud attachment uploadSet the attachment name. The local filename is used by default.
--notes <text>cloud attachment uploadAdd attachment notes.
--forceCloud downloadsReplace 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

OptionMeaning
--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

CommandPurpose
licenses listShow bundled and optional external software attribution.
licenses export <output.md|output.json>Export Markdown or versioned JSON.
OptionApplies toMeaning
--format <markdown|json>licenses exportOverride the format inferred from the .md, .markdown, or .json output extension.
--forcelicenses exportReplace an existing output file.

Exit codes

CodeMeaning
0Success.
1General failure.
2Invalid command usage.
3Configuration is invalid or incomplete.
4Required Ansight host or app session is unavailable.
5Target capability is unavailable.
6A cloud operation lacks authentication or cloud permission, or cloud access cannot be verified.
10A test or required assertion failed.
11Telemetry findings were detected with --fail-on-detection.
130Operation cancelled.