For AI agents: the complete documentation index is available at /next/llms.txt, the full documentation bundle is available at /next/llms-full.txt, and this page is available as Markdown at /next/ai/agent-lynx/cli-reference.md.
AI logo
AI
  • English
  • CLI Reference

    This section documents the public functionality in agent-lynx@0.14.23. Start with Getting Started for installation and device setup, or browse the function guides. The programmatic APIs have their own reference. Use agent-lynx <command> --help for the complete options supported by your installed version.

    Command Inventory

    The public CLI provides the following 46 executable commands, counting subcommands individually. agent-lynx --version, agent-lynx --help, and agent-lynx help <command> provide version and help information.

    CapabilityCommands
    Read bundled skillsagent-lynx skills list, agent-lynx skills get
    Discover apps and pagesagent-lynx list-clients, agent-lynx wait-for-client, agent-lynx list-sessions, agent-lynx open
    Capture the element treeagent-lynx snapshot
    Interact and waitagent-lynx tap, agent-lynx long-press, agent-lynx fill, agent-lynx clear, agent-lynx scroll, agent-lynx wait
    Read elements and locate sourceagent-lynx get text, agent-lynx get style, agent-lynx get-source-info
    Capture screenshotsagent-lynx screenshot, agent-lynx take-screenshot, agent-lynx take-content-screenshot
    Inspect logs, scripts, and the graphical inspectoragent-lynx get-console, agent-lynx get-sources, agent-lynx inspect
    Evaluate code and send protocol requestsagent-lynx evaluate, agent-lynx cdp, agent-lynx app
    Inspect, find, link, and edit ReactLynx componentsagent-lynx reactlynx tree, agent-lynx reactlynx component, agent-lynx reactlynx find, agent-lynx reactlynx link, agent-lynx reactlynx update-prop, agent-lynx reactlynx update-state, agent-lynx reactlynx update-context
    Manage global switchesagent-lynx global-switch list, agent-lynx global-switch get, agent-lynx global-switch set
    Capture a JS heapagent-lynx take-heap-snapshot
    Record and analyze performance tracesagent-lynx trace start, agent-lynx trace end, agent-lynx trace read-data, agent-lynx trace event-summary, agent-lynx trace query
    Record page runtime state for replayagent-lynx recorder start, agent-lynx recorder end
    Manage the shared local connectionagent-lynx daemon status, agent-lynx daemon start, agent-lynx daemon stop

    Connection Options

    OperationOptions and behavior
    Select an app and pagePass the returned --client <clientId> and --session <sessionId> to commands that declare them. Discover IDs again after app restarts or page navigation.
    Wait for an appwait-for-client --client-name <name> --timeout 30 waits for an app connection. Timeout and polling intervals use seconds; page-level wait uses milliseconds.
    Open a pageopen <bundle-url> --client <clientId> uses a URL reachable by the app. Run the development server separately, then discover sessions and refresh the snapshot after navigation.
    Manage the daemondaemon status reads version and protocol information without starting the daemon. daemon start and daemon stop control its lifecycle. These commands accept --port; the default is 21783.
    Use direct transportsStop the daemon before using --no-daemon to connect directly to the same target. Direct mode supports Android, iOS, Desktop, and HDT. Snapshot refs and their actions, wait, screenshot, and ReactLynx commands require the default daemon mode.

    Page Inspection and Interaction Options

    Page Inspection and Interaction demonstrates the complete snapshot, action, and verification workflow. These commands share the selected page's snapshot refs through the default daemon.

    OperationOptions and behavior
    Capture a snapshotsnapshot reads the element tree, including offscreen nodes; --visible-only keeps only currently visible elements. Use refs from a new snapshot after the page changes.
    Read text and stylesget text <ref> reads element text. get style <ref> --property color,width selects computed styles using comma-separated property names.
    Tap and long-presstap <ref> taps an element; long-press <ref> --duration 800 sets the hold duration in milliseconds.
    Fill and clearfill <ref> "Alice" replaces an editable field's contents; clear <ref> empties it.
    Scrollscroll <ref> --direction down acts on a scroll container. Directions are up, down, left, and right.
    Refresh after an actionRef actions accept --snapshot to refresh the daemon's cached refs. Text output reports the refresh result; adding --json includes the new snapshot in the result. Read and use targets from the new snapshot before continuing.
    Wait for a page conditionwait --text "Ready" --timeout 15000 waits for matching text; wait --ref <ref> waits for a ref to resolve in a fresh snapshot. Waiting refreshes and caches snapshots. Both --timeout and --interval use milliseconds; app-level wait-for-client uses seconds.

    Logs and Runtime Debugging Options

    Logs and Runtime Debugging demonstrates how logs, loaded scripts, and runtime values can explain a page failure.

    OperationOptions and behavior
    Filter console logsget-console supports --level, --thread, --offset, and --limit. Levels are comma-separated, such as error,warning; threads are background and main, with both included by default.
    Follow logs and retain stacksget-console --watch streams messages until interrupted or --limit is reached. --include-stack-traces includes available stacks for non-error messages in formatted output. --json preserves available stacks; combined with --watch, it emits one JSON event per line.
    Locate scripts and UI sourceget-sources lists background VM script IDs and URLs. get-source-info <target> accepts an element node ID or a snapshot ref such as @e1; source mapping requires UI source-map metadata.
    Open the inspectorinspect prints the selected client/session's inspector URL. --port selects the daemon port, defaulting to 21783.
    Evaluate JavaScriptevaluate <expression> selects --thread background (the default) or --thread main. It supports --await-promise, --context-id, --throw-on-side-effect, and --no-return-by-value for remote-object results. See evaluate --help for all evaluation options.
    Send CDP requestscdp --method <method> '<json-params>' sends a method and optional JSON parameters to the selected session. --thread defaults to background; script and object IDs must belong to the selected VM.
    Send App requestsapp --client <clientId> --method <method> '<json-params>' addresses the host app rather than a page session. Methods and parameters depend on the host application.

    Output, Help, and Environment

    Use --client and --session on commands that declare them to select the target explicitly. Use --json where supported to request structured output. The global JSON preference is forwarded only to commands with a JSON mode.

    Environment variablePurpose
    AGENT_LYNX_FORCE_JSONSet to 1 or true to enable supported JSON output modes.
    AGENT_LYNX_DISABLE_UPDATE_NOTICESet to 1 to disable npm update notices.
    AGENT_LYNX_INVOKED_ASSet the user-facing invocation name in a process host.
    AGENT_LYNX_CLI_PLACEHOLDERFallback invocation name for help and recovery hints.
    ADB_SERVER_SOCKETDirect-mode (--no-daemon) Android ADB socket. Takes precedence over the address and port. Accepts tcp:host:port, tcp:port, and localfilesystem:/path.
    ANDROID_ADB_SERVER_ADDRESS, ANDROID_ADB_SERVER_PORTDirect-mode (--no-daemon) Android ADB server host and port. Defaults are 127.0.0.1 and 5037. Daemon mode ignores them and warns on stderr.
    DEBUGEnable diagnostic logging namespaces on stderr.
    Except as otherwise noted, this work is licensed under a Creative Commons Attribution 4.0 International License, and code samples are licensed under the Apache License 2.0.