flights-search-cli
flights-search-cli copied to clipboard
Search flights from your command line
flights-search-cli

Search flights from the command line!
Install
npm install flights-search-cli --global
Usage
flights searchtriggers the command line tool- Follow the instructions to
- Select what airport you're flying from
- Select what airport you're flying to
- The departure date range that you're searching over
- The departure time of day you're searching over (i.e. "I only want to look for flights between 3-6 PM")
- Select if you only want to look at round-trip flights
- Select maximum total price of flights in USD
- Select if you only want to look at direct flights
- You'll (hopefully) get a list of flights - after selecting one, you'll be taken to a
kiwi.combooking page

Specifying Command Line Arguments
- Instead of following the prompts every single time, you can also take advantage of the following command line arguments
-s <IATA Airport Code>or--start-airport <IATA Airport Code>sets the departure airport- Like
-s SFOor--start-airport SFO
- Like
-e <IATA Airport Code>or--end-airport <IATA Airport Code>sets the arriving airport-e SFOor--end-airport SFO
-l <Departure Window>or--leaving-between <Departure Window>sets the date(s) or datetime(s) for departure- Like
-l 2019-09-01or--leaving-between 2019-09-01 - Can specify a start and an end to a window using the
|delimiter like (-l "2019-09-01|2019-09-07") - Can also specify a datetime window like
-l "2019-09-01T11:30|2019-09-07T14:30"which would look at all departure times between11:30 AMon2019-09-01to2:30 PMon2019-09-07 - Dates need to follow the HTML5 date format (
YYYY-MM-DD) and datetimes need to follow the HTML5 datetime format (YYYY-MM-DDTHH:mm)
- Like
-r <Departure Window>or--returning-between <Departure Window>works exactly the same as the--leaving-betweenargument, except for return flights-$ <price>or--max-price <price>filters out tickets above a certain price inUSD- Like
-$ 500or--max-price 500
- Like
-dor--direct-flightfilters out flights that are not direct- It's a boolean flag, so simply specifying the flag is sufficient - there does not need to be a value associated with the argument
-1or--one-wayonly calculates flights from the departing airport to the arrival airport- If a returning departure window is specified and this boolean flag is specified, the returning departure window will take precedence
Development
flights-search-cli uses nvm to manage node and npm versions.
Ensure that you have nvm installed, and have the correct node version defined in the .nvmrc file.
To build the project locally
- Execute the
compilecommand defined in thepackage.jsonfile- This should execute the Babel transpilation process and output files to the
builddirectory
- This should execute the Babel transpilation process and output files to the
- Execute the
npm linkcommand- This should symlink the
binexecutable file (build/executables/flights.js)
- This should symlink the
- Execute any of the commands (like
flights search)
After making changes to the source code, you will need to rebuild the project and re-link the updated build files in order to test any changes you've made to the source code.
Git Hooks
This project uses husky to maintain git hooks.
pre-commit- run source code linting and commit message linting
Commit Linting
This project uses semantic-release and commitlint (specifically the Angular commit convention) to automatically enforce semantic versioning.
Why kiwi.com?
Because they provide a pretty simple REST API to search for flights.