CLI Quickstart
Status: Active
Version: v1.1.0
Last updated: 2026-02-25
Package: @rgl8r/integration-cli v0.1.0 (packages/integration-cli/)
Companion docs:
- Agent Integration Kit — canonical 4-step flow with curl examples
- Public API Contract — error codes, job lifecycle, quotas
- Integration Quickstarts — no-code and scripted integration options
Installation
The CLI is not yet published to npm. Install from source:
# From the repository root
cd packages/integration-cli
pnpm install
pnpm build
# Link globally
npm linkVerify installation:
rgl8r --version
# 0.1.0Configuration
Set API credentials
# Configure the default profile
rgl8r config set apiKey rgl8r_your_integration_key_here
rgl8r config set apiUrl https://api.rgl8r.comMultiple profiles
# Create a staging profile
rgl8r config set apiKey rgl8r_staging_key --profile staging
rgl8r config set apiUrl https://staging-api.rgl8r.com --profile staging
# Use a specific profile
rgl8r ship upload invoices.csv --profile stagingEnvironment variables
Environment variables override profile config (highest precedence):
| Variable | Purpose |
|---|---|
RGL8R_API_KEY | Integration key |
RGL8R_API_URL | API base URL |
RGL8R_PROFILE | Profile name (default: default) |
List profiles
rgl8r config listConfiguration is stored at ~/.rgl8r/config.json with 0600 permissions.
Workflows
Ship upload (freight audit)
Upload a shipment CSV for freight audit processing:
rgl8r ship upload invoices.csvThe CLI handles token exchange automatically using your configured integration key.
Dry-run mode
Validate and sanitize a file without uploading:
rgl8r ship upload invoices.csv --dry-runThis runs PII detection and column mapping but does not send data to the API. Use --keep-sanitized to inspect the sanitized output:
rgl8r ship upload invoices.csv --dry-run --keep-sanitizedStrict mode
Reject the entire upload if any PII is detected:
rgl8r ship upload invoices.csv --strictExit code 11 if PII patterns are found. Without --strict, PII-containing cells are redacted and the upload proceeds.
Partial uploads
Allow the upload to proceed with valid rows, dropping rejected rows:
rgl8r ship upload invoices.csv --allow-partialExit code 2 if rows were dropped (upload succeeded with warnings).
JSON output
Machine-readable output for automation:
rgl8r ship upload invoices.csv --jsonCheck job status
rgl8r jobs status <jobId>
rgl8r jobs status <jobId> --jsonList recent jobs
rgl8r jobs list
rgl8r jobs list --limit 20 --jsonSHIP summary
rgl8r ship summary
rgl8r ship summary --jsonUpload manifests (local audit trail)
# List recent upload manifests
rgl8r manifests list
# Show manifest details
rgl8r manifests show <manifestId>Manifests are stored locally and include: source file hash, sanitized file hash, row counts, PII redaction counts, and upload outcome.
Exit Codes
| Code | Constant | Meaning |
|---|---|---|
0 | SUCCESS | Upload or dry run completed successfully |
2 | PARTIAL | Upload succeeded but some rows were dropped (warnings) |
10 | PREFLIGHT_FAILED | File not found or adapter unknown |
11 | STRICT_REJECTED | --strict set and PII patterns detected |
12 | SANITIZATION_FAILED | Rows rejected during sanitization, --allow-partial not set |
20 | AUTH_FAILED | Missing or invalid API key |
30 | UPLOAD_FAILED | Non-auth API error or job failed |
50 | INTERNAL_ERROR | Unexpected error |
Use exit codes in shell scripts for conditional logic:
rgl8r ship upload invoices.csv --json
case $? in
0) echo "Upload succeeded" ;;
2) echo "Upload succeeded with warnings — check dropped rows" ;;
11) echo "PII detected — review file before uploading" ;;
20) echo "Auth failed — check API key" ;;
*) echo "Upload failed (exit code: $?)" ;;
esacCI/CD Integration
GitHub Actions
- name: Upload shipment data
env:
RGL8R_API_KEY: ${{ secrets.RGL8R_API_KEY }}
RGL8R_API_URL: ${{ vars.RGL8R_API_URL }}
run: |
rgl8r ship upload data/shipments.csv --strict --jsonPipeline pattern (upload + poll + verify)
#!/usr/bin/env bash
# Requires: jq (https://jqlang.github.io/jq/)
set -euo pipefail
# Upload and capture job ID
OUTPUT=$(rgl8r ship upload data/shipments.csv --json)
JOB_ID=$(echo "$OUTPUT" | jq -r '.jobId')
if [ -z "$JOB_ID" ] || [ "$JOB_ID" = "null" ]; then
echo "Upload failed — no job ID returned"
exit 1
fi
echo "Job started: $JOB_ID"
# Poll until complete
for i in $(seq 1 40); do
STATUS=$(rgl8r jobs status "$JOB_ID" --json | jq -r '.status')
if [ "$STATUS" = "COMPLETED" ]; then
echo "Job completed successfully"
rgl8r ship summary --json
exit 0
elif [ "$STATUS" = "FAILED" ]; then
echo "Job failed"
rgl8r jobs status "$JOB_ID" --json
exit 1
fi
sleep 5
done
echo "Job timed out after 40 polls"
exit 1Troubleshooting
| Symptom | Likely Cause | Action |
|---|---|---|
rgl8r: command not found | CLI not linked or not in PATH | Run npm link from packages/integration-cli/ |
Exit code 20 (AUTH_FAILED) | Bad or missing API key | Run rgl8r config set apiKey <key> or set RGL8R_API_KEY env var |
Exit code 10 (PREFLIGHT_FAILED) | File not found or unknown adapter | Check file path; omit --adapter to use tenant default |
Exit code 11 (STRICT_REJECTED) | PII detected in strict mode | Run --dry-run --keep-sanitized to inspect; fix source data or remove --strict |
Exit code 12 (SANITIZATION_FAILED) | Rows rejected, --allow-partial not set | Add --allow-partial to drop bad rows, or fix source data |
Exit code 30 (UPLOAD_FAILED) | API error or job failure | Check rgl8r jobs status <id> --json for error details |
--json output empty | CLI version mismatch | Rebuild: cd packages/integration-cli && pnpm build |
Next Steps
- npm publishing:
@rgl8r/integration-cliwill be published to npm (install vianpm install -g @rgl8r/integration-cli) - Catalog upload:
rgl8r catalog uploadcommand (TRADE catalog ingestion) - Webhook mode (P12-B):
rgl8r ship upload --webhook <url>to receive completion callbacks instead of polling
Plan ID: P12-A | Last updated: 2026-02-25