Skip to main content

Record and automate browser workflows with AI. Chat-based CLI + API server powered by Gemini and browser-use.

Project description

⚡ AutoPattern

Record browser workflows, replay them with AI.

AutoPattern records your clicks, inputs and navigation in Chrome, then uses Google Gemini + browser-use to replay them autonomously. It ships as a single CLI command with a built-in API server for the companion Chrome extension.

PyPI Python License: MIT


Installation

pip install autopattern

Then install the browser driver (one-time):

playwright install chromium

Configuration

Set your Google Gemini API key (get one free):

export GOOGLE_API_KEY="your-key-here"

Or create a .env file in your working directory:

GOOGLE_API_KEY=your-key-here

Quick Start

Just run:

autopattern

This starts:

  • An interactive chat where you type browser tasks in plain English
  • A background API server on port 5001 for the Chrome extension
╭────────────────────────────────────────────╮
│          ⚡ AutoPattern v0.2.0             │
│   AI-powered browser automation from CLI   │
╰────────────────────────────────────────────╯

  📡 API server  : http://localhost:5001
  🤖 LLM model   : gemini-flash-latest

you > Go to github.com and star the autopattern repo
  🚀 Starting automation...
  ✅ Task completed successfully!

you > /quit

Chat Commands

Command Description
(any text) Run as a browser automation task
/load <file.csv> Load a recorded workflow CSV
/model [name] Show or change the Gemini model
/headless [on|off] Toggle headless browser mode
/history Show tasks run this session
/help Show all commands
/quit Exit
Ctrl+C Stop a running task

CLI Modes

# Interactive chat + API server (default)
autopattern

# Run a single task
autopattern --task "Search Google for 'Python tutorials'"

# Replay a recorded workflow CSV
autopattern --workflow recording.csv

# API server only (no chat)
autopattern --server

# Custom port
autopattern --port 8000

As a Library

from automation import AutomationRunner

runner = AutomationRunner(headless=False)
result = runner.run_task_sync("Go to google.com and search for Python")
print(result["success"])

Chrome Extension

The companion Chrome extension records your browser interactions and sends them to AutoPattern's API for replay. Install it from the extension/ directory in the source repo.


API Endpoints

When AutoPattern is running (via autopattern or autopattern --server):

Endpoint Method Description
/api/health GET Health check
/api/settings GET/PUT View or update settings
/api/describe POST Analyze workflow events → structured steps
/api/automate POST Run automation from recorded events
/api/automate/task POST Run automation from a task description

Development

git clone https://github.com/AadityaChaudhary/autopattern.git
cd autopattern/backend
pip install -e ".[dev]"
playwright install chromium

License

MIT — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

autopattern-0.2.0.tar.gz (18.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

autopattern-0.2.0-py3-none-any.whl (23.5 kB view details)

Uploaded Python 3

File details

Details for the file autopattern-0.2.0.tar.gz.

File metadata

  • Download URL: autopattern-0.2.0.tar.gz
  • Upload date:
  • Size: 18.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for autopattern-0.2.0.tar.gz
Algorithm Hash digest
SHA256 8aa602bfcbb979c6d5983831d7081e3ee9ce9460dd64926085fcff11e9329860
MD5 2b3a3c91f9b553f774b60f0745f87958
BLAKE2b-256 0a7da669554c9a47d3b110a25e1ea0c3019bb3c41ed39a6249ec8aefc37df80d

See more details on using hashes here.

Provenance

The following attestation bundles were made for autopattern-0.2.0.tar.gz:

Publisher: publish.yml on autopattern/autopattern

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file autopattern-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: autopattern-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 23.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for autopattern-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3019b0b5b73c89b2ed40270cdda91d4dbcea237f7aacd7f9ca1ccef12a8bdd26
MD5 955874622ee8157f676e56e7a11a56a1
BLAKE2b-256 110cd4f23c7fbaa052045d571f7e63283195719c97a2e59bec66df87b28df57f

See more details on using hashes here.

Provenance

The following attestation bundles were made for autopattern-0.2.0-py3-none-any.whl:

Publisher: publish.yml on autopattern/autopattern

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page