Command-line tools and utilities for developing with the Islamic Open Finance™ (IOF) Platform.
IOF is a banking-grade Shariah-native platform: 109 rails across 19 categories (142+ endpoints) composed from 10 native domain engines over a single double-entry ledger. Two of those engines are the platform's defensible moats — the surfaces iof CLI exercises most:
- Settlement Engine —
iof settlement *exercises 24×7×365 DvP/FOP/RVP/DFP finality for Murabaha, Ijarah, Salam, Sukuk. AAOIFI SS-1/8/10/17/21/30 enforced at the state machine; CSDR Art. 7 penalties priced pre-confirm. Reclaims 60–140 bps per corridor. - Evidence Engine —
iof evidence exportpulls signed, tamper-evident compliance packs: 47/54 controls across SOC 2, ISO 27001, AAOIFI, GDPR, PSD2, IFSB, ISO 20022, SHA-256 Merkle + HMAC, one-call verification. Reclaims 30–55 bps on audit + re-papering.
Combined: 100–195 bps of Islamic-finance friction reclaimed per corridor — no core replacement.
✅ API Testing - Test API endpoints from command line ✅ Contract Validation - Validate Shariah compliance ✅ SDK Generation - Generate client SDKs in multiple languages ✅ Mock Data - Generate realistic test data ✅ Webhook Testing - Test webhook integrations ✅ Environment Management - Switch between environments ✅ Logging - Beautiful formatted logs and debugging ✅ Scaffolding - Bootstrap new projects
npm install -g @iof/devtoolsnpm install --save-dev @iof/devtools# Login to IOF Platform
iof login
# Test API endpoint
iof api call POST /api/v1/contracts/murabaha \
--data '{"customer_id": "CUST-123", ...}'
# Validate Shariah compliance
iof shariah validate murabaha.json
# Generate SDK
iof sdk generate --lang typescript --output ./sdk
# Start mock server
iof mock start
# View logs
iof logs --followLogin to IOF Platform:
# Interactive login
iof login
# With API key
iof login --api-key $IOF_API_KEY
# With OAuth
iof login --oauthLogout from current session:
iof logoutShow current user/organization:
iof whoamiMake API requests:
# GET request
iof api call GET /api/v1/contracts/murabaha
# POST with data
iof api call POST /api/v1/contracts/murabaha \
--data '{"customer_id": "CUST-123", ...}'
# POST with file
iof api call POST /api/v1/contracts/murabaha \
--file contract.json
# Custom headers
iof api call POST /api/v1/contracts/murabaha \
--header "X-Idempotency-Key: abc123" \
--data contract.jsonRun API test suite:
# Run all tests
iof api test
# Run specific test file
iof api test tests/contracts.yaml
# Run with coverage
iof api test --coverageExample test file (tests/contracts.yaml):
name: Murabaha Contract Tests
tests:
- name: Create valid contract
request:
method: POST
path: /api/v1/contracts/murabaha
body:
customer_id: CUST-123
asset_category: VEHICLE
cost_price: 50000
profit_amount: 5000
expect:
status: 201
body:
status: DRAFT
- name: Reject Shariah-violating contract
request:
method: POST
path: /api/v1/contracts/murabaha
body:
customer_id: CUST-123
asset_category: ALCOHOL
expect:
status: 422
body:
error.code: SHARIAH_BREACHValidate Shariah compliance:
# Validate contract
iof shariah validate contract.json
# Validate with specific rules
iof shariah validate contract.json --rules murabaha
# Show detailed report
iof shariah validate contract.json --verboseList Shariah rules:
# List all rules
iof shariah rules
# Filter by category
iof shariah rules --category CONTRACTS
# Show rule details
iof shariah rules --rule MUR_ASSET_HALALCreate contract from template:
# Interactive creation
iof contracts create murabaha
# From file
iof contracts create murabaha --file template.json
# With parameters
iof contracts create murabaha \
--customer CUST-123 \
--asset "Toyota Camry 2024" \
--cost 50000 \
--profit 5000List contracts:
# List all contracts
iof contracts list
# Filter by status
iof contracts list --status ACTIVE
# Filter by type
iof contracts list --type MURABAHA
# JSON output
iof contracts list --format jsonGet contract details:
iof contracts get CNT-789
# Show payment schedule
iof contracts get CNT-789 --schedule
# Show lineage
iof contracts get CNT-789 --lineageGenerate client SDK:
# TypeScript
iof sdk generate --lang typescript --output ./sdk
# Python
iof sdk generate --lang python --output ./sdk
# Java
iof sdk generate --lang java --output ./sdk
# Go
iof sdk generate --lang go --output ./sdk
# All languages
iof sdk generate --lang all --output ./sdksUpdate existing SDK:
iof sdk update ./sdkStart mock server:
# Default mode (stateless)
iof mock start
# Stateful mode
iof mock start --stateful
# With seed data
iof mock start --seed
# Custom port
iof mock start --port 9000Load seed data:
# Load default seed data
iof mock seed
# Load custom data
iof mock seed --file custom-data.json
# Clear all data
iof mock seed --clearListen for webhook events:
# Start webhook listener
iof webhooks listen --port 3000
# Filter events
iof webhooks listen --events contract.created,contract.activated
# Save events to file
iof webhooks listen --save events.jsonlTest webhook delivery:
# Test webhook URL
iof webhooks test https://your-app.com/webhooks
# Send test event
iof webhooks test https://your-app.com/webhooks \
--event contract.created \
--data contract.jsonManage environments:
# List environments
iof env list
# Switch environment
iof env use production
# Show current environment
iof env current
# Add custom environment
iof env add staging \
--url https://api.staging.islamicopenfinance.com \
--api-key iof_staging_abc123Generate mock data:
# Generate contracts
iof generate contracts --count 100 --output contracts.json
# Generate customers
iof generate customers --count 50 --output customers.json
# Generate cards
iof generate cards --count 30 --output cards.json
# Generate all
iof generate all --output test-data/View logs:
# View recent logs
iof logs
# Follow logs (tail -f)
iof logs --follow
# Filter by service
iof logs --service contracts
# Filter by level
iof logs --level error
# Search logs
iof logs --grep "Shariah breach"
# JSON output
iof logs --format jsonInitialize new project:
# Interactive setup
iof init
# Specify template
iof init --template typescript-express
# Specify language
iof init --lang typescript --framework fastifyTemplates:
typescript-express- TypeScript + Expresstypescript-fastify- TypeScript + Fastifypython-fastapi- Python + FastAPIjava-spring- Java + Spring Bootgo-gin- Go + Gin
Open developer portal:
# Open in browser
iof portal
# Open API keys page
iof portal keys
# Open documentation
iof portal docsManage configuration:
# Show configuration
iof config list
# Set value
iof config set api_key $IOF_API_KEY
# Get value
iof config get api_key
# Reset configuration
iof config resetConfiguration is stored in ~/.iof/config.json:
{
"environment": "production",
"api_key": "<IOF_API_KEY>",
"environments": {
"production": {
"url": "https://api.islamicopenfinance.com",
"api_key": "<IOF_API_KEY>"
},
"sandbox": {
"url": "https://api.sandbox.islamicopenfinance.com",
"api_key": "<IOF_API_KEY>"
}
},
"defaults": {
"format": "table",
"timeout": 30000,
"retry": 3
}
}Configure via environment variables:
export IOF_API_KEY=<your-api-key>
export IOF_ENVIRONMENT=production
export IOF_LOG_LEVEL=debug
export IOF_TIMEOUT=30000# 1. Login
iof login --api-key $IOF_API_KEY
# 2. Switch to sandbox
iof env use sandbox
# 3. Create customer
iof api call POST /api/v1/customers \
--file customer.json
# 4. Create Murabaha contract
iof contracts create murabaha \
--customer CUST-123 \
--asset "Toyota Camry 2024" \
--cost 50000 \
--profit 5000 \
> contract.json
# 5. Validate Shariah compliance
iof shariah validate contract.json
# 6. Get contract details
iof contracts get CNT-789 --schedule
# 7. View logs
iof logs --service contracts --follow# 1. Start mock server
iof mock start --stateful --seed &
# 2. Generate test data
iof generate all --output test-data/
# 3. Run API tests
iof api test tests/
# 4. View results
iof logs --level errorname: API Tests
on: [push]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install IOF DevTools
run: npm install -g @iof/devtools
- name: Login
run: iof login --api-key ${{ secrets.IOF_API_KEY }}
- name: Run tests
run: iof api test tests/
- name: Validate contracts
run: iof shariah validate contracts/All commands support multiple output formats:
# Table (default)
iof contracts list
# JSON
iof contracts list --format json
# YAML
iof contracts list --format yaml
# CSV
iof contracts list --format csv
# Pretty print
iof contracts list --format prettyEnable debug mode:
# Enable debug logging
iof --debug api call POST /api/v1/contracts
# Very verbose
iof --verbose api call POST /api/v1/contracts
# Save debug log
iof --debug api call POST /api/v1/contracts > debug.log 2>&1Extend functionality with plugins:
# Install plugin
iof plugins install @iof/plugin-analytics
# List plugins
iof plugins list
# Remove plugin
iof plugins remove @iof/plugin-analyticsgit clone https://github.com/Islamic-Open-Finance/iof-devtools.git
cd iof-devtools
npm install
npm run build
npm linknpm testiof plugins create my-pluginMake sure @iof/devtools is installed globally:
npm install -g @iof/devtoolsRe-login:
iof logout
iof loginIncrease timeout:
iof config set timeout 60000 # 60 seconds- Documentation: https://docs.islamicopenfinance.com/devtools
- GitHub Issues: https://github.com/Islamic-Open-Finance/iof-devtools/issues
- Email: support@islamicopenfinance.com
Apache License 2.0 - see LICENSE file for details.
- IOF OpenAPI - OpenAPI specification
- IOF SDKs - Client libraries
Built with ❤️ for the Islamic finance community