{
  "markdown": "# driftx\n\nYour AI agent can code. Now it can use your app.\n\ndriftx gives coding agents eyes and hands inside apps running on iOS simulators and Android emulators.\n\n<p>\n  <a href=\"https://www.npmjs.com/package/driftx\"><img src=\"https://img.shields.io/npm/v/driftx?style=flat-square&color=e8a23e&label=npm\" alt=\"npm version\" /></a>\n  &nbsp;\n  <a href=\"https://github.com/nomanr/driftx/blob/main/LICENSE\"><img src=\"https://img.shields.io/npm/l/driftx?style=flat-square&color=c49344\" alt=\"license\" /></a>\n  &nbsp;\n  <a href=\"https://www.npmjs.com/package/driftx\"><img src=\"https://img.shields.io/npm/dm/driftx?style=flat-square&color=b8860b\" alt=\"downloads\" /></a>\n  &nbsp;\n  <img src=\"https://img.shields.io/badge/iOS%20%7C%20Android-e8a23e?style=flat-square&label=platform\" alt=\"platform\" />\n</p>\n\n### Watch an AI agent inspect, interact with, and verify a live app\n\nhttps://github.com/user-attachments/assets/9d757aa6-ac70-4eae-bbf4-49df70ff345a\n\nFix UI bugs faster, compare screens to designs, and validate real app flows visually.\n\n## What you can do\n\nAsk your agent things like:\n\n- **\"Make this screen match the Figma\"** - compare a design mockup against the running app, then fix the differences\n- **\"The login button is cut off, why?\"** - agent sees the issue, inspects the component tree, and fixes the layout\n- **\"What components are on this screen?\"** - inspect the full hierarchy with testIDs, bounds, and props\n- **\"Run an accessibility check on this screen\"** - audit for contrast, labels, and touch target sizes\n- **\"Walk through the onboarding flow and screenshot each step\"** - navigate, interact, and capture along the way\n- **\"Compare this against yesterday's build\"** - detect visual regressions between builds\n\n### See it in action\n\nhttps://github.com/user-attachments/assets/c99076cc-83fc-4c23-b215-0d1b3912f991\n\n## Quick Start\n\n### 1. Setup\n\n```bash\nnpx -y driftx@latest init\n```\n\nCreates project config and auto-registers with detected AI tools (Claude Code, Cursor). Restart your AI tool after.\n\n### 2. Connect your agent\n\n<details open>\n<summary><strong>Claude Code</strong></summary>\n\nHandled automatically by `npx -y driftx@latest init`. Just restart Claude Code.\n\n**Fallback** - if auto-detection doesn't work:\n\n```bash\nnpx driftx setup-claude\n```\n\nVerify with `npx driftx doctor`, then restart Claude Code.\n\n</details>\n\n<details>\n<summary><strong>Cursor</strong></summary>\n\nTell Cursor:\n\n```\nFetch and follow instructions from https://raw.githubusercontent.com/nomanr/driftx/main/.cursor/INSTALL.md\n```\n\nVerify with `driftx doctor`, then close and restart the chat.\n\n</details>\n\n<details>\n<summary><strong>Gemini CLI</strong></summary>\n\nTell Gemini:\n\n```\nFetch and follow instructions from https://raw.githubusercontent.com/nomanr/driftx/main/.gemini/INSTALL.md\n```\n\nVerify with `driftx doctor`, then close and restart the chat.\n\n</details>\n\n<details>\n<summary><strong>Codex</strong></summary>\n\nTell Codex:\n\n```\nFetch and follow instructions from https://raw.githubusercontent.com/nomanr/driftx/main/.codex/INSTALL.md\n```\n\nVerify with `driftx doctor`, then close and restart the chat.\n\n</details>\n\n<details>\n<summary><strong>Other agents</strong></summary>\n\nAny agent that runs shell commands can use driftx. Add this to your agent's system prompt:\n\n```\nYou have access to `driftx` for seeing and interacting with mobile apps:\n- npx driftx capture -o screenshot.png                    # capture a screenshot\n- npx driftx inspect --json                               # get the component tree\n- npx driftx tap \"Button Text\"                            # tap by text, testID, or name\n- npx driftx type input-id \"text\"                         # type into a field\n- npx driftx swipe up                                     # swipe gestures\n- npx driftx compare --design design.png --format json    # compare against a design\nAlways capture a screenshot after interactions to verify the result.\n```\n\n</details>\n\n### 3. Verify\n\nAsk your AI agent:\n\n```\nWhat do you know about driftx?\n```\n\nIf it describes driftx and its capabilities, you're all set. You can also run `npx driftx doctor` to check that Metro, adb, xcrun, and your simulators are ready.\n\n## Commands\n\n```bash\n# See: capture screenshots and inspect the component tree\nnpx driftx capture -o screenshot.png\nnpx driftx inspect --json\n\n# Interact: tap, type, swipe, navigate\nnpx driftx tap \"Login\"                        # by text\nnpx driftx tap login-btn                      # by testID\nnpx driftx tap 150,300 --xy                   # by coordinates\nnpx driftx type email-input \"user@test.com\"\nnpx driftx swipe up\nnpx driftx swipe down --distance 200\nnpx driftx go-back\nnpx driftx open-url \"myapp://profile/123\"\n\n# Compare: diff against designs, audit accessibility, detect regressions\nnpx driftx compare --design mockup.png --format json\nnpx driftx compare --design mockup.png --with a11y --format json\nnpx driftx compare --baseline --format json\n\n# Utilities\nnpx driftx devices\nnpx driftx doctor\nnpx driftx clean\n```\n\n## Flags\n\n| Flag | Description |\n|------|-------------|\n| `-d, --device <id>` | Device ID or name (picker shown if multiple) |\n| `--bundle-id <id>` | iOS bundle identifier (auto-detected from Metro) |\n| `--verbose` | Debug logging |\n| `--format <type>` | `terminal`, `markdown`, or `json` |\n| `--copy` | Copy output to clipboard |\n\n## Requirements\n\n- **Metro bundler** running (`npx react-native start`)\n- **Android**: `adb` available, emulator booted\n- **iOS**: `xcrun simctl` available, simulator booted\n\n## How It Works\n\n**Tap resolution** uses a 4-tier fallback: CDP fiber tree → XCUITest companion hierarchy → accessibility element query → fiber measurement via `measureInWindow()`.\n\n**iOS companion** is a pre-built XCUITest server that auto-launches on the simulator. Ships in the npm package, no Xcode build step required.\n\n**Visual analysis** compares screenshots pixel-by-pixel against design images, runs accessibility checks, and detects layout regressions between builds.\n\n## Platform Support\n\n| Platform | Emulator/Simulator | Physical Device |\n|----------|-------------------|-----------------|\n| Android  | Supported         | Not yet         |\n| iOS      | Supported         | Not yet         |\n\n## Configuration\n\n```bash\nnpx -y driftx@latest init\n```\n\nCreates `.driftxrc.json`:\n\n```json\n{\n  \"platform\": \"react-native\",\n  \"metroPort\": 8081,\n  \"threshold\": 0.1,\n  \"diffThreshold\": 5\n}\n```\n\n## Development\n\n```bash\nnpm install\nnpm run dev          # watch mode\nnpm test             # run tests\nnpm run build:ios    # rebuild iOS companion\n```\n\n## License\n\n[MIT](LICENSE)\n",
  "bytes": 6583,
  "sha": "d9f346ad62fe7dde21403889bfef14ac4807d697aa9d3658f4d46a386691e8c2",
  "repo_slug": "nomanr/driftx",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_nomanr_driftx_744612c3/readme"
}