Skip to content
jgaleaPublic

About

Unofficial CLI for Uber rides: fare estimates, trip history, live status and scheduled rides from the terminal

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

uber-cli

Python License Built by RebelCode

Unofficial CLI for Uber rides. Fare estimates, trip history, live status, and scheduled rides from the terminal.


Overview

uber talks to m.uber.com/go/graphql, the GraphQL endpoint the rider web app uses. The queries in uber/queries.py are the web app's own operations (Products, Activities, GetStatus, SavedPlaces, PudoLocationSearch, TripRequest, TripCancel), trimmed to the fields the CLI renders.

It needs your own logged-in session. The cookie lives in the macOS Keychain and is never written to disk or printed.

Every command supports --json (data to stdout, logs to stderr) and --toon (fewer tokens, for agents).

Commands

uber <command> [flags]

  login                         paste the m.uber.com cookie into the Keychain
  logout
  places                        Uber saved places (Home, Work) and local aliases
  places add <name> <address>   add a local alias
  places rm <name>
  estimate <from> <to>          products and upfront fares [--at ISO] [--seats N]
  ride <from> <to>              request now (dry run; --confirm books)
  schedule <from> <to> --at ISO reserve for later (dry run; --confirm books)
  status                        live trip + upcoming reservations
  cancel [<trip-id>]            cancel (dry run; --confirm cancels)
  history                       past trips [--limit N] [--all]
  version

PLACES
  home, work                    your Uber saved places, matched by label or tag
  <alias>                       anything added with `uber places add`
  38.7139,-9.1394                 raw coordinates
  anything else                 searched through Uber's own autocomplete

FLAGS
  --json                        raw JSON to stdout, logs to stderr
  --toon                        TOON output, fewer tokens for agents

ENV
  UBER_CONFIG_DIR               override ~/.uber (aliases only; no secrets)
  UBER_COOKIE                   cookie header, bypasses the Keychain
  UBER_DEBUG=1                  dump requests and responses to stderr

Login

Log in to m.uber.com in your browser, open DevTools, and copy the cookie request header from any /go/graphql request (Network tab, Request Headers). Then:

uber login            # paste at the hidden prompt
pbpaste | uber login  # or straight from the clipboard

The CLI checks the cookie with one read-only call (your saved places) before storing it. A bare sid value is accepted too, but the full header is the safer bet. Sessions last weeks; when Uber starts answering with auth errors, run uber login again. uber logout removes it.

Estimates and booking

uber estimate home "LIS Terminal 2"
uber estimate home work --at 2026-09-25T07:30
uber ride home "Praia da Rainha" --product UberX
uber schedule home "LIS Terminal 2" --at 2026-09-25T07:30 --product Comfort --confirm

ride and schedule are dry runs by default: they resolve both places, fetch the live fare, print product, fare, pickup time and both addresses, and stop. Only --confirm sends the request. cancel works the same way.

Booking sends TripRequest, built the way the web app builds it (fare token from Products, your last-used payment method from CurrentUser). Estimates, history, status and places have been exercised against a live account; the booking and cancel mutations have not, because testing them means paying for a ride. Treat the first --confirm as a test and keep the app open.

Exit codes

code meaning
4 blocked by a bot challenge
5 no session, or it expired
6 a place could not be resolved
7 trip or product not found
8 Uber returned an error
9 refused to book (unavailable product, no payment method)

Install

git clone https://github.com/jgalea/uber-cli.git
cd uber-cli
uv tool install .
uber version

License

MIT. See LICENSE.

Author: Jean Galea. Unofficial project, not affiliated with or endorsed by Uber. It talks to the same endpoints m.uber.com uses in your browser, so use it at a sane request rate.

About

Unofficial CLI for Uber rides: fare estimates, trip history, live status and scheduled rides from the terminal

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages