mrapids 0.1.31

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
# Modular Installation Guide - Install What You Need

## 🎯 Installation Options

Users can install:
1. **`mrapids`** only - CLI tool for API testing/automation
2. **`mrapids-agent`** only - MCP server for AI agents
3. **Both** - Complete toolkit

---

## 📦 1. Cargo (Separate Crates)

### Setup: Split into Two Crates

```toml
# mrapids-cli/Cargo.toml
[package]
name = "mrapids"
version = "0.1.0"
description = "MicroRapid CLI - API testing and automation"

[[bin]]
name = "mrapids"

# mrapids-agent/Cargo.toml
[package]
name = "mrapids-agent"
version = "0.1.0"
description = "MicroRapid Agent - MCP server for AI agents"

[[bin]]
name = "mrapids-agent"

# Optional: Meta crate for both
# mrapids-suite/Cargo.toml
[package]
name = "mrapids-suite"
version = "0.1.0"

[dependencies]
mrapids = "0.1.0"
mrapids-agent = "0.1.0"
```

### User Installation:
```bash
# Install CLI only
cargo install mrapids

# Install Agent only
cargo install mrapids-agent

# Install both
cargo install mrapids mrapids-agent
# OR
cargo install mrapids-suite
```

---

## 📦 2. NPM (Separate Packages)

### Package Structure:
```
npm/
├── @microrapid/cli/          # CLI only
│   ├── package.json
│   └── postinstall.js
├── @microrapid/agent/        # Agent only
│   ├── package.json
│   └── postinstall.js
└── @microrapid/suite/        # Both (meta-package)
    └── package.json
```

### @microrapid/cli/package.json
```json
{
  "name": "@microrapid/cli",
  "version": "0.1.0",
  "description": "MicroRapid CLI - API testing and automation",
  "bin": {
    "mrapids": "bin/mrapids.js"
  },
  "scripts": {
    "postinstall": "node postinstall.js"
  }
}
```

### @microrapid/agent/package.json
```json
{
  "name": "@microrapid/agent",
  "version": "0.1.0",
  "description": "MicroRapid Agent - MCP server for AI agents",
  "bin": {
    "mrapids-agent": "bin/mrapids-agent.js"
  },
  "scripts": {
    "postinstall": "node postinstall.js"
  }
}
```

### @microrapid/suite/package.json (Meta-package)
```json
{
  "name": "@microrapid/suite",
  "version": "0.1.0",
  "description": "MicroRapid Suite - Complete toolkit",
  "dependencies": {
    "@microrapid/cli": "^0.1.0",
    "@microrapid/agent": "^0.1.0"
  }
}
```

### Enhanced postinstall.js (with single binary download)
```javascript
// @microrapid/cli/postinstall.js
const BINARY_NAME = 'mrapids';  // Only download this binary

async function downloadBinary() {
  const platform = getPlatform();
  const url = `${BINARY_BASE_URL}/v${VERSION}/${BINARY_NAME}-${platform}`;
  const dest = path.join(__dirname, 'bin', BINARY_NAME + (platform.includes('windows') ? '.exe' : ''));
  
  console.log(`Downloading ${BINARY_NAME} for ${platform}...`);
  await download(url, dest);
  
  if (!platform.includes('windows')) {
    fs.chmodSync(dest, '755');
  }
}
```

### User Installation:
```bash
# Install CLI only
npm install -g @microrapid/cli

# Install Agent only  
npm install -g @microrapid/agent

# Install both
npm install -g @microrapid/suite
# OR
npm install -g @microrapid/cli @microrapid/agent
```

---

## 📦 3. PyPI (Separate Packages)

### Package Structure:
```
python/
├── mrapids/              # CLI only
│   ├── setup.py
│   └── mrapids/
├── mrapids-agent/        # Agent only
│   ├── setup.py
│   └── mrapids_agent/
└── mrapids-suite/        # Both (meta-package)
    └── setup.py
```

### mrapids/setup.py
```python
from setuptools import setup

setup(
    name="mrapids",
    version="0.1.0",
    description="MicroRapid CLI - API testing and automation",
    entry_points={
        'console_scripts': [
            'mrapids=mrapids:main',
        ],
    },
    install_requires=[],
    extras_require={
        'agent': ['mrapids-agent'],  # Optional agent
        'full': ['mrapids-agent'],    # Full suite
    }
)
```

### mrapids-agent/setup.py
```python
setup(
    name="mrapids-agent",
    version="0.1.0",
    description="MicroRapid Agent - MCP server for AI agents",
    entry_points={
        'console_scripts': [
            'mrapids-agent=mrapids_agent:main',
        ],
    }
)
```

### User Installation:
```bash
# Install CLI only
pip install mrapids

# Install Agent only
pip install mrapids-agent

# Install both
pip install mrapids[full]
# OR
pip install mrapids mrapids-agent
```

---

## 📦 4. Homebrew (Formula Options)

### Enhanced Formula with Options:
```ruby
class Mrapids < Formula
  desc "MicroRapid - API automation toolkit"
  homepage "https://microrapid.dev"
  version "0.1.0"
  
  # Define components
  option "without-cli", "Skip installing mrapids CLI"
  option "without-agent", "Skip installing mrapids-agent"
  option "with-cli-only", "Install only mrapids CLI"
  option "with-agent-only", "Install only mrapids-agent"

  on_macos do
    if Hardware::CPU.arm?
      url "https://github.com/microrapid/api-runtime/releases/download/v#{version}/mrapids-#{version}-darwin-arm64.tar.gz"
    else
      url "https://github.com/microrapid/api-runtime/releases/download/v#{version}/mrapids-#{version}-darwin-amd64.tar.gz"
    end
  end

  def install
    if build.with?("cli-only")
      bin.install "mrapids"
    elsif build.with?("agent-only")
      bin.install "mrapids-agent"
    else
      bin.install "mrapids" unless build.without?("cli")
      bin.install "mrapids-agent" unless build.without?("agent")
    end
  end

  def caveats
    installed = []
    installed << "mrapids" if (bin/"mrapids").exist?
    installed << "mrapids-agent" if (bin/"mrapids-agent").exist?
    
    <<~EOS
      Installed: #{installed.join(", ")}
      
      To install missing components later:
        brew reinstall mrapids
    EOS
  end
end
```

### Alternative: Separate Formulas
```ruby
# Formula/mrapids-cli.rb
class MrapidsCli < Formula
  desc "MicroRapid CLI - API testing and automation"
  # ... download only mrapids binary
end

# Formula/mrapids-agent.rb  
class MrapidsAgent < Formula
  desc "MicroRapid Agent - MCP server"
  # ... download only mrapids-agent binary
end

# Formula/mrapids-suite.rb
class MrapidsSuite < Formula
  desc "MicroRapid Suite - Complete toolkit"
  depends_on "mrapids-cli"
  depends_on "mrapids-agent"
end
```

### User Installation:
```bash
# Install CLI only
brew install mrapids --with-cli-only
# OR with separate formulas:
brew install mrapids-cli

# Install Agent only
brew install mrapids --with-agent-only
# OR with separate formulas:
brew install mrapids-agent

# Install both (default)
brew install mrapids
# OR with separate formulas:
brew install mrapids-suite
```

---

## 📦 5. Scoop (Separate Manifests)

### Manifest Structure:
```
bucket/
├── mrapids-cli.json      # CLI only
├── mrapids-agent.json    # Agent only
└── mrapids.json          # Both (depends on others)
```

### mrapids-cli.json
```json
{
    "version": "0.1.0",
    "description": "MicroRapid CLI - API testing and automation",
    "architecture": {
        "64bit": {
            "url": "https://github.com/microrapid/api-runtime/releases/download/v0.1.0/mrapids-cli-0.1.0-windows-amd64.zip",
            "hash": "SHA256_HERE",
            "extract_dir": "mrapids-cli"
        }
    },
    "bin": "mrapids.exe"
}
```

### mrapids-agent.json
```json
{
    "version": "0.1.0",
    "description": "MicroRapid Agent - MCP server",
    "architecture": {
        "64bit": {
            "url": "https://github.com/microrapid/api-runtime/releases/download/v0.1.0/mrapids-agent-0.1.0-windows-amd64.zip",
            "hash": "SHA256_HERE"
        }
    },
    "bin": "mrapids-agent.exe"
}
```

### mrapids.json (Meta-package)
```json
{
    "version": "0.1.0",
    "description": "MicroRapid Suite - Complete toolkit",
    "depends": [
        "mrapids-cli",
        "mrapids-agent"
    ],
    "notes": "This is a meta-package that installs both mrapids-cli and mrapids-agent"
}
```

### User Installation:
```powershell
# Install CLI only
scoop install mrapids-cli

# Install Agent only
scoop install mrapids-agent

# Install both
scoop install mrapids
```

---

## 🏗️ Build System Changes

### Release Script for Individual Binaries:
```bash
#!/bin/bash
# scripts/build-modular-release.sh

VERSION=${1:-0.1.0}

# Build everything
cargo build --release
cd agent && cargo build --release && cd ..

# Package individual binaries
for binary in mrapids mrapids-agent; do
    for platform in "${PLATFORMS[@]}"; do
        # Create individual archives
        if [[ "$platform" == *"windows"* ]]; then
            zip ${binary}-${VERSION}-${platform}.zip ${binary}.exe
        else
            tar czf ${binary}-${VERSION}-${platform}.tar.gz ${binary}
        fi
    done
done

# Also create combined archives for convenience
tar czf mrapids-suite-${VERSION}-${platform}.tar.gz mrapids mrapids-agent
```

---

## 📊 Installation Matrix

| Package Manager | CLI Only | Agent Only | Both | Method |
|----------------|----------|------------|------|---------|
| Cargo | `cargo install mrapids` | `cargo install mrapids-agent` | Install both | Separate crates |
| NPM | `npm i -g @microrapid/cli` | `npm i -g @microrapid/agent` | `npm i -g @microrapid/suite` | Separate packages |
| pip | `pip install mrapids` | `pip install mrapids-agent` | `pip install mrapids[full]` | Separate packages |
| Homebrew | `brew install mrapids-cli` | `brew install mrapids-agent` | `brew install mrapids` | Options or separate |
| Scoop | `scoop install mrapids-cli` | `scoop install mrapids-agent` | `scoop install mrapids` | Separate manifests |

---

## 🎯 Benefits

1. **Reduced Download Size**: Users only download what they need
2. **Faster Installation**: Smaller packages install quicker
3. **Flexibility**: Mix and match based on use case
4. **Clear Separation**: CLI vs Agent purposes are distinct
5. **Easy Updates**: Update only what you use

## 📋 Use Cases

### CLI Only Users:
- Developers testing APIs
- CI/CD pipelines
- API automation scripts
- Don't need AI agent features

### Agent Only Users:
- AI/LLM developers
- Running MCP servers
- Agent-based automation
- Don't need CLI testing tools

### Full Suite Users:
- Complete API development workflow
- Both human and AI agent access
- Full feature set

This modular approach gives users complete control over what they install!