The flights command searches for available flights on a specific departure date, with optional return date for round-trip searches.
Syntax
fli flights ORIGIN DESTINATION DEPARTURE_DATE [OPTIONS]
Required arguments
ORIGIN - Departure airport IATA code (e.g., JFK, LAX, LHR)
DESTINATION - Arrival airport IATA code
DEPARTURE_DATE - Travel date in YYYY-MM-DD format
Options
Return date
Specify a return date for round-trip searches. Date must be in YYYY-MM-DD format.
Default: None (one-way search)
Example:
fli flights JFK LHR 2025-10-25 --return 2025-11-01
Departure time window
Filter flights by departure time using 24-hour format. Specify as START-END (e.g., 6-20 for 6 AM to 8 PM).
Default: Any time
Example:
fli flights SFO NYC 2025-10-25 --time 6-20
Airlines
--airlines CODES, -a CODES
Filter by specific airlines using IATA codes. Provide multiple codes separated by spaces.
Default: All airlines
Example:
fli flights JFK LHR 2025-10-25 --airlines BA AA UA
Cabin class
Specify the cabin class for the search.
Options:
ECONOMY (default)
PREMIUM_ECONOMY
BUSINESS
FIRST
Example:
fli flights LAX NRT 2025-11-15 --class BUSINESS
Maximum stops
Filter by maximum number of stops.
Options:
ANY (default) - Any number of stops
0 or NON_STOP - Non-stop flights only
1 or ONE_STOP - Maximum one stop
2+ or TWO_PLUS_STOPS - Two or more stops
Example:
fli flights JFK SFO 2025-10-25 --stops 0
Sort order
--sort CRITERIA, -o CRITERIA
Sort results by specified criteria.
Options:
CHEAPEST (default) - Lowest price first
DURATION - Shortest duration first
DEPARTURE_TIME - Earliest departure first
ARRIVAL_TIME - Earliest arrival first
Example:
fli flights BOS LAX 2025-10-25 --sort DURATION
Examples
One-way economy flight
fli flights JFK LAX 2025-10-25
Searches for one-way economy flights from New York JFK to Los Angeles LAX on October 25, 2025.
Round-trip with return date
fli flights JFK LHR 2025-10-25 --return 2025-11-01
Searches for round-trip flights from New York to London, departing October 25 and returning November 1.
Business class non-stop flights
fli flights SFO NRT 2025-11-15 --class BUSINESS --stops 0
Searches for non-stop business class flights from San Francisco to Tokyo Narita.
Morning flights on specific airlines
fli flights LAX JFK 2025-10-25 --time 6-12 --airlines AA DL UA
Searches for morning flights (6 AM - 12 PM) from Los Angeles to New York on American, Delta, or United.
Fastest flights regardless of price
fli flights BOS SFO 2025-10-25 --sort DURATION
Searches for flights from Boston to San Francisco, sorted by shortest duration.
Complete example with multiple filters
fli flights JFK LHR 2025-10-25 \
--return 2025-11-01 \
--class PREMIUM_ECONOMY \
--time 18-23 \
--airlines BA AA \
--stops 0 \
--sort DEPARTURE_TIME
Searches for:
- Round-trip flights from JFK to LHR
- Premium economy class
- Evening departures (6 PM - 11 PM)
- British Airways or American Airlines only
- Non-stop flights
- Sorted by earliest departure time
The command displays results in formatted terminal tables showing:
┌─ Option 1 of 10 ─────────────────────────────────────────┐
│ Round-trip Flight Option 1 │
│ │
│ Total Price $1,245.80 │
│ Outbound Price $632.40 │
│ Return Price $613.40 │
│ Total Duration 14h 30m │
│ Total Stops 0 │
│ │
│ ╭─ Outbound Flight Segments ───────────────────────╮ │
│ │ Airline │ Flight │ From │ Departure │...│ │
│ │ British │ BA112 │ JFK (John F. │ 18:30 │...│ │
│ │ Airways │ │ Kennedy Intl) │ 25-Oct │...│ │
│ ╰──────────────────────────────────────────────────╯ │
│ │
│ ╭─ Return Flight Segments ─────────────────────────╮ │
│ │ Airline │ Flight │ From │ Departure │...│ │
│ │ British │ BA113 │ LHR (London │ 10:30 │...│ │
│ │ Airways │ │ Heathrow) │ 01-Nov │...│ │
│ ╰──────────────────────────────────────────────────╯ │
└───────────────────────────────────────────────────────────┘
Each flight option includes:
- Total price and breakdown (for round-trips)
- Total duration and stops
- Detailed segment information with airlines, flight numbers, airports, and times
Airport names are truncated to the first three words for readability in the terminal output.
Error handling
The command validates inputs and provides clear error messages:
Invalid date format:
Error: Date must be in YYYY-MM-DD format
Invalid airport code:
Error: Invalid airport code: XYZ
Invalid time range:
Error: Time range must be in format 'start-end' (e.g., 6-20)
No flights found:
Tips
Use the shorthand syntax without the flights command for faster searches:
Combine --time and --sort DEPARTURE_TIME to find the earliest available flights in your preferred time window.
For flexible travel, use the dates command to find the cheapest dates before searching specific flights.