odh-cli

module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 15, 2026 License: MPL-2.0

README

odh-cli

odh is a JSON-first command-line interface for public Open Data Hub APIs.

It is built for developers, scripts, demos, and AI agents that need stable command behavior instead of scraping web UI pages. It wraps known Open Data Hub API entrypoints, fetches OpenAPI specs, and provides small curated commands for common Tourism and Mobility API calls.

Status

This is an early v0.1 project. It intentionally focuses on a small working core:

  • list known Open Data Hub APIs,
  • report machine-readable build/version metadata,
  • run a non-interactive doctor check for registry and upstream reachability,
  • fetch OpenAPI specs as JSON,
  • call any registered API path with query parameters,
  • query a random Tourism POI,
  • discover Mobility station, event, and edge types,
  • summarize Mobility data types for a station type and origin,
  • query latest Mobility time-series measurements,
  • inspect A22 Mobility event and forecast feeds with explicit warnings when the data does not look like current traffic incidents.

It does not yet include MCP, generated clients, Homebrew packaging, Docker images, or authenticated write flows.

Install

Build from source:

go build -o odh ./cmd/odh

Run directly during development:

go run ./cmd/odh --help

Build with release metadata:

go build \
  -ldflags "-X github.com/galjos/odh-cli/internal/version.Version=0.1.0 -X github.com/galjos/odh-cli/internal/version.Commit=$(git rev-parse --short HEAD) -X github.com/galjos/odh-cli/internal/version.Date=$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
  -o odh ./cmd/odh

Quickstart

Print version metadata:

./odh version

Check the local CLI and upstream API reachability:

./odh doctor

List known API surfaces:

./odh apis

Fetch the Mobility OpenAPI spec as JSON:

./odh openapi mobility

Call a Tourism API endpoint:

./odh call tourism /v1/ODHActivityPoi \
  --param pagenumber=1 \
  --param pagesize=1 \
  --param seed=42 \
  --param fields=Detail.en.Title,GpsInfo

Use the curated Tourism POI command:

./odh tourism poi --limit 1 --seed 42 --fields Detail.en.Title,GpsInfo

Use the curated Mobility latest-measurements command:

./odh mobility latest \
  --station-type EChargingStation \
  --data-type number-available \
  --limit 5

Discover Mobility event origins:

./odh mobility types --kind event

Find A22 traffic-sensor data types:

./odh mobility datatypes \
  --station-type TrafficSensor \
  --origin A22 \
  --limit 100

Check the A22-specific diagnostic output:

./odh a22 status --limit 10

Automation Contract

odh is designed to be script and agent friendly:

  • stdout is machine-readable output,
  • JSON is the default output for data commands,
  • stderr is for diagnostics,
  • failures return nonzero exit codes,
  • commands are non-interactive,
  • examples use public unauthenticated endpoints only.

See docs/agent-usage.md for details.

Development

go fmt ./...
go test ./...
go vet ./...
go build ./cmd/odh

Optional live smoke tests:

ODH_LIVE_TESTS=1 go test ./internal/commands -run Live

More details are in docs/development.md.

Release builds are documented in docs/release.md.

The agent skill bundle is in skills/open-data-hub-cli/SKILL.md.

Directories

Path Synopsis
cmd
odh command
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL