@cliniq360/ondc-cli
v2.0.6
Published
Official CLI for the ONDC insurance API workflow.
Readme
ondc CLI
CLI for the ONDC insurance API workflow.
Features
- Calls the ONDC insurance backend APIs directly
- Covers the current ONDC insurance journey tool surface
- Supports human-readable and JSON output
- Includes a raw tool caller for the built-in ONDC API tool set
- Uses
https://prod.cliniq360.comas the default API base URL - Supports endpoint override with
ONDC_API_BASE_URL - Supports optional
ONDC_API_KEY - Can print the strict insurance AI workflow prompt via
ondc workflow prompt
Installation
Install globally:
npm install -g @cliniq360/ondc-cliOr run without installing:
npx @cliniq360/ondc-cli --helpQuick Start
# 1. The CLI uses the hosted API base URL by default
# https://prod.cliniq360.com
# 2. Inspect the available tool surface
ondc tools list
# 3. Print the strict AI workflow prompt
ondc workflow prompt
# 4. Start a journey
ondc journey start
# 5. Submit a single applicant
ondc forms applicant \
--txn-id <TXN_ID> \
--first-name Jane \
--last-name Doe \
--email [email protected] \
--phone 9876543210 \
--address "Bengaluru, Karnataka" \
--gender F \
--dob 1992-01-15 \
--amount 500000 \
--pincode 560001 \
--height-foot 5 \
--height-inch 4 \
--weight 62
# 6. Trigger search and list offers
ondc journey trigger-search --txn-id <TXN_ID>
ondc offers list --txn-id <TXN_ID>Use A Different API Endpoint
Override the default hosted API base URL with a shell environment variable:
ONDC_API_BASE_URL=http://localhost:7600 ondc tools listOr export it for the current shell session:
export ONDC_API_BASE_URL=http://localhost:7600
export ONDC_API_KEY=your_api_key_if_required
ondc config showYou can also place these values in a .env file in the directory where you run ondc:
ONDC_API_BASE_URL=http://localhost:7600
ONDC_API_KEY=your_api_key_if_requiredCommand Groups
ondc config
ondc config set-format <pretty|json>ondc config show
ondc workflow
ondc workflow listondc workflow promptondc workflow quote-purchaseondc workflow post-purchaseondc workflow show <NAME>
ondc journey
ondc journey start [--txn-id <TXN_ID>]ondc journey trigger-search --txn-id <TXN_ID>
ondc forms
ondc forms applicant ...ondc forms family --input '{...}'ondc forms buyer ...ondc forms nominee ...
ondc offers
ondc offers list --txn-id <TXN_ID>ondc offers select --txn-id <TXN_ID> --offer-item-id <OFFER_ID> [--add-ons '{"add_on_obj":[]}' ]
ondc orders
ondc orders form-url --txn-id <TXN_ID> --form-type <KYC|PAYMENT>ondc orders init --txn-id <TXN_ID> --offer-item-id <OFFER_ID>ondc orders confirm --txn-id <TXN_ID> --offer-item-id <OFFER_ID>ondc orders status --txn-id <TXN_ID> --offer-item-id <OFFER_ID>ondc orders transaction-status --txn-id <TXN_ID>
ondc policy
ondc policy cancellation-terms --order-id <ORDER_ID>ondc policy cancel --txn-id <TXN_ID> --offer-item-id <OFFER_ID> --reason-id <ID> --notes <TEXT>ondc policy notify --order-id <ORDER_ID> --channel <WHATSAPP|SMS> --mobile-number <PHONE>
ondc tools
ondc tools listondc tools inspect <NAME>ondc tools call <NAME> --input '{...}'
Environment Variables
| Variable | Description |
| ------------------- | --------------------------------------------------------------------------- |
| ONDC_API_BASE_URL | Optional override for the default API base URL https://prod.cliniq360.com |
| ONDC_API_KEY | Optional API key sent as the api_key request header |
Notes
ondc-clicalls the ONDC backend REST APIs directly.ondc-cliworks without an API key by default, but can sendONDC_API_KEYwhen your deployment requires it.- The published CLI defaults to
https://prod.cliniq360.comand does not bundle secrets or a package-local.envfile. - Set
ONDC_API_KEYin your shell or in the current working directory's.envfile when the backend requiresapi_key. - Use
ONDC_API_BASE_URLonly when you need a different API endpoint. ondc workflow promptprints the strictINSURANCE_WORKFLOW_TEMPLATEguidance so an AI agent can follow the intended ONDC tool chain.- The CLI prints parsed tool payloads by default. Use
--jsonfor clean automation output. - For complex payloads such as family floater submissions, use
--input,--file, or pipe JSON through stdin.
