npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

agent-flutter-cli

v1.4.0

Published

CLI for AI agents to control Flutter apps via Marionette (Dart VM Service)

Downloads

164

Readme

agent-flutter

npm

CLI for AI agents to control Flutter apps via Dart VM Service + Marionette. Same @ref + snapshot workflow as agent-device and agent-browser.

Prerequisites

Your Flutter app needs Marionette

Add marionette_flutter to your Flutter app:

# pubspec.yaml
dev_dependencies:
  marionette_flutter: ^0.3.0

Initialize in your app's main.dart (debug mode only):

import 'package:marionette_flutter/marionette_flutter.dart';

void main() {
  assert(() {
    MarionetteBinding.ensureInitialized();
    return true;
  }());
  runApp(const MyApp());
}

Runtime requirements

  • Node.js 18+
  • ADB accessible (adb devices shows your target)
  • Flutter app running via flutter run (debug or profile mode — exposes Dart VM Service)

Note: adb install of a pre-built APK won't work — the Dart VM Service is only exposed when launched via flutter run.

Quick start

# Install
npm install -g agent-flutter-cli

# Verify prerequisites
agent-flutter doctor

# Connect to running Flutter app (auto-detects VM Service URI from logcat)
agent-flutter connect

# See all widgets with refs
agent-flutter snapshot -i

# Interact
agent-flutter press @e3
agent-flutter fill @e5 "hello world"

# Disconnect
agent-flutter disconnect

If you already have a VM Service URI:

agent-flutter connect ws://127.0.0.1:38047/abc=/ws

Command reference

| Command | Description | Example | |---|---|---| | connect [uri] | Connect to Flutter VM Service | agent-flutter connect | | disconnect | Disconnect from Flutter app | agent-flutter disconnect | | status | Show connection state | agent-flutter status | | snapshot [-i] [-c] [-d N] [--diff] | Capture widget snapshot with refs | agent-flutter snapshot -i | | press <ref> \| <x> <y> | Tap by ref, coordinates, or ref via ADB (--adb) | agent-flutter press @e3 | | fill <ref> <text> | Enter text by ref | agent-flutter fill @e5 "hello" | | get <property> <ref> | Read text, type, key, or attrs | agent-flutter get attrs @e3 | | find <locator> <value> [action] [arg] | Find by key, text, or type | agent-flutter find text "Submit" press | | wait <condition> [target] | Wait for exists, visible, text, gone, or delay ms | agent-flutter wait text "Welcome" | | is <condition> <ref> | Assert exists or visible | agent-flutter is exists @e3 | | scroll <target> | Scroll to ref or direction | agent-flutter scroll down | | swipe <direction> | ADB swipe gesture | agent-flutter swipe left | | back | Android back button (ADB) | agent-flutter back | | home | Android home button (ADB) | agent-flutter home | | screenshot [path] | Capture screenshot | agent-flutter screenshot /tmp/screen.png | | reload | Trigger Flutter hot reload | agent-flutter reload | | logs | Get Flutter app logs | agent-flutter logs | | schema [command] | Output command schema (JSON) | agent-flutter schema press | | doctor | Check prerequisites and diagnose issues | agent-flutter doctor |

Global flags

| Flag | Description | |---|---| | --device <id> | ADB device ID (default: emulator-5554) | | --json | Force JSON output | | --no-json | Force human-readable output | | --dry-run | Resolve target without executing | | --help | Show help (--help --json returns schema) |

Snapshot format

@e1 [button] "Submit"  key=submit_btn
@e2 [textfield] "Email"  key=email_input
@e3 [label] "Welcome back"
  • Refs are sequential per snapshot (@e1, @e2, ...) and reset on each snapshot call.
  • Re-run snapshot after UI-changing commands (press, fill, scroll, reload) — refs may shift.
  • snapshot --json returns objects with ref, type, label, key, visible, bounds.

Environment variables

| Variable | Purpose | Default | |---|---|---| | AGENT_FLUTTER_DEVICE | ADB device ID | emulator-5554 | | AGENT_FLUTTER_URI | VM Service URI for connect | auto-detect from logcat | | AGENT_FLUTTER_TIMEOUT | Default wait timeout (ms) | 10000 | | AGENT_FLUTTER_JSON | JSON output mode (1) | unset |

Precedence: CLI flag > env var > built-in default.

Exit codes

| Code | Meaning | |---|---| | 0 | Success | | 1 | Assertion false (is command only) | | 2 | Error |

Development

This repo is the publish target. Source of truth is beastoin/autoloop — all code changes go through autoloop's phase-gated build loop (program → implement → eval → keep/revert), then get copied here for npm publish.

Do not edit this repo directly. To make changes, add a new phase program in autoloop.

# For local testing only
git clone https://github.com/beastoin/agent-flutter.git
cd agent-flutter
npm install

# Typecheck
npm run typecheck

# Unit tests
npm run test:unit

# Build (bundle TypeScript to dist/)
npm run build

# Run locally
node dist/cli.mjs --help

Related tools

| Tool | Platform | Transport | |---|---|---| | agent-flutter | Flutter apps | Dart VM Service + Marionette | | autoloop | Native mobile (Android/iOS) + autoloop build system | daemon + platform runners | | agent-browser | Web apps | browser automation |

All three share the same snapshot → @ref → press/fill/wait/is workflow.

License

MIT