@mobai-app/cli
v2.1.1
Published
Command-line interface for MobAI — control Android and iOS devices via the MobAI HTTP API.
Maintainers
Readme
@mobai-app/cli
Command-line interface for MobAI — control Android and iOS devices over the MobAI HTTP API from your shell, scripts, or CI pipeline.
Install
# global
npm install -g @mobai-app/cli
# one-off
npx @mobai-app/cli devices list
# as a dev dependency for a test project
npm install -D @mobai-app/clinpm will install the meta package plus the one binary matching your platform (macOS arm64/x64, Linux x64/arm64, Windows x64). Other platforms are skipped automatically.
Requires
- A running MobAI desktop app on the same machine (or reachable via
--base-url). The CLI talks tohttp://127.0.0.1:8686by default. - Node.js 18+ (only for the install shim — the CLI itself is a native Go binary).
Quick start
mobai devices list
mobai tap "id:login_btn"
mobai type "[email protected]" --clear --into "id:email_field"
mobai observe --include ui_treeSee mobai --help for all commands, or mobai <command> --help for flags.
Global options
| Flag | Env | Default |
|------|-----|---------|
| --base-url | MOBAI_URL | http://127.0.0.1:8686 |
| --device, -d | MOBAI_DEVICE | auto-pick when one device is connected |
| --timeout | MOBAI_TIMEOUT | 30s (10m on run) |
| --json | — | structured output for scripts |
| --quiet, -q | — | suppress non-error output on success |
Exit codes
| Code | Meaning | |------|---------| | 0 | success | | 1 | generic error | | 2 | element not found / no match | | 3 | timeout | | 4 | bridge crashed / app not running | | 5 | user cancelled / safety blocked | | 6 | assertion failed | | 10 | API unreachable (is the MobAI app running?) | | 11 | device selection failed (multiple devices, none specified) |
License
MIT — see the LICENSE file in the package.
