📚 MicroRapid CLI Commands Reference
📋 Complete Command Reference
Core Commands
| Command | Purpose | Example |
|---|
init | Create new project from OpenAPI spec | tiefrun init my-api --from-url https://api.example.com/openapi.yaml |
validate | Validate OpenAPI specification | tiefrun validate api-spec.json --strict |
explore | Deep search across API spec | tiefrun explore payment |
env | Manage environments | tiefrun env list |
list | Discover available operations | tiefrun list --filter user --method POST |
auth | Manage authentication | tiefrun auth detect --spec api.yaml |
show | View operation details | tiefrun show repos/get |
run | Execute an API operation | tiefrun run GetUser --param id=123 --env prod --profile api-key |
doctor | Diagnose configuration issues | tiefrun doctor --fix |
gen | Generate code/SDKs/fixtures | tiefrun gen sdk --language typescript |
test | Run API tests | tiefrun test api.yaml --all --env staging |
diff | Compare API specifications (coming soon) | — |
Collection Commands
| Command | Purpose | Example |
|---|
collection run | Execute collection | tiefrun collection run smoke-tests --env prod |
collection list | Show all collections | tiefrun collection list |
collection show | Show collection details | tiefrun collection show user-onboarding |
collection validate | Validate collection syntax | tiefrun collection validate my-tests |
collection test | Run collection as tests | tiefrun collection test smoke-tests --env staging |
Authentication Commands
| Command | Purpose | Example |
|---|
auth detect | Detect required authentication | tiefrun auth detect --spec api.yaml |
auth connect | Configure authentication | tiefrun auth connect api-key |
auth login | Login to OAuth provider | tiefrun auth login github |
auth test | Test authentication | tiefrun auth test --profile github-main |
auth validate | Validate auth configuration | tiefrun auth validate --profile production |
auth refresh | Refresh OAuth tokens | tiefrun auth refresh --profile oauth-prod |
Environment Commands
| Command | Purpose | Example |
|---|
env list | List all environments | tiefrun env list |
env create | Create new environment | tiefrun env create qa --base-url https://qa.api.com |
env show | Show environment details | tiefrun env show production |
There is no env use. Select an environment per command with the global --env <name> flag (e.g. tiefrun run GetUser --env staging).
🎯 Command Options Reference
init Command Options
tiefrun init <project-name> [options]
| Option | Description | Example |
|---|
--from-url <url> | Initialize from URL | --from-url https://api.example.com/openapi.json |
--from-file <file> | Initialize from local file | --from-file ./openapi.yaml |
--template <type> | Project template (minimal, rest, graphql) | --template rest |
--force | Overwrite existing directory | --force |
--allow-insecure | Allow insecure HTTP connections | --allow-insecure |
list Command Options
tiefrun list [options]
| Option | Description | Example |
|---|
--filter/-f <keyword> | Search operations by keyword | --filter user |
--method/-m <METHOD> | Filter by HTTP method | --method POST |
--limit <n> | Limit results | --limit 10 |
--format <type> | Output format (table, json, simple) | --format json |
run Command Options
tiefrun run <operation> [options]
| Option | Description | Example |
|---|
--param <key=value> | Set parameter value | --param id=123 |
--env <environment> | Use specific environment | --env production |
--profile <profile> | Use auth profile | --profile github-main |
--file <file> | Request body from file | --file request.json |
-i | Interactive mode | -i |
--minimal | Minimal template (with -i) | -i --minimal |
--full | Full template (with -i) | -i --full |
--dry-run | Preview without executing | --dry-run |
--as-curl | Show as curl command | --as-curl |
--verbose | Detailed output | --verbose |
--save-to-collection | Save successful request | --save-to-collection |
--save-as <name> | Save with specific name | --save-as user-fetch |
--timeout <ms> | Request timeout | --timeout 5000 |
--retry <n> | Number of retries | --retry 3 |
--trace | Trace HTTP traffic | --trace |
--replay-last | Replay last query | --replay-last |
--query-file <file> | Use query file | --query-file query.json |
--help-query | Show query syntax help | --help-query |
--build-query | Interactive query builder | --build-query |
--json-output/-o | Output response as JSON | --json-output |
--auth <string> | Direct auth (not recommended) | --auth "Bearer token" |
validate Command Options
tiefrun validate <spec-file> [options]
| Option | Description | Example |
|---|
--strict | Treat warnings as errors | --strict |
--lint | Check for best practices | --lint |
--rules <file> | Custom linting rules | --rules api-rules.yaml |
--format <type> | Output format (text, json) | --format json |
doctor Command Options
tiefrun doctor [options]
| Option | Description | Example |
|---|
--fix | Auto-fix issues | --fix |
--check <area> | Check specific area | --check auth |
--env <environment> | Check specific environment | --env production |
--quiet | Quiet mode | --quiet |
--format <type> | Output format (text, json) | --format json |
Check areas:
config - Configuration files
auth - Authentication setup
spec - OpenAPI specification
env - Environment variables
diff Command Options — Coming Soon
diff is not yet implemented and will be available in a future release.
tiefrun diff <old-spec> <new-spec> [options]
| Option | Description | Example |
|---|
--breaking-only | Show only breaking changes | --breaking-only |
--fail-on-breaking | Exit with error on breaking changes | --fail-on-breaking |
--format <type> | Output format (text, json, markdown) | --format markdown |
--quiet | Suppress output | --quiet |
gen Command Options
tiefrun gen <type> [options]
Generation Types:
| Type | Description | Example |
|---|
sdk | Generate SDK client | tiefrun gen sdk --language typescript |
snippets | Generate code examples | tiefrun gen snippets --format curl |
stubs | Generate server stubs | tiefrun gen stubs --framework express |
fixtures | Generate test data | tiefrun gen fixtures --count 100 |
Common Options:
| Option | Description | Example |
|---|
--language <lang> | Target language | --language python |
--output <dir> | Output directory | --output ./sdk |
--package-name <name> | Package name | --package-name @company/api |
--with-docs | Include documentation | --with-docs |
--with-tests | Include tests | --with-tests |
--with-examples | Include examples | --with-examples |
--framework <name> | Server framework | --framework fastapi |
--count <n> | Number of fixtures | --count 50 |
--seed <n> | Random seed | --seed 42 |
--format <type> | Output format | --format yaml |
collection Command Options
tiefrun collection <subcommand> [options]
collection run Options:
| Option | Description | Example |
|---|
--env <environment> | Use environment | --env staging |
--profile <profile> | Use auth profile | --profile api-key |
--var <key=value> | Set variable | --var userId=123 |
--fail-fast | Stop on first failure | --fail-fast |
--report <format> | Report format (junit, json) | --report junit |
collection test Options:
| Option | Description | Example |
|---|
--env <environment> | Use environment | --env staging |
--profile <profile> | Use auth profile | --profile qa-creds |
--fail-fast | Stop on first failure | --fail-fast |
--report <format> | Test report format | --report junit |
📖 Complete Examples
Basic API Execution
# Simple GET request
tiefrun run GetUser --param id=123
# With environment and authentication
tiefrun run GetUser \
--param id=123 \
--env production \
--profile api-key-prod
# POST with file and save to collection
tiefrun run CreateUser \
--file user-data.json \
--env staging \
--profile oauth-staging \
--save-to-collection
Working with GitHub API
# Initialize GitHub API project
tiefrun init github-api \
--from-url https://raw.githubusercontent.com/github/rest-api-description/main/descriptions/api.github.com/api.github.com.json
# List repository operations
tiefrun list --filter repo --method POST
# Get repository details
tiefrun run repos/get \
--param owner=microsoft \
--param repo=vscode \
--env production \
--profile github-main
# Create repository with interactive mode
tiefrun run repos/create-for-user -i
# Edit the generated template, then:
tiefrun run repos/create-for-user \
--file create_repo_request.json \
--env production \
--profile github-main \
--save-to-collection
Authentication Setup
# Detect required authentication
tiefrun auth detect --spec api.yaml
# Configure API key authentication
tiefrun auth connect api-key
# Login to GitHub OAuth
tiefrun auth login github
# Test authentication profile
tiefrun auth test --profile github-main
# Validate production credentials
tiefrun auth validate --profile production
Environment Management
# List all environments
tiefrun env list
# Create QA environment
tiefrun env create qa --base-url https://qa-api.example.com
# Select an environment per command with --env (there is no `env use`)
tiefrun run GetUser --env staging
# Show environment details
tiefrun env show production
Collection Management
# Create a collection by saving a request to it (there is no `collection create`)
tiefrun run GetUser --save-to-collection --collection smoke-tests
# Validate collection syntax
tiefrun collection validate smoke-tests
# Run collection with variables
tiefrun collection run user-onboarding \
--env staging \
--var email="test@example.com" \
--var username="testuser"
# Run as tests with report
tiefrun collection test regression-suite \
--env staging \
--report junit > test-results.xml
API Validation and Testing
# Validate OpenAPI spec
tiefrun validate api-spec.yaml --strict --lint
# Run all tests
tiefrun test api.yaml --all --env staging
# Diagnose issues
tiefrun doctor --env production --fix
Code Generation
# Generate TypeScript SDK
tiefrun gen sdk \
--language typescript \
--output ./sdk/typescript \
--package-name "@company/api-client" \
--with-docs \
--with-tests
# Generate test fixtures
tiefrun gen fixtures \
--count 100 \
--seed 42 \
--output ./test-data
# Generate curl examples
tiefrun gen snippets \
--format curl \
--output ./docs/examples
Advanced Query Building
# Interactive query builder
tiefrun run searchProducts --build-query
# Complex query with filters
tiefrun run searchProducts \
--param q="category:electronics price:>100" \
--param sort="price:asc" \
--param page=1 \
--param limit=20 \
--env production \
--profile api-key
# Use query file
cat > query.json << EOF
{
"filter": "status = 'active' and created >= '2024-01-01'",
"sort": "created:desc",
"page": 1,
"limit": 50
}
EOF
tiefrun run listItems --query-file query.json
Debugging and Development
# Preview request without sending
tiefrun run DeleteUser \
--param id=123 \
--dry-run
# Show as curl command
tiefrun run DeleteUser \
--param id=123 \
--as-curl
# Trace HTTP traffic
tiefrun run GetUser \
--param id=123 \
--trace \
--verbose
# Replay last successful request
tiefrun run GetUser --replay-last
🎓 Pro Tips
1. Use Environment-Specific Configs
# Development with verbose output
tiefrun run GetUser --env dev --verbose
# Production with specific profile
tiefrun run GetUser --env prod --profile prod-readonly
2. Chain Operations with Collections
# .tiefrun/collections/user_flow.yaml
requests:
- name: Create User
operation: CreateUser
save_as: user
- name: Add Payment Method
operation: AddPaymentMethod
params:
user_id: "{{ user.id }}"
depends_on: ["Create User"]
3. Interactive Mode for Complex Requests
# Generate minimal template
tiefrun run ComplexOperation -i --minimal
# Generate full template with all fields
tiefrun run ComplexOperation -i --full
4. Always Validate Before Production
# Dry run first
tiefrun run DeleteUser --param id=123 --dry-run
# Check as curl
tiefrun run DeleteUser --param id=123 --as-curl
5. Set Up Proper Authentication Profiles
# Create profile for each environment
cat > .tiefrun/auth/prod.toml << EOF
[profile]
name = "production"
type = "bearer"
[auth]
token_env = "PROD_API_TOKEN"
EOF
# Use environment-specific profiles
tiefrun run GetUser --env production --profile prod
Universal API Specification Support
- ✅ Swagger 2.0 - Classic format, widely used
- ✅ OpenAPI 3.0 - Modern standard with rich features
- ✅ OpenAPI 3.1 - Latest version with JSON Schema compatibility
- ✅ JSON and YAML - Both file formats supported
- ✅ Local files and URLs - Load from disk or internet
🚀 Next Steps
Ready to start using MicroRapid?
Begin by initializing your first API project:
tiefrun init your-api --from-url https://your-api.com/openapi.json
Need help? Check our Quick Start Guide or Documentation.