avios-cli 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. avios_cli-0.1.0/.editorconfig +15 -0
  2. avios_cli-0.1.0/.github/ISSUE_TEMPLATE/bug_report.md +25 -0
  3. avios_cli-0.1.0/.github/ISSUE_TEMPLATE/feature_request.md +16 -0
  4. avios_cli-0.1.0/.github/PULL_REQUEST_TEMPLATE.md +23 -0
  5. avios_cli-0.1.0/.github/dependabot.yml +10 -0
  6. avios_cli-0.1.0/.github/workflows/ci.yml +44 -0
  7. avios_cli-0.1.0/.github/workflows/publish.yml +40 -0
  8. avios_cli-0.1.0/.gitignore +39 -0
  9. avios_cli-0.1.0/.pre-commit-config.yaml +16 -0
  10. avios_cli-0.1.0/.python-version +1 -0
  11. avios_cli-0.1.0/CHANGELOG.md +35 -0
  12. avios_cli-0.1.0/CONTRIBUTING.md +74 -0
  13. avios_cli-0.1.0/LICENSE +21 -0
  14. avios_cli-0.1.0/PKG-INFO +152 -0
  15. avios_cli-0.1.0/README.md +117 -0
  16. avios_cli-0.1.0/SECURITY.md +31 -0
  17. avios_cli-0.1.0/docs/dashboard.svg +190 -0
  18. avios_cli-0.1.0/pyproject.toml +99 -0
  19. avios_cli-0.1.0/scripts/screenshot.py +52 -0
  20. avios_cli-0.1.0/src/avios/__init__.py +6 -0
  21. avios_cli-0.1.0/src/avios/auth.py +121 -0
  22. avios_cli-0.1.0/src/avios/cli.py +231 -0
  23. avios_cli-0.1.0/src/avios/client.py +63 -0
  24. avios_cli-0.1.0/src/avios/config.py +51 -0
  25. avios_cli-0.1.0/src/avios/endpoints.py +18 -0
  26. avios_cli-0.1.0/src/avios/models.py +51 -0
  27. avios_cli-0.1.0/src/avios/session.py +120 -0
  28. avios_cli-0.1.0/src/avios/tui/__init__.py +5 -0
  29. avios_cli-0.1.0/src/avios/tui/app.py +97 -0
  30. avios_cli-0.1.0/src/avios/tui/art.py +31 -0
  31. avios_cli-0.1.0/src/avios/tui/styles.tcss +21 -0
  32. avios_cli-0.1.0/src/avios/tui/widgets.py +30 -0
  33. avios_cli-0.1.0/tests/conftest.py +34 -0
  34. avios_cli-0.1.0/tests/fixtures/accounts.json +3 -0
  35. avios_cli-0.1.0/tests/fixtures/balance.json +1 -0
  36. avios_cli-0.1.0/tests/fixtures/transactions.json +5 -0
  37. avios_cli-0.1.0/tests/test_auth.py +108 -0
  38. avios_cli-0.1.0/tests/test_cli.py +159 -0
  39. avios_cli-0.1.0/tests/test_client.py +89 -0
  40. avios_cli-0.1.0/tests/test_models.py +32 -0
  41. avios_cli-0.1.0/tests/test_session.py +85 -0
  42. avios_cli-0.1.0/tests/test_tui.py +84 -0
  43. avios_cli-0.1.0/uv.lock +1312 -0
