1 unstable release
| 0.1.0 | Oct 4, 2025 |
|---|
#1908 in Command line utilities
20KB
110 lines
geo-loc
A command-line utility to print the host's current geographic location in a pipe-friendly format. It queries native location services (CoreLocation on macOS, GeoClue on Linux) or falls back to IP-based geolocation, outputting in human-readable or machine-parseable formats.
Why?
Many location tools are GUI-based or verbose. geo-loc follows Unix principles: silent operation, clean exit codes, and output suitable for scripting and pipelines. It's designed for automation, monitoring, or quick location checks without opening browsers or editing files.
Installation
From Crates.io (when published)
cargo install geo-loc
From Source
git clone <repo>
cd geo-loc
cargo build --release
make install # For system-wide install
# or make local-install # For user install
Usage
Get your location:
geo-loc
# Output: 58.5054 15.9724
For detailed options, formats, providers, and examples, see the man page:
man geo-loc # After system install
# or
man ./geo-loc.1 # From source
License
BSD 3-Clause
Dependencies
~9–24MB
~295K SLoC