Tondavo

CLI reference

This page lists every tondavo command, flag, key and environment variable in version 0.1.5, and the files Tondavo keeps in your project. It is for anyone who runs Tondavo from a terminal or wants to know exactly what an agent's tools do. The agent tools are on MCP tools reference.

Synopsis

tondavo [port] [flags]              start a session (the main command)
tondavo status                      connected phones and session info
tondavo logs [--type X] [--limit N] [--json]
tondavo eval "<js>" [--timeout ms]
tondavo dom "[selector]"
tondavo screen
tondavo shot
tondavo tap <target>
tondavo longpress <target> [--ms 700]
tondavo swipe <from> <to>
tondavo type <target> "<text>"
tondavo keys <target> "<text>"
tondavo paste <target> "<text>"
tondavo drop <target> <file>
tondavo attach <target> <file>
tondavo pinch <target> [--scale 2]
tondavo sim <what> [arg]
tondavo wait <type|any> [--text X] [--timeout ms]
tondavo reload
tondavo mcp
tondavo help

Run it with npx tondavo, or as tondavo if you installed the package globally. It needs Node.js 22 or later. It is tested on macOS only.

Flags take a value either as --timeout 30000 or --timeout=30000.

Start a session: tondavo [port]

tondavo [port] [--edge <url>] [--new] [--lan] [--bridge <port>]
               [--no-watch] [--capture]

Run this in your project folder while your dev server is running. It does the following:

  1. Picks the port of your dev server. If you don't give one, it tries these ports on localhost in order and takes the first that answers: 5173, 3000, 5174, 4321, 8080, 8000, 8888 and 4000. If several answer, it prints the others. If none answers, it uses 5173 and waits for a server to appear there.
  2. Starts a local proxy (the bridge) in front of your dev server and connects it to https://dev.tondavo.com, so the phone gets a real HTTPS page. HTTPS matters because the camera, microphone and WebCrypto only work in a secure context.
  3. Prints a QR code. Scan it with the phone's camera to pair the phone and open your app.
  4. Watches your project folder and reloads the phone when you save a file.
  5. Records everything the phone reports in .tondavo/live.jsonl and prints it in the terminal.

Only the paired phone can open the page. Anyone else gets a 403.

Example

$ npx tondavo 5173

  tondavo → proxying localhost:5173 (online)
  Phone URL:   https://dev.tondavo.com (private to your paired phone)
  Agent log:   .tondavo/live.jsonl
  Agent probe: npx tondavo eval "document.title"  |  npx tondavo dom "button"

  Point your phone's camera at the QR code.
  Pairing is open for 10 min (free: one phone per session; --new for another). Keys: [c] reopen pairing · [r] reload phone · [q] quit

✓ HTTPS edge live: https://dev.tondavo.com (only your paired phone can open it)

18:14:05 ● Phone connected (390×664, secure=true, standalone=false)

If the dev server isn't up yet, the first line ends in (waiting for server…) and the phone shows "Waiting for localhost:5173…" until it is. Times in the terminal are UTC.

Flags

FlagDefaultWhat it does
[port]auto-detectedThe port your dev server listens on, on localhost.
--newoffStarts a fresh session with a new pairing link, so you can pair a different phone. Without it, Tondavo reuses the session from the last 8 hours in this folder and an already paired phone reconnects on its own.
--captureoffReal screenshots. The phone's first tap after each page load asks to start screen sharing; once it runs, shot returns a real frame of the whole screen, including the keyboard and browser bars. A reload ends the capture, so the next tap starts it again.
--no-watchwatch onDon't reload the phone when a file changes.
--lanoffSkip the edge and serve plain http:// on your Wi-Fi address. What changes, and when to use it: How it works.
--bridge <port>8788The local port of the bridge. If it is taken, or equals the app's port, Tondavo picks a free one.
--edge <url>https://dev.tondavo.comUse another edge. Advanced: you only need it if you run your own. Overrides TONDAVO_EDGE.
--help, -hPrint the help text and exit.

Sessions and changes to responses

Your files don't change. HTML pages get one script tag on the way to the phone, and a few headers change: How it works lists them.

No account is needed. Restarting Tondavo in the same folder within 8 hours keeps the session, and the paired phone reconnects without scanning. The free tier's limits are on Pricing. Messages the CLI prints while it runs, such as can't reach https://dev.tondavo.com, are explained in Troubleshooting.

Keys while it runs

These work when Tondavo runs in an interactive terminal. Upper case works too.

KeyWhat it does
cOpens pairing again for 10 minutes (or TONDAVO_PAIR_SECONDS). Scan the QR code again to pair. Does nothing with --lan.
rReloads every connected phone.
q or Ctrl+CQuits and deletes .tondavo/session.json. The session itself stays valid, so a restart within 8 hours reuses it.

Commands

Every command except mcp and help talks to a running session. Run it in the folder where tondavo runs, in a second terminal. Otherwise it fails with:

tondavo error: No active tondavo session in /path/to/folder (run `npx tondavo` first)

Commands that act on the page go to one phone: the most recently connected tab that is visible. If no phone answers, the command prints the reason, such as No phone is connected, and exits with 1. Troubleshooting lists each reason and its fix.

Targets

Commands that act on an element take a target. It is either a CSS selector, such as "#send" or "form button", or a point written x,y in CSS pixels from the top-left of the visible screen, such as 120,340. A selector picks the first match and scrolls it to the centre of the screen first. The event then goes to whatever is on top at that point, as a real finger's would: if an invisible overlay covers the button, the overlay gets it.

Scripted events are not real touches. iOS opens the keyboard, starts audio, answers permission prompts and starts screen capture only for a real finger.

npx tondavo link

Prints the pairing link as text: the same link as the QR code. Use it when nobody can see the terminal, for example when a coding agent runs Tondavo in the background or in a cloud sandbox and shows you the link in chat. Open it on your phone. Anyone who opens it before your phone pairs gets the session, so share it only with yourself.

--version

npx tondavo --version

Prints the version and exits, without starting a session. -v and tondavo version do the same.

status

tondavo status

Prints the session as JSON: the app's port, how many phones are connected, each phone's model and browser, whether its tab is visible, how many seconds ago it was last heard, and its page.

{
  "ok": true,
  "targetPort": 5173,
  "connectedDevices": 1,
  "devices": [
    {
      "device": "iPhone (Safari)",
      "id": "k3f9qa",
      "visible": true,
      "lastSeenSecondsAgo": 2,
      "page": "/"
    }
  ],
  "eventCount": 37,
  "liveLogPath": "/Users/you/my-app/.tondavo/live.jsonl"
}

logs

tondavo logs [--type <type>] [--limit <n>] [--json]

Prints recent events from the phone, oldest first, one JSON object per line. Every event has ts (UTC), type, url and the viewport size.

FlagWhat it does
--type <type>Only events of this type.
--limit <n>How many, from the newest. Default 50.
--jsonPrint one JSON array instead of one object per line.

Event types:

TypeWhen
helloA page loaded and connected. Includes the user agent and whether it is a secure context.
js_errorAn uncaught error, with source, line, column and stack.
promise_errorAn unhandled promise rejection.
asset_errorA script, image or stylesheet failed to load (404 or CORS).
consoleconsole.log, info, warn or error.
net_errorA fetch failed or returned 400 or higher. XMLHttpRequest isn't tracked.
net_stallA fetch had no answer after 3.5 seconds.
dead_tapA tap did nothing: another element on top caught it, or touchstart called preventDefault() and blocked the click.
layout_bleedThe page is wider than the screen, with the element that sticks out furthest.
viewportThe visible area changed size, for example when the keyboard opened.
audio_ctxAn AudioContext was created or changed state, and whether its sample rate differs from the one asked for.
media_ok, media_deniedgetUserMedia succeeded or failed.
user_pointThe person flagged an element: a three-finger tap on the phone, then a tap on the element and a note.
tap, focus, scroll, nav, visibilityWhat the person does: taps, focusing a field, scrolling, changing page, leaving or returning to the tab. Typed text is never recorded.
captureScreen capture started, ended or was refused (with --capture).

logs reads the events the running session holds, up to the latest 5,000.

eval

tondavo eval "<js>" [--timeout <ms>]

