A production-quality terminal UI (TUI) and headless CLI tool for monitoring Rivian vehicle telemetry in real-time.
⚠️ WARNING: This tool uses an unofficial Rivian API that is not publicly documented or supported. Using this tool may violate Rivian's Terms of Service. Use at your own risk. The API may change or break at any time without notice.
- 🚗 Real-time vehicle monitoring via GraphQL + WebSocket subscriptions
- 📊 Interactive TUI powered by Bubble Tea with multiple views
- 🚙 Multi-vehicle support with interactive selection menu
- 📈 Historical charts with ASCII sparklines for all metrics
- 🤖 Headless CLI mode for scripting and automation
- 💾 Local persistence for historical data and analysis
- 🔐 Secure credential storage with OS keychain integration
- 📉 Derived insights: charging narratives, readiness score, efficiency tracking
- ⚙️ Flexible configuration via config file, environment variables, or CLI flags
- 🔄 Auto-fallback from WebSocket to HTTP polling when needed
logincommand: Standalone authentication command for verifying credentials- Works fully non-interactively:
rivian-ls --email x --password y --otp 123456 login - Validates session end-to-end by querying vehicles after auth
- Works fully non-interactively:
- Two-phase OTP login: Non-interactive MFA via two separate invocations
- Phase 1:
rivian-ls --email x --password y logintriggers SMS, saves session - Phase 2:
rivian-ls login --otp 123456completes authentication
- Phase 1:
- Non-TTY support: Clear error messages when interactive prompts are needed but no terminal is available
- Guides users to the correct flag, env var, or config file
- Bug fix: Fixed
UNAUTHENTICATEDerror when using cached credentials- Cached auth was missing CSRF token and app session ID required by the API
- Now creates a fresh session after restoring credentials from cache
- Multi-Vehicle Support: Interactive vehicle selection menu (
vkey)- Switch between vehicles at runtime without restarting
- Shows battery %, online status, and vehicle details
- Keyboard navigation with arrows or number keys
- Historical Charts: New 4th view with ASCII sparklines
- Battery Level, Range, Charging Rate, Temperature, Efficiency
- Configurable time ranges (24h, 7d, 30d)
- Statistics display (current, min, max, change)
- Left/Right arrows to switch metrics,
tto cycle time ranges
- Bug Fix: Honors
--vehicleflag for initial vehicle selection
- Config File Support: Create
~/.config/rivian-ls/config.yamlto set defaults - Environment Variables: Configure via
RIVIAN_EMAIL,RIVIAN_VERBOSE, etc. - New Flags:
--quiet,--verbose,--no-storefor better control - Standardized Exit Codes: Proper exit codes (0-4) for shell scripting
- Configuration Layering: CLI flags > env vars > config file > defaults
Real-time overview of battery, charging, security, tire status, and calculated metrics.
Detailed charging information with battery details and intelligent recommendations.
Vehicle diagnostics, trends over time, and closure status monitoring.
brew install pfrederiksen/tap/rivian-lsDownload the latest release for your platform from the Releases page.
Prerequisites:
- Go 1.21 or later
- A Rivian account with at least one vehicle
git clone https://github.com/pfrederiksen/rivian-ls.git
cd rivian-ls
make buildThe binary will be built as ./rivian-ls.
Launch the interactive terminal UI:
rivian-lsYou'll be prompted for your email and password on first run. If MFA/OTP is enabled, you'll be asked for the code. Credentials are cached securely for future runs.
For non-interactive login (e.g., scripts or CI), use the two-phase flow:
# Phase 1: Send credentials, trigger SMS
rivian-ls login --email user@example.com --password secret
# Phase 2: Complete with OTP code after receiving SMS
rivian-ls login --otp 123456Navigation:
- Press
1,2,3, or4(ord,c,h) to switch between views - Press
vto open vehicle selection menu (multi-vehicle accounts) - Press
rto manually refresh data - Press
qorCtrl+Cto quit
Views:
- Dashboard (
1ord): Battery, range, charging status, locks, closures, cabin temp, tire pressures, ready score - Charge (
2orc): Detailed charging session info and history - Health (
3orh): Tire pressure trends and vehicle timeline - Charts (
4): Historical trends with ASCII sparklines- Battery Level (%)
- Range Estimate (mi)
- Charging Rate (kW)
- Cabin Temperature (°F)
- Energy Efficiency (mi/kWh)
- Press
←/→to switch metrics - Press
tto cycle time ranges (24h → 7d → 30d)
The CLI mode is designed for scripting, automation, and piping data to other tools.
# Interactive login (prompts for email, password, OTP)
rivian-ls login
# Non-interactive two-phase login:
# Phase 1 — send credentials, trigger SMS
rivian-ls login --email user@example.com --password secret
# Phase 2 — complete with OTP code after receiving SMS
rivian-ls login --otp 123456
# Using environment variables
RIVIAN_EMAIL=user@example.com RIVIAN_PASSWORD=secret rivian-ls login# Human-readable text output (default)
rivian-ls status
# JSON output for scripting
rivian-ls status --format json --pretty
# YAML output
rivian-ls status --format yaml --pretty
# CSV output
rivian-ls status --format csv
# Table output
rivian-ls status --format table# Stream updates continuously (WebSocket with auto-fallback to polling)
rivian-ls watch
# JSON output
rivian-ls watch --format json --pretty
# Force polling mode with 30-second interval
rivian-ls watch --interval 30s
# Note: WebSocket may fail due to Rivian API limitations - the tool automatically
# falls back to HTTP polling mode (30s interval) when this happens# Export all cached history as JSON
rivian-ls export --format json --pretty > vehicle-history.json
# Export last 100 records as CSV
rivian-ls export --limit 100 --format csv > history.csv
# Export data from the last 24 hours
rivian-ls export --since 24h --format yaml > last-24h.yaml--email <email>: Specify email (prompts if not provided, required in non-TTY mode)--password <password>: Specify password (prompts securely if not provided, required in non-TTY mode)--otp <code>: Provide MFA/OTP code to complete a two-phase login--vehicle <index>: Select vehicle by index (0-based, default: 0)--db <path>: Custom database path (default:~/.local/share/rivian-ls/state.db)--format <format>: Output format for CLI commands (text,json,yaml,csv,table)--pretty: Pretty-print JSON/YAML output--interval <duration>: Polling interval for watch mode (e.g.,30s,1m)--offline: Use cached data only (forstatuscommand)
0: Success1: Authentication failure (invalid credentials, OTP failed)2: Vehicle not found (no vehicles registered, invalid vehicle index)3: API error (network failure, Rivian API unavailable)4: Invalid arguments (bad flags, conflicting options, config errors)
Configuration can be provided via multiple sources. Priority order (highest to lowest):
- Command-line flags
- Environment variables
- Config file (
~/.config/rivian-ls/config.yaml) - Defaults
Create ~/.config/rivian-ls/config.yaml:
# Authentication (optional - will prompt if not provided)
email: your.email@example.com
# password: leave empty - prompting is more secure
# Storage
db_path: ~/.local/share/rivian-ls/state.db
disable_store: false # Set to true to prevent saving state history
# Vehicle selection
vehicle: 0 # 0-based index if you have multiple vehicles
# Polling interval for watch mode
poll_interval: 30s
# Output verbosity
quiet: false # Suppress informational messages
verbose: false # Enable debug loggingSee config.yaml.example for a complete example.
All config file options can be set via environment variables:
export RIVIAN_EMAIL="your.email@example.com"
export RIVIAN_PASSWORD="your-password" # Not recommended - use prompt instead
export RIVIAN_DB_PATH="/custom/path/to/state.db"
export RIVIAN_TOKEN_CACHE="/custom/path/to/credentials.json"
export RIVIAN_DISABLE_STORE="true"
export RIVIAN_POLL_INTERVAL="30s"
export RIVIAN_QUIET="true"
export RIVIAN_VERBOSE="true"Credentials are cached in ~/.config/rivian-ls/credentials.json. The cache includes:
- Email address
- Access token and refresh token
- Token expiration times
On subsequent runs, the tool will automatically use cached credentials. If tokens are expired, they'll be refreshed automatically. If refresh fails, you'll be prompted to log in again.
TUI Mode (Interactive):
- Press
vto open the vehicle selection menu - Navigate with arrow keys or numbers (1-9)
- Press Enter to confirm selection, Esc to cancel
- Switch vehicles at runtime without restarting
CLI Mode (Headless):
Use --vehicle <index> to select which vehicle on startup:
# Use first vehicle (default)
rivian-ls status --vehicle 0
# Use second vehicle
rivian-ls status --vehicle 1See CLAUDE.md for development workflow, testing, and architecture details.
rivian-ls/
├── cmd/rivian-ls/ # CLI entrypoint
├── internal/
│ ├── rivian/ # GraphQL + WebSocket client for Rivian API
│ ├── model/ # Domain models and state reducer
│ ├── tui/ # Bubble Tea TUI implementation
│ ├── cli/ # Headless CLI formatters and commands
│ └── store/ # Local snapshot persistence (SQLite/BoltDB)
├── docs/ # Additional documentation
└── .github/workflows/ # CI/CD pipelines
- Credentials: Never hardcoded or logged. Cached in
~/.config/rivian-ls/credentials.jsonwith0600permissions. - Tokens: Access/refresh tokens are stored securely and refreshed automatically. Never printed to stdout/stderr.
- Password input: Prefer
RIVIAN_PASSWORDenv var or interactive prompt over--passwordflag (flags are visible inpsoutput). Config files containing passwords must have0600permissions or the password is rejected. - Database: SQLite file created with
0600permissions. Contains vehicle telemetry including GPS coordinates. - Data: All data stored locally only (not sent to third parties).
- Privacy: Use
--no-storeflag to disable local persistence entirely. - Network: All API calls use TLS with certificate verification. No secrets in URLs.
- Ensure your email and password are correct
- If you have MFA enabled, ensure you enter the correct OTP code
- Check that you can log in via the official Rivian mobile app
- The app will automatically fall back to polling
- Check your network/firewall settings
- Try increasing
--intervalfor longer polling periods
- Ensure you have at least one vehicle registered in your Rivian account
- Try using
--vehicle <VIN>to select a specific vehicle
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch (
feat/...,fix/...,chore/...) - Write tests for new functionality
- Ensure
make checkpasses (linting + tests + coverage threshold) - Update documentation as needed
- Open a pull request against
main
MIT License - see LICENSE file for details.
This project is not affiliated with, endorsed by, or connected to Rivian Automotive, LLC. All product names, logos, and brands are property of their respective owners.


