We’d like to introduce you to the Mapbox CLI, the command line interface to Mapbox web services. It’s for users who want to automate their use of Mapbox APIs without committing to writing a full application with our SDKs.
The command line is a powerful tool for technical users and allows you to quickly prototype ideas, script them and compose them with a rich set of existing command line applications. For example, if you want to geocode a single place name and map the results using geojson.io:
mapbox geocoding "Portland" | geojsonio
Or you may have a GeoJSON file that you want to upload as a new tileset to your Mapbox Studio account:
mapbox upload perrygeo.ballparks --name "Ballparks" ballparks.geojson
The Mapbox CLI allows you to compose data pipelines backed by our APIs, with a concise syntax that can be fully scripted and automated. Beyond geocoding and uploads, here’s a small taste of some other interesting use cases:
- get turn-by-turn directions between two locations.
- generate static map images from our latest high-resolution satellite imagery.
- create a distance matrix to optimize routing between multiple locations.
- correct GPS tracks by matching them to OpenStreetMap.
- generate elevation profiles from a GPS track.
If you’re interested in trying it out,
check out the installation and setup docs for
details and visit mapbox-cli-py
on GitHub.
Let us know how you could use the Mapbox CLI in your next project.