mrapids 0.1.7

Your OpenAPI, but executable
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
# MicroRapid Streamlined Commands

> Simplified command structure with clear verbs and reduced overlap

## 🎯 Command Groups

### 📁 Projects
Manage projects and configuration

```bash
mrapids init                        # Scaffold a new project
mrapids config                      # View/edit configuration
mrapids cleanup                     # Remove temporary files
```

### 📋 Specs
Work with OpenAPI specifications

```bash
mrapids validate api.yaml           # Validate schema + rules
mrapids flatten api.yaml            # Dereference/flatten spec
mrapids diff old.yaml new.yaml      # Compare specifications
```

### 🔍 Discoverability
Explore and understand your API

```bash
mrapids list operations api.yaml    # List operations/components
mrapids show getUser api.yaml       # Show operation details
mrapids search "user" api.yaml      # Semantic keyword search
```

### 🚀 Execution & Quality
Run and test your API

```bash
mrapids run api.yaml --opId getUser         # Execute an operation
mrapids test api.yaml --all                 # Run tests from spec
mrapids tests init api.yaml                 # Generate test suite
```

### 🛠️ Generation
Generate code and examples

```bash
mrapids gen snippets api.yaml               # Request examples & curl
mrapids gen sdk api.yaml --lang typescript  # Generate SDK
mrapids gen stubs api.yaml --framework express  # Server stubs
mrapids gen fixtures api.yaml               # Sample payloads
```

### 🔐 Auth
Authentication management

```bash
mrapids auth login github           # OAuth login flow
mrapids auth logout github          # Remove credentials
mrapids auth status                 # Show auth profiles
```

## 📚 Detailed Command Reference

### Projects Commands

#### `init` - Scaffold a Project
```bash
# Create new project
mrapids init my-api

# From existing spec
mrapids init my-api --from https://api.example.com/openapi.json

# With template
mrapids init my-api --template rest-api
```

#### `config` - Configuration Management
```bash
# View current config
mrapids config

# Edit specific environment
mrapids config --env production

# Set configuration value
mrapids config set baseUrl https://api.prod.com --env production

# List all environments
mrapids config list
```

#### `cleanup` - Remove Artifacts
```bash
# Clean all temp files
mrapids cleanup

# Selective cleanup
mrapids cleanup --cache --logs

# Keep configuration
mrapids cleanup --all --keep-config

# Preview what will be deleted
mrapids cleanup --dry-run
```

### Specs Commands

#### `validate` - Comprehensive Validation
```bash
# Basic validation
mrapids validate api.yaml

# Strict mode (warnings as errors)
mrapids validate api.yaml --strict

# With linting rules
mrapids validate api.yaml --lint

# Custom rules
mrapids validate api.yaml --rules security.yaml

# Multiple specs
mrapids validate v1.yaml v2.yaml v3.yaml
```

#### `flatten` - Dereference Specifications
```bash
# Flatten all references
mrapids flatten api.yaml

# Save to file
mrapids flatten api.yaml --output flattened.yaml

# Include external refs
mrapids flatten api.yaml --resolve-external

# Include unused schemas
mrapids flatten api.yaml --include-unused
```

#### `diff` - Compare Specifications
```bash
# Basic comparison
mrapids diff v1.yaml v2.yaml

# Only breaking changes
mrapids diff v1.yaml v2.yaml --breaking

# Output formats
mrapids diff v1.yaml v2.yaml --format json
mrapids diff v1.yaml v2.yaml --format markdown

# Ignore descriptions
mrapids diff v1.yaml v2.yaml --ignore-descriptions
```

### Discoverability Commands

#### `list` - List API Components
```bash
# List all operations
mrapids list operations api.yaml

# Filter by method
mrapids list operations api.yaml --filter method=GET

# Filter by path pattern
mrapids list operations api.yaml --filter path=/users/*

# List schemas
mrapids list schemas api.yaml

# JSON output
mrapids list operations api.yaml --output json
```

#### `show` - Display Details
```bash
# Show operation
mrapids show getUser api.yaml

# Show schema
mrapids show User api.yaml --type schema

# Show with examples
mrapids show createUser api.yaml --examples

# Verbose output
mrapids show deleteUser api.yaml --verbose
```

#### `search` - Semantic Search
```bash
# Basic search
mrapids search "user" api.yaml

# Include descriptions
mrapids search "payment" api.yaml --in-descriptions

# Case sensitive
mrapids search "Order" api.yaml --case-sensitive

# Search in specific areas
mrapids search "auth" api.yaml --in operations,schemas
```

### Execution & Quality Commands

#### `run` - Execute Operations
```bash
# By operation ID
mrapids run api.yaml --opId getUser

# By path and method
mrapids run api.yaml --path /users/{id} --method GET

# With parameters
mrapids run api.yaml --opId getUser --param id=123

# With body
mrapids run api.yaml --opId createUser --body user.json

# Dry run
mrapids run api.yaml --opId deleteUser --dry-run

# Environment specific
mrapids run api.yaml --opId getOrders --env production
```

#### `test` - Run Tests
```bash
# Test single operation
mrapids test api.yaml --opId getUser

# Test all operations
mrapids test api.yaml --all

# From test file
mrapids test api.yaml --from tests.yaml

# Validate responses
mrapids test api.yaml --all --validate

# Performance test
mrapids test api.yaml --opId search --load 100 --concurrent 10

# Generate report
mrapids test api.yaml --all --report junit.xml
```

#### `tests init` - Initialize Test Suite
```bash
# Basic test generation
mrapids tests init api.yaml

# With specific framework
mrapids tests init api.yaml --framework pytest

# Include CI/CD config
mrapids tests init api.yaml --with-ci github-actions

# Custom output directory
mrapids tests init api.yaml --output ./tests
```

### Generation Commands

#### `gen snippets` - Generate Examples
```bash
# All examples
mrapids gen snippets api.yaml

# Specific operation
mrapids gen snippets api.yaml --opId createUser

# Output formats
mrapids gen snippets api.yaml --format curl
mrapids gen snippets api.yaml --format httpie
mrapids gen snippets api.yaml --format fetch

# Custom output
mrapids gen snippets api.yaml --output ./examples
```

#### `gen sdk` - Generate SDKs
```bash
# Single language
mrapids gen sdk api.yaml --lang typescript

# Multiple languages
mrapids gen sdk api.yaml --lang typescript,python,go

# With package info
mrapids gen sdk api.yaml --lang python --package myapi-client

# Include docs
mrapids gen sdk api.yaml --lang typescript --with-docs

# Custom templates
mrapids gen sdk api.yaml --lang java --template ./my-templates
```

#### `gen stubs` - Generate Server Stubs
```bash
# Express.js
mrapids gen stubs api.yaml --framework express

# FastAPI
mrapids gen stubs api.yaml --framework fastapi

# Spring Boot
mrapids gen stubs api.yaml --framework spring

# With tests
mrapids gen stubs api.yaml --framework express --with-tests
```

#### `gen fixtures` - Generate Test Data
```bash
# All fixtures
mrapids gen fixtures api.yaml

# Specific schemas
mrapids gen fixtures api.yaml --schema User,Order

# Number of samples
mrapids gen fixtures api.yaml --count 10

# Deterministic output
mrapids gen fixtures api.yaml --seed 42

# Output format
mrapids gen fixtures api.yaml --format json
mrapids gen fixtures api.yaml --format yaml
```

### Auth Commands

#### `auth login` - Authenticate
```bash
# OAuth providers
mrapids auth login github
mrapids auth login google --scopes "read:user,repo"

# API key
mrapids auth login api-key --name prod-key

# Custom OAuth
mrapids auth login custom --auth-url https://auth.example.com
```

#### `auth logout` - Remove Credentials
```bash
# Specific profile
mrapids auth logout github

# All profiles
mrapids auth logout --all

# Force logout
mrapids auth logout github --force
```

#### `auth status` - Show Auth Status
```bash
# All profiles
mrapids auth status

# Specific profile
mrapids auth status github

# Test authentication
mrapids auth status github --test

# JSON output
mrapids auth status --output json
```

## 🎯 Common Workflows

### Developer Workflow
```bash
# Start project
mrapids init my-api
mrapids validate api.yaml --strict

# Explore API
mrapids list operations api.yaml
mrapids search "user" api.yaml
mrapids show createUser api.yaml

# Generate and test
mrapids gen snippets api.yaml --opId createUser
mrapids run api.yaml --opId createUser --dry-run
mrapids test api.yaml --opId createUser
```

### CI/CD Pipeline
```bash
# Validation stage
mrapids validate api.yaml --strict --lint

# Test stage  
mrapids test api.yaml --all --validate

# Breaking change detection
mrapids diff prod.yaml staging.yaml --breaking

# Cleanup
mrapids cleanup --all
```

### SDK Generation
```bash
# Validate first
mrapids validate api.yaml

# Generate for multiple languages
mrapids gen sdk api.yaml --lang typescript,python,go

# Test generated SDKs
cd sdk-typescript && npm test
cd sdk-python && pytest
```

## 💡 Key Improvements

1. **Clearer Verbs**: Each command has a distinct purpose
2. **Logical Grouping**: Commands organized by workflow
3. **Consistent Patterns**: 
   - `--opId` for operation ID
   - `--output` for output format
   - `--format` for file format
   - `--env` for environment
4. **Subcommands**: Complex commands use subcommands (e.g., `auth login`, `gen sdk`)
5. **Reduced Overlap**: No more confusion between similar commands

## 🚀 Migration from Old Commands

| Old Command | New Command |
|-------------|-------------|
| `init-config` | `config` |
| `analyze` | `gen snippets` |
| `explore` | `search` |
| `setup-tests` | `tests init` |
| `sdk` | `gen sdk` |
| `generate` | `gen stubs` or `gen sdk` |
| `resolve` | `flatten` (removed - same functionality) |

---

*Simplified. Streamlined. Powerful.*