AI-powered multi-city flight search using browser automation.
Flight Agent uses browser-use to autonomously navigate Google Flights, search complex multi-city itineraries, and return the cheapest options.
flowchart LR
User[You] -->|Describe itinerary| CLI[flight-agent CLI]
CLI -->|"browser-use Agent"| GF[Google Flights]
GF -->|Select Multi-city| GF
GF -->|Fill all segments| GF
GF -->|Extract prices| CLI
CLI -->|Cheapest options| User
The Agent from browser-use handles the entire flow -- no manual Playwright
code or DOM selectors required.
# 1. Create .env with your API key
cp .env.example .env
# edit .env: GOOGLE_API_KEY="your-key"
# optionally set GEMINI_MODEL (default: gemini-2.5-flash)
# 2. Install
uv sync --group dev
uv run playwright install chromium
# 3. Run a search
uv run flight-agent search --headless "ZRH-HKG Oct 1"uv run flight-agent search --headless \
"flight 1: ZRH-Hong-Kong (Oct 1-3), non-stop
flight 2: Hong Kong-Tokyo (Oct 3-8), non-stop
flight 3: Tokyo-Hong Kong (Oct 24-27), non-stop
flight 4: Hong Kong-Zurich (Oct 27-31), non-stop"Omit --headless to watch the browser navigate Google Flights in real time.
Edit the dates in scripts/run-flight-queries.sh and run:
./scripts/run-flight-queries.shRun without a plan argument to type or paste a flight plan interactively:
uv run flight-agent searchmake install # install dependencies (includes dev tools)
make install-dev # same as install (no separate test group)
make playwright-install # download Chromium for Playwright
make pre-commit # install git hooksmake lint # ruff check
make format # ruff format (auto-fixes)
make format-check # check formatting without changes
make typecheck # mypy static analysismake test # pytest
make test-cov # pytest with coveragemake ci # lint + format-check + typecheck + testmake run # uv run flight-agent (alias)
make clean # remove build artifacts and cachesflight_agent/
├── flight_agent/
│ ├── agent.py search_flights() wrapping browser-use Agent
│ ├── main.py Click CLI
│ └── __init__.py
├── build/ build artifacts
├── .env.example
├── .gitignore
├── .pre-commit-config.yaml
├── LICENSE
├── Makefile
├── pyproject.toml
├── README.md
├── scripts/
│ └── run-flight-queries.sh pre-configured multi-city search script
└── uv.lock
MIT