A powerful, high-performance Go-based Command Line Interface (CLI) and Terminal User Interface (TUI) for managing Amazon Flex deliveries.
This tool directly interfaces with the Amazon Flex (Rabbit) APIs to authenticate, fetch itineraries, and securely spoof GPS coordinates for pickups, updates, and simulations. The built-in TUI Dashboard completely replaces the need to run commands one-by-one by providing an interactive, beautifully formatted routing interface.
- Interactive Dashboard (TUI): A gorgeous Terminal UI built with Bubble Tea (
charmbracelet/bubbletea), featuring custom styling, dynamic resizing, and alert modals. - Smart Grouping: Packages are automatically grouped by Recipient & Phone Number, cleaning up your view and showing exactly how many packages go to each stop.
- Advanced State Updates: Support for multiple API update states such as Picked Up, Business Closed, Address Not Found, Rescheduled, and Out of Delivery Time.
- Arabic Text Support: Seamlessly renders and shapes Arabic text (RTL) directly in the terminal, fixing standard terminal font corruption issues.
- Deep Data Drilldown: Press
Enteron any stop to pop open a detailed overlay showing package dimensions, exact weights, routing windows, order IDs, and even raw product image URLs. - Integrated Actions:
[p]Pickup: Automatically spoofs a GPS location in a 3-meter radius and sends a secure pickup request to the Amazon API.[b/n/C/o]Failures: Easily mark packages as Business Closed, No Address, Customer Rescheduled, or Out of Time.[S]Simulate: Safely simulate a pickup action.
- In-App Token Refresh: Seamlessly refresh expired Bearer tokens directly from the dashboard without having to drop back into the shell.
Ensure you have Go installed on your machine.
# 1. Clone the repository
git clone https://github.com/eslam0ebrahem/amazon-flex-cli.git
cd amazon-flex-cli
# 2. Download Go dependencies
go mod tidy
# 3. Build the CLI binary
go build -o flexcliBefore using the API, you must log in to generate an active Bearer token. The token and session information are saved securely in the local DB/ folder.
./flexcli login <your-email> <your-password>The dashboard is the main entry point for managing your active route.
./flexcli dashboardDashboard Keybindings:
Up/Downorj/k: Navigate packagesEnter: Open expanded package detailsr: Refresh the itinerary from Amazon Flex servers1/2/3: Filter view byPending/Picked Up/All/: Open search bar (Search by ID, Address, Phone, or Name)p: Send a Pickup request (PICKED_UP)b: Mark as Business Closed (BUSINESS_CLOSED)n: Mark as Address Not Found (ADDRESS_NOT_FOUND)C: Mark as Customer Rescheduled (RESCHEDULED_BY_CUSTOMER)o: Mark as Out of Delivery Time (OUT_OF_DELIVERY_TIME)c: View/Copy customer Phone NumberS: Simulate an actionEsc: Close details overlay or cancel searchqorCtrl+C: Quit application
If you prefer not to use the interactive dashboard, standard commands are still supported:
# General / Drivers
./flexcli phone # Get driver phone numbers
./flexcli assignments # List upcoming schedule assignments
./flexcli tours # List driver tours
./flexcli instant-offers # Interact with Instant Offers
./flexcli active # View active device sessions
./flexcli nonce # Generate an App Attestation Nonce
# Itinerary & Packages
./flexcli packages # Fetch and save latest itinerary to DB/
./flexcli list # List all packages in a simple terminal output
# Updates
./flexcli pickup <scannable_id> <lat> <lon> # Record a manual pickup
./flexcli update <scannable_id> <state_key> # Update package with a state key (pickup, closed, no-address, etc.)cmd/: Cobra CLI commands (e.g.dashboard.go,update_package.go,login.go)pkg/api/: Amazon Flex API HTTP interaction payloads (Itinerary, Actions, Device, Tokens)pkg/config/: Configuration schemas, headers, and token I/O logicpkg/itinerary/: Structs and parsers for unpacking complex Amazon Rabbit JSONpkg/ui/: TUI helper functions (likeui.FixArabicand JSON physical stat formatters)DB/: (Git-ignored) Stores your generated tokens and itineraries
This software intercepts and interacts with internal Amazon APIs. It is meant for educational and research purposes only. The user assumes all responsibility for adhering to Amazon Flex's Terms of Service.