import CodeBlock from ’../../components/CodeBlock.astro’; import Admonition from ’../../components/Admonition.astro’;

🚀 Quick Start with Enhanced UX

Get Started in 30 Seconds

<CodeBlock code={`# Install MicroRapid CLI globally npm install -g mrapids

Initialize your first API project

mrapids init github-api —from-url https://api.github.com/openapi.json

Start using the API immediately

mrapids run repos/list —user octocat`} lang=“bash” filename=“quickstart.sh” />

Every code block now has a **copy button** in the top-right corner. Just click to copy!

Installation

You need Node.js 16+ and npm installed on your system.

Package Managers

Choose your preferred package manager:

<CodeBlock code={npm install -g mrapids} lang=“bash” filename=“npm” />

<CodeBlock code={yarn global add mrapids} lang=“bash” filename=“yarn” />

<CodeBlock code={pnpm add -g mrapids} lang=“bash” filename=“pnpm” />

Your First API Integration

MicroRapid supports **Swagger 2.0**, **OpenAPI 3.0**, and **OpenAPI 3.1** specifications.

Step 1: Initialize from OpenAPI Spec

<CodeBlock code={`# Initialize a new project from any OpenAPI spec mrapids init my-api —from-url https://api.example.com/openapi.json

What happens:

✅ Downloads and validates the spec

✅ Discovers all available operations

✅ Creates project structure

✅ Ready to use immediately!`}

lang=“bash” />

Step 2: Explore Available Operations

<CodeBlock code={`# List all operations mrapids list

Search for specific operations

mrapids list —filter user

Get details about an operation

mrapids show createUser`} lang=“bash” />

Step 3: Execute Your First Request

<CodeBlock code={`# Interactive mode - generates a template mrapids run createUser -i

Run with parameters

mrapids run getUser —param id=123

Use a JSON file

mrapids run createUser —file user.json`} lang=“bash” />

Advanced Features

Authentication Setup

Never commit API keys to version control. Always use environment variables.

<CodeBlock code={`# Set up authentication export API_KEY=“your-secret-key”

Create auth profile

cat > .mrapids/auth/default.toml << EOF [profile] name = “production” type = “bearer”

[auth] token_env = “API_KEY” EOF`} lang=“bash” filename=“.mrapids/auth/default.toml” />

Working with Collections

<CodeBlock code={`name: User Management Flow description: Complete user lifecycle operations requests:

  • name: Create User operation: createUser params: name: ”{{ userName }}” email: ”{{ userEmail }}” save_as: newUser

  • name: Verify User operation: getUser params: id: ”{{ newUser.id }}” depends_on: [“Create User”]`} lang=“yaml” filename=“user-flow.yaml” />

Collections can be shared via Git, making it easy for your entire team to use the same API workflows.

Dry Run and Preview

<CodeBlock code={`# Preview without sending (dry run) mrapids run deleteUser —param id=123 —dry-run

Show as curl command

mrapids run deleteUser —param id=123 —as-curl

Verbose output

mrapids run deleteUser —param id=123 —verbose`} lang=“bash” />

Error Handling

Always validate your API responses, especially when dealing with production data.

Common Issues and Solutions

<CodeBlock code={`# Problem: Invalid API spec mrapids doctor —fix

Problem: Authentication failed

export API_KEY=“correct-key-here” mrapids run getUser —profile production

Problem: Operation not found

mrapids list # See all available operations`} lang=“bash” />

Best Practices

1. Use `--dry-run` for testing 2. Save successful requests to collections 3. Version control your `.mrapids` folder 4. Use environment-specific profiles

Environment Management

<CodeBlock code={`# Development environment mrapids run getUser —env dev

Staging environment

mrapids run getUser —env staging

Production environment (with caution!)

mrapids run getUser —env prod —dry-run # Always dry-run first!`} lang=“bash” />

Mobile-Optimized Code Display

The code blocks are now optimized for mobile devices with:

  • Larger font size for better readability
  • Increased line height for easier scanning
  • Horizontal scrolling for long lines
  • Touch-friendly copy buttons

<CodeBlock code={// This is a long line of code that demonstrates horizontal scrolling on mobile devices - it maintains readability without wrapping const result = await mrapids.execute('createUser', { name: 'John Doe', email: 'john@example.com', role: 'admin', department: 'Engineering' });} lang=“javascript” />

Integration Examples

GitHub API Integration

<CodeBlock code={`# Initialize GitHub API mrapids init github —from-url https://raw.githubusercontent.com/github/rest-api-description/main/descriptions/api.github.com/api.github.com.json

List repositories

mrapids run repos/list-for-user —param username=octocat

Create an issue

mrapids run issues/create
—param owner=myorg
—param repo=myrepo
—param title=“Bug report”
—param body=“Description here”`} lang=“bash” filename=“github-integration.sh” />

Stripe API Integration

<CodeBlock code={`# Initialize Stripe API mrapids init stripe —from-url https://raw.githubusercontent.com/stripe/openapi/master/openapi/spec3.yaml

Create a customer

mrapids run CreateCustomer
—param email=“customer@example.com
—param name=“Jane Doe”

Process a payment

mrapids run CreatePaymentIntent
—param amount=5000
—param currency=usd`} lang=“bash” filename=“stripe-integration.sh” />

Summary

- ✅ How to install and initialize MicroRapid - ✅ Working with any OpenAPI specification - ✅ Authentication and environment management - ✅ Creating and running collections - ✅ Best practices for production use

Next Steps


This documentation page demonstrates all UX improvements including copy buttons, inline admonitions, mobile-optimized code blocks, and the feedback widget below.