olh is a Go CLI for the Open Location Hub REST and WebSocket APIs.
Current scope:
- CRUD for
zones,trackables,providers, andfences - collection
summaryanddelete-alloperations for core resources - location and proximity ingest
- transient-state inspection for locations, motions, sensors, fences, and providers
- zone transform and derived-fence helpers
- JSON-RPC discovery and invocation
- WebSocket subscribe and publish
loginflow that validates hub and OAuth settings and saves them- human-readable output by default
- machine-readable JSON with
--json - automatic OAuth token fetch from
~/.openlocationhub.envorOLH_*environment variables
Install olh via Homebrew:
brew tap jillesvangurp/tap
brew install jillesvangurp/tap/open-location-hub-cliBash and Zsh completions are installed automatically.
just build
just build-allArtifacts are written to dist/.
Build and package a release locally:
just clean
VERSION=0.1.0 just package-releasePackaged archives and checksums.txt are written to release/.
Publish the GitHub release by pushing a matching tag:
git tag 0.1.0
git push origin 0.1.0The release workflow uploads the packaged files and uses GitHub-generated release notes.
The CLI resolves auth configuration in this order:
- explicit command-line flags
- process environment variables
~/.openlocationhub.env
All commands accept the global flags for these values. Common aliases:
--hub-endpointor--base-url--token-endpointor--oauth-token-url--client-idor--oauth-client-id--client-secretor--oauth-client-secret
Supported variables:
OLH_BASE_URL=http://localhost:8080
OLH_TOKEN=
OLH_OAUTH_TOKEN_URL=http://localhost:5556/dex/token
OLH_OAUTH_CLIENT_ID=open-location-cli
OLH_OAUTH_CLIENT_SECRET=cli-secret
OLH_OAUTH_USERNAME=admin@example.com
OLH_OAUTH_PASSWORD=testpass123
OLH_OAUTH_SCOPE=openid email profile
OLH_OAUTH_GRANT_TYPE=password
OLH_OAUTH_AUDIENCE=If OLH_TOKEN is empty and OAuth settings are present, olh fetches an access token automatically before REST and WebSocket operations.
Save validated settings:
olh login \
--hub-endpoint http://localhost:8080 \
--token-endpoint http://localhost:5556/dex/token \
--client-id open-location-cli \
--client-secret cli-secret \
--oauth-username admin@example.com \
--oauth-password testpass123Fetch just the token:
olh auth tokenolh zones list
olh zones summary
olh zones transform 0190c9d2-6f54-7ccf-8f55-f34eb0bf01f1 -f point.json
olh zones create-fence 0190c9d2-6f54-7ccf-8f55-f34eb0bf01f1
olh zones get 0190c9d2-6f54-7ccf-8f55-f34eb0bf01f1
olh trackables create -f trackable.json
olh trackables motions
olh trackables location 0190c9d2-6f54-7ccf-8f55-f34eb0bf01f1
olh providers sensors uwb-sim-demo
olh providers update-location uwb-sim-demo -f location.json
olh locations list
olh locations replace -f locations.json
olh locations post -f locations.json
olh proximities replace -f proximities.json
olh locations stream > location_updates.ndjson
olh locations stream --create-trackables > location_updates.ndjson
olh trackables stream > trackable_motions.ndjson
olh fences stream > fence_events.ndjson
olh collisions stream > collision_events.ndjson
./scripts/replay_simulated_tag_1.sh
olh rpc available
olh rpc call -f request.json
olh ws subscribe --topic location_updates --param provider_id=uwb-sim-demo
olh ws publish --topic location_updates -f locations.jsonReplay the simulated-tag-1 verification sequence. The script first posts an
outside point to reset fence state, then replays the three inside updates with
3-second spacing:
./scripts/replay_simulated_tag_1.shOptional overrides:
SLEEP_SECONDS=1 PROVIDER_ID=simulated-tag-1 SOURCE_ID=simulated-tag-1 ./scripts/replay_simulated_tag_1.shcreateandupdatecommands accept JSON or YAML payloads.locations stream,trackables stream,fences stream, andcollisions streamemit NDJSON records shaped as{received_at, topic, message}.zones,trackables, andfencesresource IDs are validated as UUIDs before requests are sent.- The generated REST client is derived from
api/omlox-hub.v0.yaml. oapi-codegencurrently warns about OpenAPI 3.1 support. The CLI still builds and uses the generated client.