Welcome to the F1 Terminal! This project provides a real-time pit wall experience right in your terminal. It fetches live driver and constructor standings, race schedules, and pilot statistics using the Jolpi API (an Ergast v1.0.0 compatible mirror).
This repository contains two distinct implementations:
- Python CLI (
f1.py): A lightweight, dependency-free interactive command-line interface. - React Ink TUI (
f1-ink/): A rich, interactive Terminal User Interface built with React Ink and Node.js.
A pure Python 3 implementation requiring zero third-party packages. It handles network failures and API irregularities gracefully.
- Interactive REPL Mode: Type commands endlessly without restarting the script.
- Direct Execution: Run one-off commands (e.g.,
python f1.py standings). - Zero Dependencies: Uses only the Python standard library (
json,urllib). - Offline Resilience: Handles DNS and socket timeouts with user-friendly errors.
Run the interactive console:
python f1.pyOr run a command directly:
python f1.py standings
python f1.py constructors
python f1.py nextA fully interactive, keyboard-driven dashboard built with React Ink. It features a polished split-pane layout, real-time countdowns, caching, and pilot search capabilities.
- Interactive Navigation: Use arrow keys (
↑,↓) andEnterto browse views. - Intelligent Caching: Minimizes unnecessary network calls (5-minute TTL for standings, 30-sec for race countdowns).
- Pilot Search: Live search for your favorite pilots using 3-letter codes (e.g.,
VER,HAM) viaink-text-input. - Rich Visuals: Team-specific hex colors and Unicode country/race flags.
The TUI is published on NPM and can be run immediately without installation:
npx f1-terminal-cliOr install it globally:
npm install -g f1-terminal-clif1-terminal-cliIf you want to build and run it locally from source:
cd f1-ink
npm install
npm run build
npm run runIf you prefer running isolated containers instead of local Node environments, we've included a streamlined docker compose setup.
Simply run the interactive shell (this captures TTY input):
docker compose run --rm f1-terminalBoth implementations support the following data views:
standings: Current season Driver Championship standings.constructors: Current season Constructor Championship standings.schedule: Full race calendar for the current season with local time conversions.next: Details for the next upcoming race, including a live countdown timer.last: Race classification and final results for the last completed Grand Prix.pilot <CODE>: Detailed historical statistics (wins, poles, starts) for a specific driver (e.g., VER, HAM, ALO).drivers: A grid list of all active drivers in the current season.
- The Python implementation uses
threadingto keep a loading spinner active while data is fetched. - The Node.js implementation is bundled into a single file (
dist/index.js) using ESBuild, making it fast and portable without babel-node at runtime. - The API backing this project is Jolpi. Because it is public and read-only, we bypass SSL verification in the Python HTTP requests to avoid certificate trust issues on some offline or corporate machines.
Developed for Formula 1 fans who live in the terminal.