@ultra-network/cli
v0.1.0
Published
Ultra Network CLI — `ultra <command>` for every Ultra Public API v1 operation. Spec-driven; new endpoints become new subcommands with zero code changes.
Maintainers
Readme
@ultra-network/cli
A spec-driven command-line client for the Ultra Network Public API v1.
Every operation in https://ultranetwork.co/api/v1/openapi.json becomes an ultra <command> subcommand. New endpoints become new subcommands automatically — no CLI code change needed.
Install
npm install -g @ultra-network/cliOr run without installing:
npx @ultra-network/cli list_trips --limit=5Quick start
export ULTRA_API_KEY=ulk_…
ultra --help # list commands grouped by resource
ultra list_trips --limit=10 # GET /api/v1/trips?limit=10
ultra get_trip --id=<uuid> # GET /api/v1/trips/{id}
ultra create_trip --body='{"title":"Demo","client_id":"…"}'
ultra create_trip [email protected] # read body from file
cat payload.json | ultra create_trip --body=- # read body from stdin
ultra list_bookings --trip_id=<uuid> --status # HTTP status on stderrGet an API key at ultranetwork.co/contact.
Environment
| Var | Default | Purpose |
|---|---|---|
| ULTRA_API_KEY | (required) | Bearer key for /api/v1 |
| ULTRA_API_SPEC | https://ultranetwork.co/api/v1/openapi.json | OpenAPI source |
| ULTRA_API_BASE_URL | (from spec.servers[0].url) | Override server base URL |
| ULTRA_API_TAGS | (all) | CSV filter — only expose operations matching these tags |
Global flags
| Flag | Purpose |
|---|---|
| --spec=<url\|path> | Override the spec source for one invocation |
| --base-url=<url> | Override the base URL for one invocation |
| --status | Print HTTP <code> + request_id to stderr |
| --raw | Print response body unchanged (no JSON pretty-print) |
| --quiet | Suppress progress lines on stderr |
| --help, -h | Top-level help, or per-command help when a command is named |
| --version, -V | Print CLI + spec version |
Exit codes
| Code | Meaning | |---|---| | 0 | 2xx response | | 1 | 4xx response | | 2 | 5xx response or network failure | | 3 | Usage / parse error | | 4 | Spec load failure |
Architecture
Spec-driven dumb-pipe. At boot the CLI fetches the OpenAPI document, walks the paths, and renders one subcommand per operation. The HTTP layer is shared with the @ultra-network/mcp server so both surfaces stay in lockstep with the live API.
Docs
- Developer docs — auth, API reference, MCP, errors, pagination
- CLI cookbook — practical recipes
- Live API reference — interactive Scalar UI
Licence
MIT
