My first attempt at building a CLI tool
A simple CLI tool to search paths on google maps. The intent is to use this on your most often taken paths to quickly get the grasp of the time needed for your travel - like going home from the office every day.
npm install -g cli-path
or
yarn add -g cli-path
These will add the global executable clip
To use our built in api, select the “Authentication” option from the interactive menu.

Then you can search for a direction informaiton using free text



Update application config parameters

The real reason I built this is for training purposes. Since every tutorial out there is trying to teach you how to increase one certain skill vertically, with this project I’m trying to expand vertically by touching as many technologies possible for this humble subject of making a Google Maps API call 🙂
The very zoomed out explanation is: a cli-app will call a maps API to view directions information within the terminal. In order to not have the user generate and add his own map provider tokens, a second API is built which stands in between the cli-app and the map provider. This way the user can choose to use our instantly available Clip API, or query a provider directly with his own credentials.
The CLI picks between the two through an Adapter (PathController), so swapping what sits behind the hosted API doesn’t change the client.
Note — the API tier was rebuilt. The original implementation was AWS Lambda via the Serverless Framework; it is now frozen in
archived-sls-api/and no longer deployed. Its replacement,vercel-api/, is live on Vercel Functions athttps://cli-path.vercel.app/api/, backed by OpenRouteService instead of Google Maps — chosen because it hard-fails with429past its free tier rather than billing, which the Google-backed archived API could not guarantee. The CLI’s defaultclipengine points at it.
archived-sls-api/ARCHIVED.md
Scan on every request doesn’t scalevercel-api/
docs/swagger/
vercel-api/vercel.json rewrites /docs/* on the live API to this same page, so it’s reachable same-origin at cli-path.vercel.app/docs without a second copyclient_id as the CLI’s device flow) instead of pasting one in manually — see postman/schemas/index.yaml’s auth0 security scheme and docs/swagger/dist/swagger-initializer.js’s initOAuth() callcli-path.vercel.app/docs copy, which is same-origin with /api/*. The GitHub Pages copy is a different origin and gets a CORS error on any actual call; it’s still fine for browsing the spec and even for getting a token, just not for calling the live endpointsopenspec/specs/ — cli-command-dispatch, cli-device-authentication, cli-engine-adapter and cli-persistent-config describe the client tier; directions-api and usage-quota describe the API once add-vercel-ors-api archivescli-app to npm now that the live API is pointed at correctlyJust to be clear, these are worth mentioning to my future self so that I don’t do these mistakes again
required: [], instead of deleting the required field completely