@magpiecloud/mags 1.8.13 → 1.8.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +95 -378
- package/bin/mags.js +196 -104
- package/index.js +6 -52
- package/package.json +22 -4
- package/API.md +0 -388
- package/Mags-API.postman_collection.json +0 -374
- package/QUICKSTART.md +0 -295
- package/deploy-page.sh +0 -171
- package/mags +0 -0
- package/mags.sh +0 -270
- package/nodejs/README.md +0 -197
- package/nodejs/bin/mags.js +0 -1146
- package/nodejs/index.js +0 -642
- package/nodejs/package.json +0 -42
- package/python/INTEGRATION.md +0 -800
- package/python/README.md +0 -161
- package/python/dist/magpie_mags-1.3.5-py3-none-any.whl +0 -0
- package/python/dist/magpie_mags-1.3.5.tar.gz +0 -0
- package/python/examples/demo.py +0 -181
- package/python/pyproject.toml +0 -39
- package/python/src/magpie_mags.egg-info/PKG-INFO +0 -182
- package/python/src/magpie_mags.egg-info/SOURCES.txt +0 -9
- package/python/src/magpie_mags.egg-info/dependency_links.txt +0 -1
- package/python/src/magpie_mags.egg-info/requires.txt +0 -1
- package/python/src/magpie_mags.egg-info/top_level.txt +0 -1
- package/python/src/mags/__init__.py +0 -6
- package/python/src/mags/client.py +0 -573
- package/python/test_sdk.py +0 -78
- package/skill.md +0 -153
- package/website/api.html +0 -1095
- package/website/claude-skill.html +0 -481
- package/website/cookbook/hn-marketing.html +0 -410
- package/website/cookbook/hn-marketing.sh +0 -42
- package/website/cookbook.html +0 -282
- package/website/env.js +0 -4
- package/website/index.html +0 -801
- package/website/llms.txt +0 -334
- package/website/login.html +0 -108
- package/website/mags.md +0 -210
- package/website/script.js +0 -453
- package/website/styles.css +0 -908
- package/website/tokens.html +0 -169
- package/website/usage.html +0 -185
package/skill.md
DELETED
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
# Mags - Instant VM Execution
|
|
2
|
-
|
|
3
|
-
Execute scripts instantly on Magpie's microVM infrastructure. VMs boot in <100ms from a warm pool.
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
Add this skill to your Claude Code project:
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
# Copy to your project's .claude/commands folder
|
|
11
|
-
cp -r mags ~/.claude/commands/
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
Or add to a specific project:
|
|
15
|
-
```bash
|
|
16
|
-
cp -r mags /path/to/project/.claude/commands/
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
## Configuration
|
|
20
|
-
|
|
21
|
-
Set your API token:
|
|
22
|
-
```bash
|
|
23
|
-
export MAGS_API_TOKEN="your-token-here"
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
Or create a `.env` file:
|
|
27
|
-
```
|
|
28
|
-
MAGS_API_TOKEN=your-token-here
|
|
29
|
-
MAGS_API_URL=https://api.magpiecloud.com
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
## CLI Commands
|
|
33
|
-
|
|
34
|
-
### Basic Execution
|
|
35
|
-
```bash
|
|
36
|
-
# Run a simple command
|
|
37
|
-
mags run "echo Hello World"
|
|
38
|
-
|
|
39
|
-
# Run with persistent workspace (changes persist to S3)
|
|
40
|
-
mags run -w my-project "apk add nodejs npm && npm init -y"
|
|
41
|
-
|
|
42
|
-
# Run again - nodejs is already installed!
|
|
43
|
-
mags run -w my-project "node --version"
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
### Persistent VMs with URL Access
|
|
47
|
-
```bash
|
|
48
|
-
# Deploy a web server with public URL
|
|
49
|
-
mags run -w webapp -p --url "python3 -m http.server 8080"
|
|
50
|
-
# Returns: https://abc123.apps.magpiecloud.com
|
|
51
|
-
|
|
52
|
-
# With startup command (runs when VM wakes from sleep)
|
|
53
|
-
mags run -w webapp -p --url --startup-command "npm start" "npm install && npm start"
|
|
54
|
-
|
|
55
|
-
# Custom port
|
|
56
|
-
mags run -w webapp -p --url --port 3000 "npm start"
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
### Other Commands
|
|
60
|
-
```bash
|
|
61
|
-
# Check job status
|
|
62
|
-
mags status <request_id>
|
|
63
|
-
|
|
64
|
-
# View job logs
|
|
65
|
-
mags logs <request_id>
|
|
66
|
-
|
|
67
|
-
# List recent jobs
|
|
68
|
-
mags list
|
|
69
|
-
|
|
70
|
-
# Enable URL access for existing persistent job
|
|
71
|
-
mags url <request_id>
|
|
72
|
-
mags url <request_id> --port 3000
|
|
73
|
-
mags url <request_id> --startup "npm start"
|
|
74
|
-
|
|
75
|
-
# SSH into a workspace
|
|
76
|
-
mags ssh my-project
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
## CLI Flags
|
|
80
|
-
|
|
81
|
-
| Flag | Description |
|
|
82
|
-
|------|-------------|
|
|
83
|
-
| `-w, --workspace` | Workspace ID for persistent storage |
|
|
84
|
-
| `-p, --persistent` | Keep VM alive for URL/SSH access |
|
|
85
|
-
| `--url` | Enable public URL access (requires -p) |
|
|
86
|
-
| `--port` | Port to expose (default: 8080) |
|
|
87
|
-
| `--startup-command` | Command to run when VM wakes from sleep |
|
|
88
|
-
| `-e, --ephemeral` | Truly ephemeral (no S3 sync, faster) |
|
|
89
|
-
| `-t, --timeout` | Timeout in seconds (default: 300) |
|
|
90
|
-
|
|
91
|
-
## API Reference
|
|
92
|
-
|
|
93
|
-
Base URL: `https://api.magpiecloud.com/api/v1`
|
|
94
|
-
|
|
95
|
-
| Endpoint | Method | Description |
|
|
96
|
-
|----------|--------|-------------|
|
|
97
|
-
| `/mags-jobs` | POST | Submit a new job |
|
|
98
|
-
| `/mags-jobs` | GET | List jobs |
|
|
99
|
-
| `/mags-jobs/{id}/status` | GET | Get job status |
|
|
100
|
-
| `/mags-jobs/{id}/logs` | GET | Get job logs |
|
|
101
|
-
| `/mags-jobs/{id}/access` | POST | Enable SSH/URL access |
|
|
102
|
-
| `/mags-jobs/{id}` | PATCH | Update job (startup command) |
|
|
103
|
-
|
|
104
|
-
### Submit Job
|
|
105
|
-
```bash
|
|
106
|
-
curl -X POST https://api.magpiecloud.com/api/v1/mags-jobs \
|
|
107
|
-
-H "Authorization: Bearer $MAGS_API_TOKEN" \
|
|
108
|
-
-H "Content-Type: application/json" \
|
|
109
|
-
-d '{
|
|
110
|
-
"script": "echo hello",
|
|
111
|
-
"type": "inline",
|
|
112
|
-
"workspace_id": "my-workspace",
|
|
113
|
-
"persistent": true,
|
|
114
|
-
"startup_command": "python3 -m http.server 8080"
|
|
115
|
-
}'
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
### Enable URL Access
|
|
119
|
-
```bash
|
|
120
|
-
curl -X POST https://api.magpiecloud.com/api/v1/mags-jobs/{id}/access \
|
|
121
|
-
-H "Authorization: Bearer $MAGS_API_TOKEN" \
|
|
122
|
-
-H "Content-Type: application/json" \
|
|
123
|
-
-d '{"port": 8080}'
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
## Response Times
|
|
127
|
-
|
|
128
|
-
- **Warm start**: <100ms (VM from pool)
|
|
129
|
-
- **Cold start**: ~4 seconds (VM boot from scratch)
|
|
130
|
-
- **Script overhead**: ~50ms
|
|
131
|
-
|
|
132
|
-
## Examples
|
|
133
|
-
|
|
134
|
-
### Deploy a Python Web Server
|
|
135
|
-
```bash
|
|
136
|
-
mags run -w webserver -p --url \
|
|
137
|
-
"echo '<h1>Hello from Mags!</h1>' > ~/index.html && python3 -m http.server 8080"
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
### Deploy Node.js App
|
|
141
|
-
```bash
|
|
142
|
-
mags run -w nodeapp -p --url --port 3000 --startup-command "npm start" \
|
|
143
|
-
"apk add nodejs npm && npm install && npm start"
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
### Run Tests with Dependencies
|
|
147
|
-
```bash
|
|
148
|
-
# First run installs dependencies
|
|
149
|
-
mags run -w myproject "apk add python3 py3-pip && pip install pytest requests"
|
|
150
|
-
|
|
151
|
-
# Subsequent runs are instant
|
|
152
|
-
mags run -w myproject "pytest tests/"
|
|
153
|
-
```
|