{"_id":"@cliniq360/ondc-credit-cli","name":"@cliniq360/ondc-credit-cli","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@cliniq360/ondc-credit-cli","version":"1.0.0","description":"Official CLI for the ONDC credit and loan API workflow.","type":"module","bin":{"ondc-credit":"dist/main.js"},"scripts":{"build":"tsc","dev":"tsx src/main.ts","start":"node dist/main.js","clean":"node -e \"const fs=require('fs'); fs.rmSync('dist',{recursive:true,force:true});\"","typecheck":"tsc --noEmit","test":"tsx src/main.ts --help","prepublishOnly":"npm run clean && npm run build && npm run typecheck"},"keywords":["ondc","credit","loan","api","cli","cliniq360"],"author":{"name":"eigi.ai"},"license":"MIT","dependencies":{"chalk":"^5.4.1","cli-table3":"^0.6.5","commander":"^13.1.0","conf":"^13.1.0"},"devDependencies":{"@types/node":"^22.13.0","tsx":"^4.19.0","typescript":"^5.7.0"},"engines":{"node":">=18"},"publishConfig":{"access":"public"},"gitHead":"f7172093206381445b2246a369cf19a6bc996393","_id":"@cliniq360/ondc-credit-cli@1.0.0","_nodeVersion":"24.14.0","_npmVersion":"11.9.0","dist":{"integrity":"sha512-nZbYMT9WrmugwPsIhg1YmquqTeWSRD2fxJ5AokzpOzdhv2U7CdXYm95jC34hwCzQ0n5NtuKBPSU2VK8VZ+87Ew==","shasum":"11cba8d6decc43773c58f86cabb54c76ddd7472f","tarball":"https://registry.npmjs.org/@cliniq360/ondc-credit-cli/-/ondc-credit-cli-1.0.0.tgz","fileCount":63,"unpackedSize":160176,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDB4f6uyP0KRJHarSEAaH+QsxfcrakS4u7xFqHnmqsa3AIgcstqygqf1ieY5RBpHsfnexQ5NySXtr6FH9Gpc6MZ+eg="}]},"_npmUser":{"name":"mrunmay.eigi","email":"mrunmay.chichkhede@cliniq360.com"},"directories":{},"maintainers":[{"name":"mehul28","email":"mehul.chaodhari@cliniq360.com"},{"name":"mrunmay.eigi","email":"mrunmay.chichkhede@cliniq360.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ondc-credit-cli_1.0.0_1775723766683_0.297524664980906"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-09T08:36:06.511Z","1.0.0":"2026-04-09T08:36:06.829Z","modified":"2026-04-09T08:36:07.081Z"},"maintainers":[{"name":"mehul28","email":"mehul.chaodhari@cliniq360.com"},{"name":"mrunmay.eigi","email":"mrunmay.chichkhede@cliniq360.com"}],"description":"Official CLI for the ONDC credit and loan API workflow.","keywords":["ondc","credit","loan","api","cli","cliniq360"],"author":{"name":"eigi.ai"},"license":"MIT","readme":"<div align=\"center\">\n\n# ondc-credit CLI\n\nCLI for the ONDC credit and loan API workflow.\n\n</div>\n\n---\n\n## Features\n\n- Calls the ONDC credit backend APIs directly\n- Preserves the same CLI structure and error handling pattern as the base ONDC CLI\n- Validates the credit payloads used by the existing ONDC and haqdarshak flows\n- Supports human-readable and JSON output\n- Includes a raw tool caller for the built-in ONDC credit API tool set\n- Uses `https://prod.cliniq360.com` as the default API base URL\n- Uses the same `ONDC_API_BASE_URL` and `ONDC_API_KEY` configuration pattern\n- Can print the strict credit AI workflow prompt via `ondc-credit workflow prompt`\n\n---\n\n## Installation\n\nInstall globally:\n\n```bash\nnpm install -g @cliniq360/ondc-credit-cli\n```\n\nOr run without installing:\n\n```bash\nnpx @cliniq360/ondc-credit-cli --help\n```\n\n---\n\n## Quick Start\n\n```bash\n# 1. Inspect the strict workflow before calling tools\nondc-credit workflow prompt\n\n# 2. Start a credit journey\nondc-credit journey start --user-id 1\n\n# 3. Submit the base loanForm payload\nondc-credit forms application \\\n  --txn-id <TXN_ID> \\\n  --first-name Jane \\\n  --last-name Doe \\\n  --dob 1992-01-15 \\\n  --gender female \\\n  --pan ABCDE1234F \\\n  --contact-number 9876543210 \\\n  --email jane@example.com \\\n  --official-email jane.work@example.com \\\n  --employment-type salaried \\\n  --end-use Education \\\n  --income 50000 \\\n  --company-name ExampleCorp \\\n  --address-l1 \"12 MG Road\" \\\n  --address-l2 \"Near Metro\" \\\n  --city Bengaluru \\\n  --state Karnataka \\\n  --pincode 560001\n\n# 4. Move to approved offers\nondc-credit offers select-application --txn-id <TXN_ID>\nondc-credit offers approved --txn-id <TXN_ID>\n\n# 5. Submit amount for a chosen offer\nondc-credit forms loan-amount \\\n  --txn-id <TXN_ID> \\\n  --request-amount 250000 \\\n  --request-term \"24 months\" \\\n  --form-id <FORM_ID>\n```\n\n## Use A Different API Endpoint\n\nOverride the default hosted API base URL with a shell environment variable:\n\n```bash\nONDC_API_BASE_URL=http://localhost:7600 ondc-credit tools list\n```\n\nOr export it for the current shell session:\n\n```bash\nexport ONDC_API_BASE_URL=http://localhost:7600\nexport ONDC_API_KEY=your_api_key_if_required\nondc-credit config show\n```\n\nYou can also place these values in a `.env` file in the directory where you run `ondc-credit`:\n\n```dotenv\nONDC_API_BASE_URL=http://localhost:7600\nONDC_API_KEY=your_api_key_if_required\n```\n\n---\n\n## Command Groups\n\n### `ondc-credit config`\n\n- `ondc-credit config set-format <pretty|json>`\n- `ondc-credit config show`\n\n### `ondc-credit workflow`\n\n- `ondc-credit workflow list`\n- `ondc-credit workflow prompt`\n- `ondc-credit workflow happy-path`\n- `ondc-credit workflow aa-fallback`\n- `ondc-credit workflow show <NAME>`\n\n### `ondc-credit journey`\n\n- `ondc-credit journey start [--user-id <USER_ID>]`\n\n### `ondc-credit forms`\n\n- `ondc-credit forms application ...`\n- `ondc-credit forms loan-amount ...`\n- `ondc-credit forms bank-details ...`\n\n### `ondc-credit offers`\n\n- `ondc-credit offers select-application --txn-id <TXN_ID>`\n- `ondc-credit offers approved [--txn-id <TXN_ID> | --user-id <USER_ID> | --customer-id <CUSTOMER_ID> | --mobile-number <PHONE>]`\n- `ondc-credit offers aa-url --txn-id <TXN_ID> --aa-id <AA_ID>`\n- `ondc-credit offers aa-consent --txn-id <TXN_ID>`\n- `ondc-credit offers detailed --txn-id <TXN_ID>`\n- `ondc-credit offers select --txn-id <TXN_ID> --offer-item-id <OFFER_ID>`\n\n### `ondc-credit orders`\n\n- `ondc-credit orders transaction-status --txn-id <TXN_ID>`\n- `ondc-credit orders form-url --txn-id <TXN_ID> --offer-item-id <OFFER_ID>`\n- `ondc-credit orders init --txn-id <TXN_ID> --offer-item-id <OFFER_ID>`\n- `ondc-credit orders confirm --txn-id <TXN_ID> --offer-item-id <OFFER_ID>`\n- `ondc-credit orders status --txn-id <TXN_ID> --offer-item-id <OFFER_ID>`\n- `ondc-credit orders loan-document --txn-id <TXN_ID> --offer-item-id <OFFER_ID>`\n\n### `ondc-credit policy`\n\n- `ondc-credit policy notify --order-id <ORDER_ID> --channel <whatsapp|sms> --mobile-number <PHONE>`\n\n### `ondc-credit tools`\n\n- `ondc-credit tools list`\n- `ondc-credit tools inspect <NAME>`\n- `ondc-credit tools call <NAME> --input '{...}'`\n\n---\n\n## Validated Payloads\n\nThe CLI validates the same request shapes used by the current credit flows in ONDC and haqdarshak.\n\n- `loanForm` required fields: `firstName`, `lastName`, `dob`, `gender`, `pan`, `contactNumber`, `email`, `officialEmail`, `employmentType`, `endUse`, `income`, `companyName`, `addressL1`, `addressL2`, `city`, `state`, `pincode`\n- `loanForm` optional fields: `udyamNumber`\n- `loanForm` required fields also include `aa_id`\n- `loanAmountForm` required fields: `requestAmount`, `requestTerm`, `form_id`\n- `accountDetails` required fields: `accHolderName`, `acctype`, `accNo`, `ifscCode`\n- `accountDetails` optional fields: `aaMonitoringConsent`\n\nThe CLI also validates common field formats:\n\n- PAN: `AAAAA9999A`\n- mobile number: 10 digits without country code\n- pincode: 6 digits\n- IFSC: Indian IFSC pattern\n- date of birth: `YYYY-MM-DD`\n- booleans passed as strings: `true` or `false`\n- `bureauConsent` is always sent as `true` for base application submission\n\n---\n\n## Notes\n\n- `ondc-credit-cli` calls the ONDC backend REST APIs directly.\n- The default base URL and API key behavior remain the same as the existing ONDC CLI implementation.\n- `ondc-credit workflow prompt` prints the strict `CREDIT_WORKFLOW_TEMPLATE` guidance for AI-assisted execution.\n- The CLI prints parsed tool payloads by default. Use `--json` for clean automation output.\n- For raw tool execution, use `ondc-credit tools inspect <NAME>` before `ondc-credit tools call <NAME>`.\n","readmeFilename":"README.md","_rev":"1-7c5a22540d37da74c317a71cebb31ea1"}