Skip to main content

avios-cli

CI License: MIT Python

A CLI, TUI and MCP server for your Avios programmes — check balances, browse transactions, and search British Airways reward-flight availability without leaving the terminal, or hand the same data to an AI agent. British Airways, Iberia, and Aer Lingus use avios.com; Finnair Plus uses Finnair's own OAuth and loyalty API.

⚠️ Unofficial. This project is not affiliated with, authorised by, or endorsed by Avios, British Airways, Finnair or IAG Loyalty. It drives the same private endpoints the providers' websites use, with your own logged-in session. Use at your own risk; it may break at any time and may be against the provider's terms of service.

avios TUI dashboard

The avios tui dashboard (demo data). Regenerate with uv run python scripts/screenshot.py.

avios reward-flight search

Direct BA reward-seat availability by date and cabin (synthetic demo data).

Status

Early alpha, built in the open. See the roadmap.

Install

Requires Python 3.10+.

uvx avios-cli --help     # run without installing
# or install it, then use the `avios` command:
pip install avios-cli
avios --help

Or from source, for development:

git clone https://github.com/alexechoi/avios-cli
cd avios-cli
uv sync
uv run avios --help

Log in

avios.com has no credential API — login is Auth0 Universal Login behind hCaptcha and SMS/passkey MFA — so avios login opens a real browser, waits while you finish logging in (password, captcha, SMS code), and captures the session once you land on the dashboard:

uvx avios-cli login
uvx avios-cli login iberia
uvx avios-cli login finnair

It launches your installed Google Chrome (no download). If you don't have Chrome, it fetches Playwright's Chromium automatically on first login (~150 MB, one-time). No extra flags — browser support ships in the package.

Tip: if you'll use it often, uv tool install avios-cli once, then just run avios login, avios balance, etc. directly.

Prefer not to open a browser? Import the cookie from a Chrome you're already logged into avios.com with:

uvx avios-cli login --from-browser

This scans all your Chrome profiles and uses whichever one is actually logged into avios.com (it tells you which). If you have several profiles, you can target one directly:

uvx avios-cli login --from-browser --profile "Profile 1"

Stuck in an endless captcha loop? That's bot detection on the automated browser. Use --from-browser instead: log into avios.com in your normal Chrome (you'll get one normal captcha), then run uvx avios-cli login --from-browser.

Finnair uses a different CAS/OAuth flow. avios login finnair opens the Finnair Plus balance page, lets you complete password and MFA in the real browser, and captures the OAuth session from the authenticated loyalty request. --from-browser is not available for Finnair because browser-cookie import cannot read that token.

Each programme session is stored at ~/.config/avios/accounts/<programme>.json (mode 600). Sessions expire; just log in to that programme again. Use avios logout <programme> for one account or avios logout for all accounts. For BA, browser-assisted login also opens the separate reward-flight application. British Airways may show a second login prompt; keep the browser open until the CLI confirms success. Reward searches run inside a background Chrome window: the flight finder is behind Akamai Bot Manager, which rejects plain HTTP clients and blocks by IP address — a handful of ordinary page loads from a shared office network is enough to earn a site-wide 403. Every leg of a search is therefore batched through a single browser navigation, paced, and served by in-page fetch() calls. If you do get blocked, wait a few minutes and switch network.

Usage

Commands span all logged-in accounts by default and show a combined total; add --account/-a <programme> to focus on one.

avios accounts                 # every logged-in account: balance + status
avios balance                  # per-account balances + combined total
avios transactions --limit 20  # recent transactions, merged across accounts
avios pending                  # pending Avios, merged across accounts
avios balance --account iberia # just one programme
avios overview                 # dashboard summary
avios whoami                   # name, tier, membership, email
avios raw /shell/api/users/current/accounts   # hit any endpoint directly

# Direct British Airways reward-seat availability (--date also prices in Avios):
avios flights LON HKG --date 2027-01-05
avios flights LON HKG --date 2027-01-05 --return-date 2027-01-12
avios flights LON ABZ --month 2026-11 --cabin economy --cabin business
avios flights LON ABZ --month 2026-11 --return-month 2026-12 --json

