@cliniq360/rsc-cli
v0.3.0
Published
CLI for RSC backend services.
Readme
rsc CLI
Command-line interface for RSC backend services
Read-focused CLI for RSC microservices with role-gated authentication and OTP verification.
Features
- GET-Only API Commands — maps read endpoints across
authentication,order_mgmt,payout,shipment,warehouse, andanalytics - Role-Gated Access — allows only
superadminandadmin - OTP-Based Authentication — login + OTP verification flow
- Secure Credential Reuse — email is stored in CLI config and password is stored in the OS keychain
- Session Reuse — persisted bearer session until expiry, with automatic re-login challenge on expiry or
401 - Multi-Service Base URLs — separate base URL per service
- JSON Output — every command supports
--json - Automation Friendly — extra query params via
--param key=value
Installation
From npm
npm install -g @cliniq360/rsc-cli
rsc --helpOr run without installing globally:
npx @cliniq360/rsc-cli --helpFrom source
cd rsc-cli
npm install
npm run buildRun with node:
node dist/main.js --helpOptional global linking:
npm link
rsc --helpQuick Start
# 1. Build
npm run build
# 2. Login with email + password
rsc auth login
# 3. Optional fallback: verify OTP separately only if you skipped the interactive prompt
rsc auth verify-otp --otp 123456
# 4. Confirm auth status
rsc auth status
# 5. Call a GET endpoint
rsc order-mgmt order-list --jsonAuthentication Model
- Users do not manually enter access tokens in normal flow.
- Login is done in one interactive flow: email/password first, then OTP or 2FA prompt in the same command.
- Access is allowed only for roles:
superadmin,admin. - If role is not allowed, CLI returns access denied.
- The email is stored locally in CLI config and the password is stored in the OS credential vault.
- When a session expires or an authenticated request returns
401, the CLI reuses stored credentials, prompts for OTP in the same command when interactive, and retries the request.
Auth commands:
rsc auth loginrsc auth verify-otp --otp <code>rsc auth statusrsc auth stored-loginrsc auth clear-stored-loginrsc auth whoamirsc auth logout
verify-otp remains available as a fallback for non-interactive use, but normal terminal logins do not require a second command.
Commands
rsc config — Configuration
| Command | Description |
| ----------------------------------------- | ------------------------------------------------- | ------------------------- |
| rsc config show | Show resolved config, base URLs, and session mask |
| rsc config set-format <table | json> | Set default output format |
| rsc config set-base-url <service> <url> | Override base URL for a service |
rsc authentication — Authentication Service GETs
rsc authentication user get-details --id <user_id>rsc authentication user get-payment-detailsrsc authentication user verify-routing-number <routing_number>rsc authentication user list-allrsc authentication user discordrsc authentication auth-read google-login --auth-token <token>rsc authentication auth-read apple-login --auth-token <token>rsc authentication auth-read discord-callback
rsc order-mgmt — Order Management GETs
rsc order-mgmt quote-listrsc order-mgmt quote-get <id>rsc order-mgmt quote-upc-lookup --upc <value>rsc order-mgmt pre-quote-listrsc order-mgmt pre-quote-get <id>rsc order-mgmt pre-quote-allowed-quantity --id <id>rsc order-mgmt instore-flip-listrsc order-mgmt instore-flip-get <id>rsc order-mgmt instore-flip-allowed-quantity --id <id>rsc order-mgmt ship-direct-listrsc order-mgmt ship-direct-get <id>rsc order-mgmt ship-direct-allowed-quantity --id <id>rsc order-mgmt order-list [filters]rsc order-mgmt order-approvedrsc order-mgmt order-get <id>rsc order-mgmt order-item-list-approvedrsc order-mgmt order-item-get <id>
rsc payout — Payout Service GETs
rsc payout giftcard-listrsc payout giftcard-get <id>rsc payout wallet-listrsc payout wallet-summary --user-id <id>rsc payout wallet-get <id>rsc payout withdrawal-listrsc payout withdrawal-invoice --withdrawal-id <id>rsc payout withdrawal-get <id>rsc payout withdrawal-paypal-status <payout_batch_id>rsc payout payout-list [filters]rsc payout payout-download --id <id> --document-type <type>rsc payout payout-by-shipment --shipment-id <id>rsc payout payout-get <id>rsc payout payout-case-listrsc payout payout-case-list-by-userrsc payout payout-case-shipment-details --shipment-id <id>rsc payout payout-case-download --case-id <id>
rsc shipment — Shipment Service GETs
rsc shipment shipment-list [filters]rsc shipment shipment-list-pendingrsc shipment shipment-download --id <id> --document-type <type>rsc shipment shipment-invoice --id <id>rsc shipment shipment-walmart-status --walmart-shipping-id <id>rsc shipment shipment-get <id>rsc shipment shipment-tracking <id>rsc shipment discord-shipment-listrsc shipment discord-shipment-get <id>
rsc warehouse — Warehouse Service GETs
rsc warehouse inventory-list-all-itemsrsc warehouse inventory-item-logs --upc <value>rsc warehouse inventory-shipment-summary <shipment_id>rsc warehouse inbound-items-by-tracking <tracking_number>rsc warehouse inbound-list-tracking-numbersrsc warehouse inbound-logs <tracking_number>rsc warehouse inbound-download --id <id>
rsc analytics — Analytics Service GETs
rsc analytics analytics-order --user-id <id>rsc analytics analytics-shipment --user-id <id>rsc analytics analytics-payout --user-id <id>rsc analytics dashboard-member --user-id <id>rsc analytics dashboard-manager --user-id <id>rsc analytics faq-tutorial-video --id <id>rsc analytics lead-list
JSON Output and Scripting
All commands support --json:
rsc auth status --json
rsc payout payout-list --json
rsc shipment shipment-get SHP123 --jsonYou can pass extra query params (repeatable):
rsc order-mgmt order-list --param skip=0 --param limit=20 --jsonEnvironment Variables
Service base URLs
| Variable | Default |
| ------------------------------ | ----------------------------------- |
| REACT_APP_AUTH_BASE_URL | https://auth-qa.rs-chain.com |
| REACT_APP_ORD_BASE_URL | https://order-qa.rs-chain.com |
| REACT_APP_ANALYTICS_BASE_URL | https://analytics-qa.rs-chain.com |
| REACT_APP_PAYMENTS_BASE_URL | https://payout-qa.rs-chain.com |
| REACT_APP_SHIPMENT_BASE_URL | https://shipment-qa.rs-chain.com |
| REACT_APP_WAREHOUSE_BASE_URL | https://shipment-qa.rs-chain.com |
Auth override (automation only)
| Variable | Description |
| ---------------- | ------------------------------------------------------------- |
| RSC_AUTH_TOKEN | Optional bearer token override for non-interactive automation |
Scope Note
This CLI currently implements GET endpoints only. Non-GET APIs are intentionally excluded from command coverage.
Development
npm install
npm run typecheck
npm run build
node dist/main.js --helpPublishing
This repository includes a GitHub Actions workflow at .github/workflows/publish-cli.yml.
Release flow:
git tag v0.1.1
git push origin v0.1.1The workflow will sync package.json to the tag version, run tests, build the CLI, and publish @cliniq360/rsc-cli to npm using GitHub OIDC trusted publishing.
Requirements
- Node.js >= 18
- RSC backend access credentials
- Allowed user role (
superadminoradmin)
