The Geocodio CLI is a free, open-source command-line tool for geocoding addresses, reverse geocoding coordinates, calculating distances, and batch processing spreadsheets. It runs on Linux, macOS, and Windows. All Geocodio features are available, including data appends like Census tracts, Congressional districts, and timezones.
The Geocodio CLI gives you direct access to the Geocodio API from your terminal. Instead of writing code or uploading spreadsheets through the dashboard, you can geocode addresses, look up coordinates, calculate driving distances, and process large CSV files with a single command.
It is built for developers, data engineers, and analysts who want to work with location data without leaving the command line.
The CLI is open source and written in Go. The source code is available on GitHub.
Run the install script to download the latest release for your platform:
curl -fsSL https://raw.githubusercontent.com/geocodio/geocodio-cli/main/install.sh | sh
curl -fsSL https://raw.githubusercontent.com/geocodio/geocodio-cli/main/install.sh | sh -s -- --version v2.0.1
go install github.com/geocodio/geocodio-cli/cmd/geocodio@latest
Pre-built binaries for Linux, macOS, and Windows are available on the GitHub releases page.
All commands require a Geocodio API key. Generate one for free from the Geocodio Dashboard.
Set your API key as an environment variable:
export GEOCODIO_API_KEY=your-api-key
Add this line to your shell profile (~/.bashrc, ~/.zshrc, etc.) so it persists across sessions.
You can also pass the key directly with --api-key on any command.
The Geocodio CLI supports all major Geocodio features:
All of the data append fields available through the API work with the CLI, including Census data, Congressional districts, timezones, school districts, and more.
geocodio geocode "1600 Pennsylvania Ave NW, Washington DC"
Add data appends with the --fields flag:
geocodio geocode "30 Rockefeller Plaza, New York NY" --fields timezone,cd
Create a text file with one address per line, then:
geocodio geocode --batch addresses.txt
The batch endpoint accepts up to 10,000 addresses per request.
geocodio reverse "38.8976,-77.0365"
Batch reverse geocoding works the same way. Create a file with one lat,lng pair per line:
geocodio reverse --batch coordinates.txt
From one origin to one or more destinations:
geocodio distance "Washington DC" "New York" "Boston" "Philadelphia"
Use --mode driving for driving distance and duration, or --mode straightline for straight-line distance. Use --units km for kilometers.
Calculate distances between multiple origins and multiple destinations:
geocodio distance-matrix --origins origins.txt --destinations destinations.txt
For large distance calculations, create a background job and check on it later:
geocodio distance-jobs create --name "Warehouse routing" --origins origins.txt --destinations destinations.txt --watch
The --watch flag shows a progress bar until the job completes. List, check status, download results, or delete jobs with the distance-jobs subcommands.
Upload a CSV or Excel file for batch geocoding:
geocodio lists upload data.csv --direction forward --format "{{A}}, {{B}}, {{C}}"
The --format flag maps your columns to address components. {{A}} is the first column, {{B}} is the second, and so on.
Watch progress, then download results:
geocodio lists status 12345 --watch
geocodio lists download 12345 --output geocoded.csv
The CLI supports three output formats:
--json): Full API response for scripting and piping to tools like jq--agent): Clean markdown tables for AI coding assistants and LLMsThe Geocodio CLI fits naturally into automated pipelines:
The Geocodio CLI includes a skill file that teaches AI coding assistants how to use it. Once installed, assistants like Claude Code, Cursor, Amp, and Codex can geocode addresses, calculate distances, and process spreadsheets on your behalf.
Install the skill:
npx skills add geocodio/geocodio-cli
The skill activates automatically when you ask your assistant to work with addresses or location data.
If you used the previous version of the CLI, here are the key changes in v2.0:
geocodio lists (e.g., lists upload, lists status, lists download)--direction flag (forward or reverse) is now required when uploading spreadsheets--follow flag has been renamed to --watch--apikey flag has been renamed to --api-keygeocode, reverse, distance, distance-matrix, and distance-jobsSee the full migration guide on GitHub.
"API key required": Set GEOCODIO_API_KEY as an environment variable or pass --api-key on the command.
"batch size exceeds maximum of 10,000": Split your file into smaller chunks. The batch endpoints accept up to 10,000 items per request.
"invalid coordinate format": Reverse geocoding expects lat,lng format. Latitude comes first.
Debugging: Use --debug to see full HTTP request and response details.
The Geocodio CLI is open source under the MIT license. Contributions, issues, and feature requests are welcome on GitHub.