Add --json to accounts, balance, transactions, pending, whoami, or flights for scriptable output. With a single account, balance keeps the individual/household breakdown.

TUI

avios tui

A tabbed full-screen application:

  • Dashboard — combined balance header and transactions across every account.
  • Reward Flights — BA date/calendar search with optional reverse-route return, cabin/passenger controls, and independent outbound/inbound result tables.

Press r to refresh the dashboard and q to quit. Reward searches run only when you press Search or Enter.

MCP server

Expose your accounts to Claude and other MCP clients, read-only:

uv tool install 'avios-cli[mcp]'
avios login ba          # sessions come from the CLI; the server never logs in
// Claude Desktop: claude_desktop_config.json
{
  "mcpServers": {
    "avios": { "command": "avios-mcp" }
  }
}

Or, for Claude Code:

claude mcp add avios -- uvx --from 'avios-cli[mcp]' avios-mcp

Tools: list_accounts, get_balance, get_transactions, get_pending_transactions, whoami, search_reward_flights.

Every tool is read-only — nothing books, spends, or changes a session — and no cookie or token is ever returned. search_reward_flights searches a whole return trip in one call and is rate-limited server-side, because it drives a real browser and British Airways blocks by IP address; an agent looping over routes could get you locked out of the site.

Reward search is an unofficial view of BA's own flight finder. It supports direct BA flights, three-letter airport/city codes, and seat counts by cabin. Searching an exact --date also fetches the Avios price per cabin for your party; calendar (month) searches show seats only, which keeps them to one request per leg. Seats that need a BA companion voucher are marked †. It does not book, and it does not show taxes/fees or connecting flights. Return journeys are two reverse-route one-way searches sharing one browser session.

Roadmap

  • Project scaffolding, packaging and CI
  • Session + cookie storage layer
  • Typed API client (balance, transactions, accounts, profile)
  • Browser-assisted avios login
  • CLI commands
  • Textual TUI dashboard
  • Multiple accounts (BA, Iberia, Aer Lingus, Finnair) with combined views
  • British Airways reward-flight availability search (CLI + TUI)
  • Avios pricing per cabin for an exact date
  • MCP server (avios-mcp) for AI agents

Development

uv sync            # installs the project + the `dev` dependency-group
uv run ruff check .
uv run mypy src
uv run pytest

See CONTRIBUTING.md for the full workflow and CHANGELOG.md for release notes.

Security

No passwords are handled or stored — only programme session cookies or OAuth tokens, kept locally under ~/.config/avios/accounts/ (mode 600). See SECURITY.md.

License

MIT

Metadata

Release files for avios-cli 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for avios-cli 0.6.0
File Size Uploaded
avios_cli-0.6.0.tar.gz 228.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for avios-cli 0.6.0
File Interpreter ABI Platform
avios_cli-0.6.0-py3-none-any.whl Python 3 none any Details

Total release size: 293.7 kB

Release files / avios_cli-0.6.0.tar.gz

Download URL avios_cli-0.6.0.tar.gz
Size 228.5 kB
Tags Source
SHA-256 checksum
How to use checksums
21c2b6869717e450159370c42ab9a53a6a2ad2f1dfc7147a7a6ab8f8480ba7f6
BLAKE2b-256 checksum
How to use checksums
0470a7b47829150d48a71fc8a2c4fa03ff067ab77e09367032aef97b892d4035
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 11, 2026.

Transparency log

Release files / avios_cli-0.6.0-py3-none-any.whl

Download URL avios_cli-0.6.0-py3-none-any.whl
Size 65.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f92e733eae04e1f255787fdbceba4fa8fbbb2ad6b64281773a4afa3ff027ad86
BLAKE2b-256 checksum
How to use checksums
b38fe13150e9ca696cf8dd84f33f9ef208819dcf66f0f5665be014c293dacf82
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 11, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 release files

0.5.0

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page