Skip to content
Dusan Milicevic edited this page Apr 24, 2026 · 2 revisions

CLI

@otaip/cli — command-line interface for searching, booking, and inspecting the OTAIP platform.

Install & run

# One-off via npx
npx @otaip/cli <command>

# Global install
pnpm add -g @otaip/cli
otaip <command>

# From a checkout
pnpm --filter @otaip/cli build
node packages/cli/dist/index.js <command>

Commands

The CLI exposes six commands: search, price, book, adapters, agents, validate.

otaip search

Search for flight availability.

otaip search --from LHR --to CDG --date 2026-06-15 --passengers 2
otaip search --from JFK --to LAX --date 2026-07-01 --adapter sabre --json
Flag Required Default Description
--from <iata> Origin IATA
--to <iata> Destination IATA
--date <iso> Departure date YYYY-MM-DD
--adapter <id> amadeus Adapter to query
--passengers <n> 1 Passenger count

otaip price

Price a specific offer ID from a prior search.

otaip price --offer-id OFR0000000042 --adapter duffel
Flag Required Default
--offer-id <id>
--adapter <id> amadeus

otaip book

Book an offer — create a PNR or Order depending on the adapter.

otaip book \
  --offer-id OFR0000000042 \
  --passengers "Doe/Jane/ADT,Doe/John/ADT" \
  --adapter sabre
Flag Required Default
--offer-id <id>
--passengers <names>
--adapter <id> amadeus

Passenger format: Last/First/Type, comma-separated. Types: ADT, CHD, INF.

otaip adapters

List available distribution adapters and their status.

otaip adapters
otaip adapters --json

Output columns: ID, Name, Type, Status. Unconfigured adapters report not configured.

otaip agents

List all 75 agents with their contract status. The registry is auto-discovered from source metadata at module load — packages/cli/src/agent-discovery.ts walks every packages/agents/*/src/*/index.ts, packages/agents-platform/src/*/index.ts, packages/agents-tmc/src/*/index.ts, and packages/core/src/agents/shopping/*/index.ts, greps readonly id, readonly name, readonly version, and derives stage from the path.

otaip agents                    # all 75 agents
otaip agents --stage search     # filter to search stage
otaip agents --json             # machine-readable
otaip agents --verbose          # adds source_path column

Each row: ID, Name, Stage, Contract Status (active when version !== '0.0.0', else stub). --verbose adds the source file path for traceability.

otaip validate

Dry-run pipeline validation for a specific agent. Parses input through the agent's Zod schema and semantic validator without executing it.

otaip validate --agent 1.1 --input '{
  "origin":"LHR","destination":"CDG","departure_date":"2026-06-15",
  "passengers":{"adults":1}
}'
Flag Required
--agent <id>
--input <json>

Reports: JSON parse result → schema parse result → semantic validator result. With --verbose, each gate is shown individually.

Global flags

Every command accepts:

Flag Effect
--json Machine-readable JSON output
--verbose Show confidence scores and per-gate results

--json always wins over human-readable output, including for errors. Non-zero exit codes indicate validation failure.

Typical workflows

Inspect the agent inventory

otaip agents --stage pricing --json | jq '.[] | select(.contract_status=="active")'

Dry-run a booking before wiring it up

otaip validate --agent 3.2 --input "$(cat pnr-builder-input.json)" --verbose

Check which adapters are ready

otaip adapters --json | jq '.adapters[] | select(.status=="configured") | .id'

See also

Clone this wiki locally