Runs JavaScript in the page on the phone and prints the result. The code can be an expression or statements with return, and it can use await. Strings print as they are; anything else prints as JSON. Default timeout 5000 ms. Raise it for code that waits, such as recording audio.

$ npx tondavo eval "typeof Notification"
undefined
$ npx tondavo eval "const r = await fetch('/api/me'); return r.status"
401

If the code throws, the error and its stack go to stderr and the exit code is 1.

dom

tondavo dom "[selector]"

Inspects an element on the phone. Prints JSON: how many elements match, and for the first one its selector path, position and size, whether it is visible, a few computed styles (display, position, overflow, z-index, opacity, pointer-events), its text and the start of its HTML. Without a selector it inspects body.

screen

tondavo screen

Prints what is visible on the phone's screen right now as text: one line per element with its position, size and text, top to bottom. Tappable elements are in brackets. An element with something else on top at its centre says so. Password, card and one-time-code fields show [hidden value]. Up to 200 elements are listed.

https://dev.tondavo.com/  visible 390x664 (page viewport 390x664)  scroll 0/412  zoom 1.00  focus none
   y    x  size  element  text   ([brackets] = tappable; y/x are from the top-left of the visible area)
  16   16 358x34  h1  Meetups near you
  62   16 358x20  p.status  Loading…
 610   16 358x44  [button#retry]  Try again

shot

tondavo shot

Saves a screenshot of the phone as a JPEG in .tondavo/shots/ and prints its path, kind, size and page.

/Users/you/my-app/.tondavo/shots/2026-12-02T18-20-11-482Z-snapshot.jpg
snapshot 1170x1992 https://dev.tondavo.com/
(page only: no keyboard or browser bars; start tondavo with --capture for real frames)

There are two kinds:

  • live: a real frame of the whole screen. Needs --capture and one real tap on the phone after each page load.
  • snapshot: the page drawn by the phone's own browser. It needs no tap, but shows only the page (no keyboard or browser bars), and web fonts fall back to system fonts.

To keep each image under about 480 KB, Tondavo lowers the JPEG quality and, if that isn't enough, halves the size. Timeout 20 seconds.

tap

tondavo tap <target>

Taps like a finger: pointer and touch events, then a click, on whatever is on top at that point. Prints what was hit.

$ npx tondavo tap "#retry"
{"did":"tap","at":[195,632],"hit":"button#retry"}

longpress

tondavo longpress <target> [--ms 700]

Presses and holds, then releases. --ms sets how long to hold, default 700.

swipe

tondavo swipe <from> <to>

Swipes from one target to another in 8 steps. Both ends can be selectors or x,y points. The events go to the element under the starting point.

type

tondavo type <target> "<text>"

Sets the field's value to the text and fires input and change. It works with React and other frameworks that track input values. It replaces what was there and fires no key events; use keys when the app listens for keys.

keys

tondavo keys <target> "<text>"

Types character by character, with keydown, beforeinput, input and keyup for each, appending to the current value. Write \n to press Enter. Tested only in headless desktop Chrome, not on a real iPhone.

paste

tondavo paste <target> "<text>"

Fires a paste event carrying the text as clipboard data. It doesn't change the field itself; your app's paste handler does. Tested only in headless desktop Chrome, not on a real iPhone.

drop

tondavo drop <target> <file>

Drags a file from your computer onto an element: dragenter, dragover and drop. Tested only in headless desktop Chrome, not on a real iPhone.

attach

tondavo attach <target> <file>

Puts a file from your computer into an <input type=file> and fires input and change. Tested only in headless desktop Chrome, not on a real iPhone.

For drop and attach, the file type comes from the extension (.png, .jpg, .gif, .pdf, .txt, .json, .csv); anything else is sent as application/octet-stream. Since 0.1.1, files up to about 24 MB work; 0.1.0 failed above about 750 KB.

pinch

tondavo pinch <target> [--scale 2]

A two-finger pinch centred on the target: touch events plus Safari's gesture events. A scale above 1 spreads the fingers, below 1 brings them together. Default 2. Tested only in headless desktop Chrome, not on a real iPhone.

sim

tondavo sim <what> [arg]

Changes what the page sees of the phone's environment, so you can test how the app handles it. Everything is undone by sim reset or a reload.

WhatEffect
offlinenavigator.onLine becomes false, an offline event fires, and every fetch fails.
onlineUndoes offline and slow, and fires online.
slow <ms>Delays every fetch by this many milliseconds. Default 3000.
hidden, visibleThe page sees itself go to the background or come back (document.hidden and visibilitychange).
location <lat,lon>Geolocation returns this position.
deny [camera|mic]getUserMedia fails with NotAllowedError, for the camera, the mic, or both if you name neither.
camera ['{"text":"…"}']The camera delivers a generated video with this text. Also takes color.
mic ['{"hz":1000}']The microphone delivers a tone at this frequency. Also takes gain.
resetUndoes all of the above.

hidden and visible are tested on a real iPhone. The others are tested only in headless desktop Chrome.

wait

tondavo wait <type|any> [--text <text>] [--timeout <ms>]

Waits for the next event of a type (see logs), or any, and prints it as JSON. --text keeps only an event containing that text anywhere. Only events that arrive after the command starts count. Default timeout 15000 ms; on timeout it exits with 1:

$ npx tondavo wait hello --timeout 20000
{"ts":"2026-12-02T18:21:03.114Z","deviceId":"k3f9qa","type":"hello","url":"/","vw":390,"vh":664,"ua":"Mozilla/5.0 (iPhone; …","secureContext":true,…}

$ npx tondavo wait js_error --timeout 5000
No js_error event from the phone within 5s

Use it after a fix: save, then wait hello to know the phone has reloaded.

reload

tondavo reload

Reloads every connected phone and prints how many. The scroll position is kept across the reload.

Reloaded 1 connected device(s).

mcp

tondavo mcp

Runs Tondavo as an MCP server (the way Claude Code and other agents get new tools) over standard input and output. It can start before the session does. See MCP tools reference for the tools and Agents for setup.

help

tondavo help
tondavo --help

Prints the help text.

Environment variables

VariableForWhat it does
TONDAVO_DIRNormal use, MCP onlyThe project folder that tondavo mcp uses to find the session. Set it when your agent starts in a different folder from the one where tondavo runs. The other commands ignore it and always use the current folder.
TONDAVO_KEYAdvancedUsed by the maintainer for testing; not needed.
TONDAVO_EDGEAdvancedThe edge URL, if you run your own. --edge overrides it.
TONDAVO_PAIR_SECONDSAdvancedHow long pairing stays open after start and after c, in seconds. It can only shorten the window: values above 600 are treated as 600, and an empty or non-numeric value means 600.

Exit codes

CodeMeaning
0The command succeeded, or the session was quit with q, Ctrl+C or SIGTERM.
1Anything failed: no session in this folder, wrong usage, no phone answered, the phone's code threw, wait timed out, or the session couldn't start. The reason goes to stderr.

If Tondavo crashed or was killed without a chance to clean up, .tondavo/session.json stays behind and commands fail with connect ECONNREFUSED 127.0.0.1:<port>. Start tondavo again.

The .tondavo folder

Tondavo keeps its state in .tondavo/ in the folder where you start it. Add it to .gitignore: it holds the session's secrets, and Tondavo doesn't add the entry for you.

echo ".tondavo/" >> .gitignore
FileWhat it is
session.jsonThe running session: the local bridge port, the app's port, the process ID, the token that controls the phone, the session secret and the pairing link. Written at start and deleted when you quit. Commands and the MCP server read it to find the session. Readable only by your user account (on macOS and Linux).
room.jsonThe session's ID and secret, so a restart within 8 hours keeps the same pairing link and the phone reconnects. Deleted by --new. Readable only by your user account (on macOS and Linux).
live.jsonlEvery event from the phone, one JSON object per line, also printed in the terminal. Emptied at each start, and trimmed to the latest 5,000 events as it grows. wait reads it, and so can your agent.
shots/Screenshots from shot, named by UTC time and kind, for example 2026-12-02T18-20-11-482Z-live.jpg. Never deleted automatically.

The phone can never load anything from .tondavo/, even if your dev server serves the project folder.

What is tested

Which commands are tested on a real iPhone, and which only in headless Chrome, is on Platform support.