A powerful command-line tool for tracking device location across multiple platforms. Track your Linux, macOS, Windows, Android, or iOS device with ease using free or self-hosted tracking providers.
π Quick Start: Install in 2 minutes | π Free Forever | π Works Everywhere | π Privacy-Focused
π Multi-Provider Support
- Traccar (Free demo server + self-hosted)
- OwnTracks (Privacy-focused MQTT/HTTP)
- PhoneTrack (Nextcloud integration)
- GPSLogger (Custom HTTP endpoints)
π‘ Flexible Location Sources
- IP-based geolocation (works anywhere)
- GPS hardware support (via gpsd)
- Automatic fallback mechanisms
πΊοΈ Web-Based Tracking
- Real-time map visualization
- Shareable tracking URLs
- Works on any device with a browser
βοΈ Highly Configurable
- Adjustable update intervals
- Background tracking daemon
- Privacy-focused local storage
π¨ User-Friendly Interface
- Colorful CLI output with emojis
- Simple command structure
- Comprehensive help system
π Location History
- Track last 50 locations
- Timestamped entries
- Easy history review
π Privacy & Security
- All configuration stored locally
- Self-hosted options available
- No data sharing required
Core Dependencies:
bash(version 4.0+)curl(for API requests)jq(for JSON parsing)
Optional:
gpsdandcgps(for GPS hardware support)
Debian/Ubuntu/Kali:
sudo apt-get update
sudo apt-get install -y bash curl jq
# Optional: for GPS hardware
sudo apt-get install -y gpsd gpsd-clientsmacOS:
brew install bash curl jq
# Optional: for GPS hardware
brew install gpsdArch Linux:
sudo pacman -S bash curl jq gpsdcd /home/kali/labs
git clone https://github.com/yourusername/gps-cli.git
cd gps-cli
./install.sh# Make script executable
chmod +x gps
# Create symlink
mkdir -p ~/.local/bin
ln -s $(pwd)/gps ~/.local/bin/gps
# Add to PATH (if not already)
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc # or ~/.bashrc
source ~/.zshrcgps helpgps setupChoose Traccar (option 1), select the FREE demo server, and give your device a name (e.g., "my-laptop" or "gps-tracker")!
The device name will be used to identify your device in the Traccar dashboard.
gps startgps urlOpen the URL in any web browser to see your device on a map!
gps statusgps stop| Command | Alias | Description |
|---|---|---|
gps setup |
- | Configure tracking provider |
gps start |
- | Start GPS tracking |
gps stop |
- | Stop GPS tracking |
gps status |
s |
Show tracking status and location |
gps url |
link |
Display tracking URL |
gps config |
configure |
Configure update interval |
gps history |
h |
Show location history |
gps providers |
list |
List available providers |
gps help |
-h, --help |
Show help message |
Start tracking with default settings:
gps startCheck your current status:
gps statusGet tracking URL to share:
gps urlChange update interval to 30 seconds:
gps config
# Enter: 30View location history:
gps historyList all providers:
gps providersBest for: Everyone - Easiest setup with free demo server
Setup:
- Run
gps setup - Select option
1(Traccar) - Select option
1(Free demo server) - Enter a device name (e.g., "gps-tracker") or press Enter for auto-generated name
- Done! Your tracking URL will be displayed
Features:
- β Free demo server (no registration)
- β Web-based map interface
- β Real-time tracking
- β Custom device names for easy identification
- β Osmand protocol for better device management
- β Self-hosted option available
Web Interface:
- Demo server: https://demo2.traccar.org
- Login not required for viewing
- Just use your device ID in the URL
Self-Hosting Traccar:
# Docker installation
docker run -d --name traccar \
-p 8082:8082 \
-p 5055:5055 \
traccar/traccar:latestThen configure GPS CLI to use http://your-server:8082
Best for: Privacy-conscious users with technical expertise
Requirements:
- MQTT broker (Mosquitto) or HTTP endpoint
- Self-hosted OwnTracks Recorder for web interface
Setup:
- Install Mosquitto MQTT broker
- Install OwnTracks Recorder
- Run
gps setupand select OwnTracks - Enter your endpoint URL
Installation (Server):
# Install Mosquitto
sudo apt-get install mosquitto mosquitto-clients
# Install OwnTracks Recorder
# See: https://github.com/owntracks/recorderFeatures:
- β End-to-end encryption
- β Privacy-focused
- β MQTT or HTTP support
β οΈ Requires own server
Best for: Nextcloud users
Requirements:
- Nextcloud instance
- PhoneTrack app installed
Setup:
- Install PhoneTrack on your Nextcloud
- Create a tracking session
- Get session token from PhoneTrack
- Run
gps setupand select PhoneTrack - Enter Nextcloud URL and session token
Installation (Nextcloud):
# Install via Nextcloud app store or:
sudo -u www-data php occ app:install phonetrackFeatures:
- β Integrated with Nextcloud
- β Session-based tracking
- β Privacy-first design
β οΈ Requires Nextcloud
Best for: Custom integrations and developers
Requirements:
- HTTP endpoint that accepts POST requests
Setup:
- Set up your custom endpoint
- Run
gps setupand select GPSLogger - Enter endpoint URL and auth token
Example Backend (Node.js/Express):
app.post('/gps/update', (req, res) => {
const { device_id, latitude, longitude, timestamp } = req.body;
// Store location in your database
res.json({ success: true });
});Features:
- β Maximum flexibility
- β Custom integrations
- β Any HTTP endpoint
β οΈ DIY implementation
Option 1: Traccar Client (Recommended)
- Install "Traccar Client" from Google Play Store
- Open app β Settings
- Set Device Identifier to your GPS CLI device ID
- Set Server Address:
https://demo2.traccar.org:5055 - Start tracking
Option 2: GPSLogger for Android
- Install "GPSLogger" from F-Droid or Google Play
- Configure custom URL endpoint
- Enable automatic logging
OwnTracks for iOS
- Install "OwnTracks" from App Store
- Configure HTTP endpoint or MQTT broker
- Set device ID and credentials
- Start tracking
- Traccar Manager - iOS/Android management app
- PhoneTrack - Nextcloud mobile app
- Any app that can POST to HTTP endpoints
All configuration is stored in ~/.config/gps-cli/:
config.json- Main configurationhistory.json- Location historygps.log- Application logs.env- Provider credentials (optional)tracker.pid- Background process ID
Copy .env.sample to ~/.config/gps-cli/.env for advanced configuration:
cp .env.sample ~/.config/gps-cli/.env
nano ~/.config/gps-cli/.envKey Settings:
# Update interval (seconds)
UPDATE_INTERVAL=60
# GPS source (auto, ip, hardware)
GPS_SOURCE=auto
# Provider selection
GPS_PROVIDER=traccar# Interactive configuration
gps config
# Common intervals:
# 30 = 30 seconds (high frequency)
# 60 = 1 minute (default, balanced)
# 300 = 5 minutes (battery saving)
# 600 = 10 minutes (low frequency)Check dependencies:
which curl jqCheck configuration:
cat ~/.config/gps-cli/config.jsonCheck logs:
tail -f ~/.config/gps-cli/gps.logVerify background process:
gps statusCheck IP geolocation APIs:
curl -s https://ipapi.co/json/ | jqRestart tracking:
gps stop
gps startTraccar demo server:
- URL format:
https://demo2.traccar.org/?id=YOUR_DEVICE_NAME - Device must send at least one location update first
- Wait 1-2 minutes after starting tracking
- Device will appear in the dashboard with the name you chose during setup
Self-hosted:
- Verify server is accessible
- Check firewall rules
- Ensure correct port configuration
Make script executable:
chmod +x ~/.local/bin/gpsCheck PATH:
echo $PATH | grep .local/binInstall gpsd:
sudo apt-get install gpsd gpsd-clientsCheck GPS device:
lsusb # Look for GPS device
cgps # Test GPS receptionStart gpsd:
sudo gpsd /dev/ttyUSB0 -F /var/run/gpsd.sock- Local only: All configuration stored in
~/.config/gps-cli/ - No cloud sync: Data never leaves your device (unless you configure it)
- Open source: Audit the code yourself
- Approximate: City-level accuracy (5-50km radius)
- Third-party APIs: ipapi.co and ip-api.com
- Limited data: Only IP address sent to geolocation APIs
- Fallback: Multiple providers for reliability
| Provider | Privacy Level | Data Storage | Encryption |
|---|---|---|---|
| Traccar (demo) | Demo server | HTTPS | |
| Traccar (self-hosted) | β Private | Your server | HTTPS |
| OwnTracks | β Private | Your server | End-to-end |
| PhoneTrack | β Private | Your Nextcloud | HTTPS |
| GPSLogger | π€· Depends | Your endpoint | Your choice |
- For maximum privacy: Use self-hosted OwnTracks or Traccar
- For testing: Traccar demo is fine (temporary use)
- For existing setup: PhoneTrack if you already use Nextcloud
- For custom needs: GPSLogger with your own backend
- Fully supported
- All providers available
- GPS hardware support via gpsd
- Fully supported
- All providers available
- Limited GPS hardware support
- Supported via WSL or MSYS2
- All providers available
- No GPS hardware support
- Use Traccar Client app
- Configure with same device ID
- Points to same tracking URL
- Use OwnTracks app
- Requires MQTT/HTTP setup
- Alternative: Traccar iOS app
- Track your laptop when traveling
- Find lost devices
- Monitor device location history
- Track company equipment
- Monitor fleet vehicles (with GPS hardware)
- Logistics and delivery tracking
- Test location-based applications
- Simulate device movement
- API integration testing
- Emergency location tracking
- Anti-theft monitoring
- Backup location tracking
Contributions are welcome! Here's how you can help:
- Report bugs: Open an issue
- Suggest features: Start a discussion
- Submit PRs: Fork, code, and create pull request
- Improve docs: Fix typos, add examples
- Share providers: Add support for new tracking services
This project is free and open-source. Use, modify, and distribute as you wish.
- Traccar: Excellent open-source GPS tracking platform
- OwnTracks: Privacy-focused location tracking
- PhoneTrack: Great Nextcloud integration
- IP Geolocation APIs: ipapi.co and ip-api.com
- Documentation: This README
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Logs: Check
~/.config/gps-cli/gps.log
- Device naming support
- Osmand protocol for Traccar
- Improved IP geolocation stability
- Better error handling and timeouts
- JSON parsing fixes
- Enhanced GPS hardware support
- Multiple device tracking
- Geofencing alerts
- Export location data (CSV, KML)
- Web dashboard
- Bluetooth beacon support
- Wi-Fi positioning
- Battery optimization modes
- Encryption for all providers
- Mobile app companion
Current version: 0.2.0
See CHANGELOG.md for version history.
Made with β€οΈ for privacy-conscious device tracking
π°οΈ Track responsibly | π Privacy matters | π Location everywhere