@@ -0,0 +1,15 @@
1
+ root = true
2
+
3
+ [*]
4
+ charset = utf-8
5
+ end_of_line = lf
6
+ insert_final_newline = true
7
+ trim_trailing_whitespace = true
8
+ indent_style = space
9
+ indent_size = 4
10
+
11
+ [*.{yml,yaml,toml,json,md}]
12
+ indent_size = 2
13
+
14
+ [*.md]
15
+ trim_trailing_whitespace = false
@@ -0,0 +1,25 @@
1
+ ---
2
+ name: Bug report
3
+ about: Something isn't working
4
+ title: ""
5
+ labels: bug
6
+ assignees: ""
7
+ ---
8
+
9
+ **What happened**
10
+ A clear description of the bug.
11
+
12
+ **Command / steps**
13
+ The exact command(s) you ran, e.g. `avios transactions --limit 10`.
14
+
15
+ **Expected**
16
+ What you expected to happen.
17
+
18
+ **Environment**
19
+ - avios-cli version (`avios --version`):
20
+ - OS:
21
+ - Python version:
22
+ - Installed the `login` extra? (yes/no)
23
+
24
+ **Logs / output**
25
+ Paste any error output. **Redact cookies and account details.**
@@ -0,0 +1,16 @@
1
+ ---
2
+ name: Feature request
3
+ about: Suggest an idea or new command
4
+ title: ""
5
+ labels: enhancement
6
+ assignees: ""
7
+ ---
8
+
9
+ **What would you like?**
10
+ A clear description of the feature or command.
11
+
12
+ **Why**
13
+ The problem it solves or the use case.
14
+
15
+ **Notes**
16
+ Anything else — e.g. the avios.com/BA page or endpoint it relates to.
@@ -0,0 +1,23 @@
1
+ <!-- Thanks for contributing! Keep PRs small (< ~1000 lines) and focused. -->
2
+
3
+ ## What & why
4
+
5
+ <!-- What does this change and why? Link any related issue. -->
6
+
7
+ ## Test plan
8
+
9
+ ```
10
+ uv run ruff check .
11
+ uv run ruff format --check .
12
+ uv run mypy src
13
+ uv run pytest
14
+ ```
15
+
16
+ <!-- Note any manual verification (e.g. `avios login`, `avios tui`). -->
17
+
18
+ ## Checklist
19
+
20
+ - [ ] Tests added/updated (network/browser mocked)
21
+ - [ ] `ruff`, `mypy`, `pytest` pass locally
22
+ - [ ] Files stay under 1000 lines; diff under ~1000 lines
23
+ - [ ] CHANGELOG updated if user-facing
@@ -0,0 +1,10 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "github-actions"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "weekly"
7
+ - package-ecosystem: "uv"
8
+ directory: "/"
9
+ schedule:
10
+ interval: "weekly"
@@ -0,0 +1,44 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ concurrency:
9
+ group: ci-${{ github.ref }}
10
+ cancel-in-progress: true
11
+
12
+ jobs:
13
+ test:
14
+ runs-on: ubuntu-latest
15
+ strategy:
16
+ fail-fast: false
17
+ matrix:
18
+ python-version: ["3.10", "3.11", "3.12", "3.13"]
19
+ env:
20
+ # Drives every uv command (overrides .python-version) so the matrix actually
21
+ # tests each interpreter. uv downloads the interpreter if it's missing.
22
+ UV_PYTHON: ${{ matrix.python-version }}
23
+ steps:
24
+ - uses: actions/checkout@v4
25
+
26
+ - name: Install uv
27
+ uses: astral-sh/setup-uv@v5
28
+ with:
29
+ enable-cache: true
30
+
31
+ - name: Install dependencies
32
+ run: uv sync
33
+
34
+ - name: Lint (ruff)
35
+ run: uv run ruff check .
36
+
37
+ - name: Format check (ruff)
38
+ run: uv run ruff format --check .
39
+
40
+ - name: Type check (mypy)
41
+ run: uv run mypy src
42
+
43
+ - name: Test (pytest)
44
+ run: uv run pytest
@@ -0,0 +1,40 @@
1
+ name: Publish
2
+
3
+ # Publishes to PyPI when a GitHub Release is published.
4
+ # Uses PyPI Trusted Publishing (OIDC) — no API token needed. Before the first
5
+ # release, configure a trusted publisher for `avios-cli` on PyPI pointing at this
6
+ # workflow. See https://docs.pypi.org/trusted-publishers/
7
+ on:
8
+ release:
9
+ types: [published]
10
+ workflow_dispatch: # allow a manual publish of the current version
11
+
12
+ jobs:
13
+ build:
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ - name: Install uv
18
+ uses: astral-sh/setup-uv@v5
19
+ - name: Build sdist and wheel
20
+ run: uv build
21
+ - name: Upload artifacts
22
+ uses: actions/upload-artifact@v4
23
+ with:
24
+ name: dist
25
+ path: dist/
26
+
27
+ publish:
28
+ needs: build
29
+ runs-on: ubuntu-latest
30
+ environment: pypi
31
+ permissions:
32
+ id-token: write # required for trusted publishing
33
+ steps:
34
+ - name: Download artifacts
35
+ uses: actions/download-artifact@v4
36
+ with:
37
+ name: dist
38
+ path: dist/
39
+ - name: Publish to PyPI
40
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,39 @@
1
+ # Byte-compiled / optimized
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # Distribution / packaging
7
+ build/
8
+ dist/
9
+ *.egg-info/
10
+ .eggs/
11
+
12
+ # Virtual environments
13
+ .venv/
14
+ venv/
15
+ env/
16
+
17
+ # Test / coverage / type-check caches
18
+ .pytest_cache/
19
+ .ruff_cache/
20
+ .mypy_cache/
21
+ .coverage
22
+ .coverage.*
23
+ htmlcov/
24
+ coverage.xml
25
+
26
+ # Tooling
27
+ .python-version.local
28
+
29
+ # Editors / OS
30
+ .idea/
31
+ .vscode/
32
+ *.swp
33
+ .DS_Store
34
+
35
+ # Concord local work-state (regenerated per machine)
36
+ .concord/
37
+
38
+ # Playwright browsers (installed out-of-tree, but just in case)
39
+ ms-playwright/
@@ -0,0 +1,16 @@
1
+ # Run `uv run pre-commit install` once to enable these hooks locally.
2
+ repos:
3
+ - repo: https://github.com/astral-sh/ruff-pre-commit
4
+ rev: v0.6.9
5
+ hooks:
6
+ - id: ruff
7
+ args: [--fix]
8
+ - id: ruff-format
9
+ - repo: https://github.com/pre-commit/pre-commit-hooks
10
+ rev: v5.0.0
11
+ hooks:
12
+ - id: end-of-file-fixer
13
+ - id: trailing-whitespace
14
+ - id: check-yaml
15
+ - id: check-toml
16
+ - id: check-merge-conflict
@@ -0,0 +1 @@
1
+ 3.12
@@ -0,0 +1,35 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented here. The format is based on
4
+ [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres
5
+ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [Unreleased]
8
+
9
+ ### Added
10
+ - Project scaffolding: src-layout `avios` package, hatchling packaging, `avios`
11
+ console script, ruff + mypy + pytest tooling, GitHub Actions CI (Python
12
+ 3.10–3.13).
13
+ - Config layer (`pydantic-settings`, XDG paths) and pydantic models.
14
+ - Session/cookie layer: `state.json` storage (mode `600`), `AVIOS_COOKIE`
15
+ override, authenticated `httpx` client, expiry detection.
16
+ - Typed `AviosClient`: balance, transactions (+`--limit`), pending, accounts,
17
+ profile, overview, and a `raw` escape hatch.
18
+ - Browser-assisted login: `avios login` (Playwright) and
19
+ `avios login --from-browser` (browser-cookie3); `avios logout`.
20
+ - CLI commands with Rich rendering and `--json` output.
21
+ - Textual TUI dashboard (`avios tui`): gradient ASCII "AVIOS" banner + balance
22
+ header + scrollable transactions table, non-blocking refresh.
23
+ - OSS project files: CONTRIBUTING, SECURITY, issue/PR templates, PyPI publish
24
+ workflow, Dependabot.
25
+ - README screenshot of the TUI, generated by `scripts/screenshot.py`.
26
+
27
+ ### Fixed
28
+ - TUI balance line rendered blank: `#balance` padding + border consumed its whole
29
+ height (content height 0). Adjusted the box so the balance is visible.
30
+
31
+ ### Noted
32
+ - Reward-flight **availability** search is not yet implemented (needs a British
33
+ Airways capture).
34
+
35
+ [Unreleased]: https://github.com/alexechoi/avios-cli/commits/main
@@ -0,0 +1,74 @@
1
+ # Contributing to avios-cli
2
+
3
+ Thanks for your interest! avios-cli is a small, unofficial project — contributions
4
+ of all sizes are welcome.
5
+
6
+ ## Dev setup
7
+
8
+ Requires Python 3.10+ and [`uv`](https://docs.astral.sh/uv/).
9
+
10
+ ```bash
11
+ git clone https://github.com/alexechoi/avios-cli
12
+ cd avios-cli
13
+ uv sync # installs the project + the `dev` dependency-group
14
+ uv run pre-commit install # optional: auto-lint on commit
15
+ ```
16
+
17
+ For the login flow (Playwright / browser-cookie3):
18
+
19
+ ```bash
20
+ uv sync --extra login
21
+ uv run playwright install chromium
22
+ ```
23
+
24
+ ## Checks (run before pushing)
25
+
26
+ ```bash
27
+ uv run ruff check .
28
+ uv run ruff format .
29
+ uv run mypy src
30
+ uv run pytest
31
+ ```
32
+
33
+ CI runs the same checks on Python 3.10–3.13; all must pass.
34
+
35
+ ## Pull requests
36
+
37
+ - **Keep PRs small** — under ~1000 lines of diff, and keep individual files under
38
+ 1000 lines. Split larger work into a sequence of focused PRs.
39
+ - Write a clear title and description, and include the test commands you ran.
40
+ - Add or update tests for behaviour changes. Network/browser calls are mocked —
41
+ see `tests/` for patterns (`httpx.MockTransport`, faked `browser_cookie3`,
42
+ Textual `Pilot`).
43
+ - Commits use a light [Conventional Commits](https://www.conventionalcommits.org/)
44
+ style (`feat:`, `fix:`, `docs:`, `chore:`, `test:`, `ci:`).
45
+ - PRs are merged with a **merge commit** (history is not squashed).
46
+
47
+ ## Releasing (maintainers)
48
+
49
+ Releases publish to [PyPI](https://pypi.org/project/avios-cli/) via
50
+ `.github/workflows/publish.yml` using **Trusted Publishing (OIDC)** — no API token.
51
+
52
+ One-time setup on PyPI (Account → Publishing → *Add a pending publisher*):
53
+
54
+ | Field | Value |
55
+ | --- | --- |
56
+ | PyPI Project Name | `avios-cli` |
57
+ | Owner | `alexechoi` |
58
+ | Repository name | `avios-cli` |
59
+ | Workflow name | `publish.yml` |
60
+ | Environment name | `pypi` |
61
+
62
+ To cut a release:
63
+
64
+ 1. Bump `__version__` in `src/avios/__init__.py` and update `CHANGELOG.md`.
65
+ 2. Merge to `main`.
66
+ 3. Create a GitHub Release with tag `vX.Y.Z` — the workflow builds and publishes.
67
+ (Or run the **Publish** workflow manually via *workflow_dispatch*.)
68
+
69
+ ## Reverse-engineering note
70
+
71
+ avios-cli talks to avios.com's private, undocumented endpoints. Shapes can change
72
+ without notice. If you observe a new/changed response, please pin the model in
73
+ `models.py` and add a fixture under `tests/fixtures/`. See [SECURITY.md](SECURITY.md)
74
+ for how credentials are handled.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Alex Choi
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,152 @@
1
+ Metadata-Version: 2.4
2
+ Name: avios-cli
3
+ Version: 0.1.0
4
+ Summary: A CLI and TUI for avios.com — view your Avios balance and transactions from the terminal.
5
+ Project-URL: Homepage, https://github.com/alexechoi/avios-cli
6
+ Project-URL: Repository, https://github.com/alexechoi/avios-cli
7
+ Project-URL: Issues, https://github.com/alexechoi/avios-cli/issues
8
+ Author: Alex Choi
9
+ License-Expression: MIT
10
+ License-File: LICENSE
11
+ Keywords: avios,british-airways,cli,loyalty,terminal,tui
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: End Users/Desktop
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python :: 3 :: Only
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Topic :: Utilities
23
+ Requires-Python: >=3.10
24
+ Requires-Dist: httpx>=0.27
25
+ Requires-Dist: pydantic-settings>=2.3
26
+ Requires-Dist: pydantic>=2.7
27
+ Requires-Dist: pyyaml>=6.0
28
+ Requires-Dist: rich>=13.7
29
+ Requires-Dist: textual>=0.80
30
+ Requires-Dist: typer>=0.12
31
+ Provides-Extra: login
32
+ Requires-Dist: browser-cookie3>=0.19; extra == 'login'
33
+ Requires-Dist: playwright>=1.44; extra == 'login'
34
+ Description-Content-Type: text/markdown
35
+
36
+ # avios-cli
37
+
38
+ [![CI](https://github.com/alexechoi/avios-cli/actions/workflows/ci.yml/badge.svg)](https://github.com/alexechoi/avios-cli/actions/workflows/ci.yml)
39
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
40
+ [![Python](https://img.shields.io/badge/python-3.10%2B-blue.svg)](https://www.python.org/)
41
+
42
+ A **CLI and TUI for [avios.com](https://www.avios.com)** — check your Avios balance,
43
+ browse your transactions and manage your account without leaving the terminal.
44
+
45
+ > ⚠️ **Unofficial.** This project is not affiliated with, authorised by, or endorsed by
46
+ > Avios, British Airways or IAG Loyalty. It drives the same private endpoints the
47
+ > avios.com website uses, with your own logged-in session. Use at your own risk; it may
48
+ > break at any time and may be against the provider's terms of service.
49
+
50
+ ![avios TUI dashboard](docs/dashboard.svg)
51
+
52
+ <sub>The <code>avios tui</code> dashboard (demo data). Regenerate with <code>uv run python scripts/screenshot.py</code>.</sub>
53
+
54
+ ## Status
55
+
56
+ Early alpha, built in the open. See the [roadmap](#roadmap).
57
+
58
+ ## Install
59
+
60
+ Requires Python 3.10+.
61
+
62
+ ```bash
63
+ uvx avios-cli --help # try it without installing (recommended)
64
+ # or install it:
65
+ pip install avios-cli
66
+ ```
67
+
68
+ Or from source, for development:
69
+
70
+ ```bash
71
+ git clone https://github.com/alexechoi/avios-cli
72
+ cd avios-cli
73
+ uv sync
74
+ uv run avios --help
75
+ ```
76
+
77
+ ## Log in
78
+
79
+ avios.com has no credential API — login is Auth0 Universal Login behind hCaptcha and
80
+ SMS/passkey MFA — so `avios login` rides a real browser session (like `gh`/`aws`
81
+ login). Install the login extra once:
82
+
83
+ ```bash
84
+ uv sync --extra login # or: pip install "avios-cli[login]"
85
+ uv run playwright install chromium
86
+ ```
87
+
88
+ Then either open a browser to log in, or import the cookie from a browser you're
89
+ already logged into:
90
+
91
+ ```bash
92
+ avios login # opens a browser; log in once, cookie is captured
93
+ avios login --from-browser # instead, read the avios.com cookie from Chrome
94
+ ```
95
+
96
+ Your session cookie is stored at `~/.config/avios/state.json` (mode `600`). It
97
+ expires after ~a day; just run `avios login` again. Run `avios logout` to remove it.
98
+
99
+ ## Usage
100
+
101
+ ```bash
102
+ avios balance # your Avios balance
103
+ avios transactions --limit 20 # recent transactions
104
+ avios pending # pending Avios
105
+ avios accounts # linked loyalty accounts
106
+ avios overview # dashboard summary (raw JSON)
107
+ avios whoami # your profile (raw JSON)
108
+ avios raw /manage-avios/api/user/current # hit any endpoint directly
109
+ ```
110
+
111
+ Add `--json` to `balance`, `transactions`, `pending` or `accounts` for scriptable
112
+ output.
113
+
114
+ ## TUI
115
+
116
+ ```bash
117
+ avios tui
118
+ ```
119
+
120
+ A full-screen dashboard: your balance in the header and a scrollable transactions
121
+ table. Press `r` to refresh, `q` to quit.
122
+
123
+ ## Roadmap
124
+
125
+ - [x] Project scaffolding, packaging and CI
126
+ - [x] Session + cookie storage layer
127
+ - [x] Typed API client (balance, transactions, accounts, profile)
128
+ - [x] Browser-assisted `avios login`
129
+ - [x] CLI commands
130
+ - [x] Textual TUI dashboard
131
+ - [ ] Reward-flight **availability** search _(coming soon — needs a British Airways capture)_
132
+
133
+ ## Development
134
+
135
+ ```bash
136
+ uv sync # installs the project + the `dev` dependency-group
137
+ uv run ruff check .
138
+ uv run mypy src
139
+ uv run pytest
140
+ ```
141
+
142
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for the full workflow and
143
+ [CHANGELOG.md](CHANGELOG.md) for release notes.
144
+
145
+ ## Security
146
+
147
+ No passwords are handled or stored — only your session cookie, kept locally at
148
+ `~/.config/avios/state.json` (mode `600`). See [SECURITY.md](SECURITY.md).
149
+
150
+ ## License
151
+
152
+ [MIT](LICENSE)
@@ -0,0 +1,117 @@
1
+ # avios-cli
2
+
3
+ [![CI](https://github.com/alexechoi/avios-cli/actions/workflows/ci.yml/badge.svg)](https://github.com/alexechoi/avios-cli/actions/workflows/ci.yml)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
5
+ [![Python](https://img.shields.io/badge/python-3.10%2B-blue.svg)](https://www.python.org/)
6
+
7
+ A **CLI and TUI for [avios.com](https://www.avios.com)** — check your Avios balance,
8
+ browse your transactions and manage your account without leaving the terminal.
9
+
10
+ > ⚠️ **Unofficial.** This project is not affiliated with, authorised by, or endorsed by
11
+ > Avios, British Airways or IAG Loyalty. It drives the same private endpoints the
12
+ > avios.com website uses, with your own logged-in session. Use at your own risk; it may
13
+ > break at any time and may be against the provider's terms of service.
14
+
15
+ ![avios TUI dashboard](docs/dashboard.svg)
16
+
17
+ <sub>The <code>avios tui</code> dashboard (demo data). Regenerate with <code>uv run python scripts/screenshot.py</code>.</sub>
18
+
19
+ ## Status
20
+
21
+ Early alpha, built in the open. See the [roadmap](#roadmap).
22
+
23
+ ## Install
24
+
25
+ Requires Python 3.10+.
26
+
27
+ ```bash
28
+ uvx avios-cli --help # try it without installing (recommended)
29
+ # or install it:
30
+ pip install avios-cli
31
+ ```
32
+
33
+ Or from source, for development:
34
+
35
+ ```bash
36
+ git clone https://github.com/alexechoi/avios-cli
37
+ cd avios-cli
38
+ uv sync
39
+ uv run avios --help
40
+ ```
41
+
42
+ ## Log in
43
+
44
+ avios.com has no credential API — login is Auth0 Universal Login behind hCaptcha and
45
+ SMS/passkey MFA — so `avios login` rides a real browser session (like `gh`/`aws`
46
+ login). Install the login extra once:
47
+
48
+ ```bash
49
+ uv sync --extra login # or: pip install "avios-cli[login]"
50
+ uv run playwright install chromium
51
+ ```
52
+
53
+ Then either open a browser to log in, or import the cookie from a browser you're
54
+ already logged into:
55
+
56
+ ```bash
57
+ avios login # opens a browser; log in once, cookie is captured
58
+ avios login --from-browser # instead, read the avios.com cookie from Chrome
59
+ ```
60
+
61
+ Your session cookie is stored at `~/.config/avios/state.json` (mode `600`). It
62
+ expires after ~a day; just run `avios login` again. Run `avios logout` to remove it.
63
+
64
+ ## Usage
65
+
66
+ ```bash
67
+ avios balance # your Avios balance
68
+ avios transactions --limit 20 # recent transactions
69
+ avios pending # pending Avios
70
+ avios accounts # linked loyalty accounts
71
+ avios overview # dashboard summary (raw JSON)
72
+ avios whoami # your profile (raw JSON)
73
+ avios raw /manage-avios/api/user/current # hit any endpoint directly
74
+ ```
75
+
76
+ Add `--json` to `balance`, `transactions`, `pending` or `accounts` for scriptable
77
+ output.
78
+
79
+ ## TUI
80
+
81
+ ```bash
82
+ avios tui
83
+ ```
84
+
85
+ A full-screen dashboard: your balance in the header and a scrollable transactions
86
+ table. Press `r` to refresh, `q` to quit.
87
+
88
+ ## Roadmap
89
+
90
+ - [x] Project scaffolding, packaging and CI
91
+ - [x] Session + cookie storage layer
92
+ - [x] Typed API client (balance, transactions, accounts, profile)
93
+ - [x] Browser-assisted `avios login`
94
+ - [x] CLI commands
95
+ - [x] Textual TUI dashboard
96
+ - [ ] Reward-flight **availability** search _(coming soon — needs a British Airways capture)_
97
+
98
+ ## Development
99
+
100
+ ```bash
101
+ uv sync # installs the project + the `dev` dependency-group
102
+ uv run ruff check .
103
+ uv run mypy src
104
+ uv run pytest
105
+ ```
106
+
107
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for the full workflow and
108
+ [CHANGELOG.md](CHANGELOG.md) for release notes.
109
+
110
+ ## Security
111
+
112
+ No passwords are handled or stored — only your session cookie, kept locally at
113
+ `~/.config/avios/state.json` (mode `600`). See [SECURITY.md](SECURITY.md).
114
+
115
+ ## License
116
+
117
+ [MIT](LICENSE)
@@ -0,0 +1,31 @@
1
+ # Security Policy
2
+
3
+ ## How avios-cli handles your credentials
4
+
5
+ - **No passwords are ever handled or stored.** Login happens in a real browser
6
+ (Auth0 Universal Login + hCaptcha + MFA); avios-cli only captures the resulting
7
+ **session cookie**.
8
+ - The cookie is stored locally at `~/.config/avios/state.json` with file mode
9
+ `600` (owner read/write only). It is never transmitted anywhere except to
10
+ avios.com in the requests you make.
11
+ - `avios logout` deletes the stored session. The cookie also expires on the
12
+ server side after roughly a day.
13
+ - `AVIOS_COOKIE` may be set to supply a cookie via the environment instead of the
14
+ stored file — avoid committing it or storing it in shell history.
15
+
16
+ ## Unofficial software
17
+
18
+ avios-cli is **not affiliated with Avios, British Airways or IAG Loyalty** and
19
+ uses private, undocumented endpoints. Using it may breach the provider's terms of
20
+ service and could affect your account. Use at your own risk.
21
+
22
+ ## Reporting a vulnerability
23
+
24
+ Please **do not** open a public issue for security problems. Instead, use GitHub's
25
+ private vulnerability reporting:
26
+ **Security → Report a vulnerability** on the repository, or open a private draft
27
+ advisory. We'll acknowledge within a few days.
28
+
29
+ ## Supported versions
30
+
31
+ This is pre-1.0 software; only the latest release on `main` is supported.