Metadata-Version: 2.4
Name: autosana
Version: 0.5.1
Summary: Local testing infrastructure for Autosana — mobile and web
Project-URL: Homepage, https://autosana.ai
License: Proprietary
Requires-Python: >=3.9
Requires-Dist: filelock>=3.0
Requires-Dist: typer>=0.9.0
Description-Content-Type: text/markdown

# Autosana CLI

Connect local simulators, emulators, and dev servers to [Autosana](https://autosana.ai) to test locally.

## Install

```
pipx install autosana
```

Or with uv:

```
uv tool install autosana
```

## Quick Start

```bash
# Check prerequisites
autosana doctor

# Auto-install Node.js + Appium + cloudflared
autosana doctor --fix

# Start local session (iOS)
autosana up --platform ios

# Start local session (web — point to your dev server, http or https)
# The scheme (http vs https) is auto-detected. HTTPS dev servers like
# `next dev --experimental-https` and `vite --https` work out of the box.
autosana up --platform web --port 3000

# Multi-device — start sessions for all booted simulators
autosana up --platform ios --all-devices --detach --json

# Or start specific devices by name/UDID
autosana up --platform ios --device "iPhone 16 Pro" --detach --json
autosana up --platform ios --device "iPhone 17 Pro" --detach --json

# Check running sessions (includes device responsiveness checks)
autosana status

# Stop all sessions
autosana down --all
```

## Multi-Device Parallel Testing

Test across multiple simulators simultaneously:

1. Boot multiple iOS Simulators or Android Emulators
2. Run `autosana up --platform ios --all-devices --detach --json` to start sessions for all devices
3. Your coding agent dispatches flows to different devices in parallel via `device_tunnel_map`
4. All flows execute simultaneously — 3 devices = 3x faster

Works with both iOS and Android. Each device gets its own Appium server and Cloudflare tunnel.

## Device Health Checks

`autosana up` and `autosana status` verify that devices are actually responsive — not just listed by ADB/simctl:

- **Android**: runs `adb shell echo ok` with a 5s timeout to detect zombie emulators
- **iOS**: runs `xcrun simctl getenv` with a 5s timeout to detect frozen simulators
- **Web**: probes `http://127.0.0.1:<port>` and `https://127.0.0.1:<port>` in parallel (3 attempts with backoff, to cover dev servers still booting). The responding scheme is used for the Cloudflare tunnel origin, preferring https on tie. HTTPS origins skip TLS verification on loopback — self-signed certs from mkcert, `next dev --experimental-https`, and `vite --https` just work. Verification is intentionally disabled here because the cloudflared origin is `127.0.0.1` (no MITM surface); to lock cloudflared back into strict verification with a trusted CA, you'd run cloudflared yourself instead of via `autosana up`.

If a mobile device is unresponsive, `autosana up` fast-fails before wasting time on Appium/tunnel setup. `autosana status --json` reports `device_responsive: false` with an actionable issue message.

The detected scheme is reported in `autosana up --json` as `scheme: "http"` or `scheme: "https"`.

## Requirements

- **iOS**: macOS with one or more booted iOS Simulators
- **Android**: macOS, Linux, or Windows with one or more booted Android Emulators
- **Web**: a local dev server running on any OS
- An [Autosana](https://autosana.ai) account
