@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/website/index.html
DELETED
|
@@ -1,801 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8" />
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
-
<title>Mags - Secure Cloud Sandboxes for AI Agents and Developers</title>
|
|
7
|
-
<meta
|
|
8
|
-
name="description"
|
|
9
|
-
content="Mags gives AI agents and developers secure, isolated sandboxes that boot in milliseconds. Workspaces persist automatically to the cloud. Run code, schedule jobs, and let agents work safely."
|
|
10
|
-
/>
|
|
11
|
-
<meta name="api-base" content="https://api.magpiecloud.com" />
|
|
12
|
-
<meta name="auth-base" content="https://api.magpiecloud.com" />
|
|
13
|
-
<link rel="stylesheet" href="styles.css?v=7" />
|
|
14
|
-
<script src="env.js"></script>
|
|
15
|
-
</head>
|
|
16
|
-
<body>
|
|
17
|
-
<div class="backdrop"></div>
|
|
18
|
-
|
|
19
|
-
<header class="site-header">
|
|
20
|
-
<div class="container nav">
|
|
21
|
-
<div class="brand">
|
|
22
|
-
<span class="logo">Mags</span>
|
|
23
|
-
<span class="tag">Secure cloud sandboxes for the AI age</span>
|
|
24
|
-
</div>
|
|
25
|
-
<nav class="nav-links">
|
|
26
|
-
<a href="#quickstart">Docs</a>
|
|
27
|
-
<a href="api.html">API</a>
|
|
28
|
-
<a href="cookbook.html">Cookbook</a>
|
|
29
|
-
<a href="https://discord.gg/3avpC2nS" target="_blank" rel="noreferrer">Discord</a>
|
|
30
|
-
<a href="login.html" id="nav-auth-link">Login</a>
|
|
31
|
-
</nav>
|
|
32
|
-
<div class="nav-cta">
|
|
33
|
-
<a class="button ghost" href="login.html" id="cta-auth-link">Login</a>
|
|
34
|
-
</div>
|
|
35
|
-
</div>
|
|
36
|
-
</header>
|
|
37
|
-
|
|
38
|
-
<main>
|
|
39
|
-
<!-- ── Hero ────────────────────────────────────────── -->
|
|
40
|
-
<section class="hero" id="overview">
|
|
41
|
-
<div class="container hero-grid">
|
|
42
|
-
<div class="hero-copy">
|
|
43
|
-
<h1>Secure sandboxes that boot in milliseconds. Your data stays.</h1>
|
|
44
|
-
<p class="lead">
|
|
45
|
-
Give your AI agents an instant home. Every sandbox is
|
|
46
|
-
completely isolated, boots in ~300ms, and syncs your files to the cloud
|
|
47
|
-
automatically. CLI, Python, and Node.js — pick your tool.
|
|
48
|
-
</p>
|
|
49
|
-
<div class="hero-actions">
|
|
50
|
-
<a class="button" href="#quickstart">Quickstart</a>
|
|
51
|
-
<a class="button ghost" href="api.html">API Reference</a>
|
|
52
|
-
</div>
|
|
53
|
-
</div>
|
|
54
|
-
<div class="hero-card tab-group" aria-label="Mags example">
|
|
55
|
-
<div class="tab-bar">
|
|
56
|
-
<button class="tab active" data-tab="hero-cli">CLI</button>
|
|
57
|
-
<button class="tab" data-tab="hero-python">Python</button>
|
|
58
|
-
<button class="tab" data-tab="hero-node">Node.js</button>
|
|
59
|
-
</div>
|
|
60
|
-
<div class="tab-content active" data-tab="hero-cli">
|
|
61
|
-
<pre><code>mags run 'echo Hello World'
|
|
62
|
-
mags run -w myproject -p 'pip install flask'
|
|
63
|
-
mags new dev && mags ssh dev</code></pre>
|
|
64
|
-
<p class="card-note">Run a script, persist your files to the cloud, then jump in with SSH.</p>
|
|
65
|
-
</div>
|
|
66
|
-
<div class="tab-content" data-tab="hero-python">
|
|
67
|
-
<pre><code>from mags import Mags
|
|
68
|
-
|
|
69
|
-
m = Mags()
|
|
70
|
-
result = m.run_and_wait("echo Hello World")
|
|
71
|
-
print(result["status"]) # "completed"</code></pre>
|
|
72
|
-
<p class="card-note">pip install magpie-mags</p>
|
|
73
|
-
</div>
|
|
74
|
-
<div class="tab-content" data-tab="hero-node">
|
|
75
|
-
<pre><code>const Mags = require('@magpiecloud/mags');
|
|
76
|
-
const mags = new Mags();
|
|
77
|
-
|
|
78
|
-
const result = await mags.runAndWait('echo Hello World');
|
|
79
|
-
console.log(result.logs);</code></pre>
|
|
80
|
-
<p class="card-note">npm install @magpiecloud/mags</p>
|
|
81
|
-
</div>
|
|
82
|
-
</div>
|
|
83
|
-
</div>
|
|
84
|
-
</section>
|
|
85
|
-
|
|
86
|
-
<!-- ── Quickstart ──────────────────────────────────── -->
|
|
87
|
-
<section class="section" id="quickstart">
|
|
88
|
-
<div class="container">
|
|
89
|
-
<div class="section-title">
|
|
90
|
-
<p>Quickstart</p>
|
|
91
|
-
<h2>Three steps. Your first sandbox in under a minute.</h2>
|
|
92
|
-
</div>
|
|
93
|
-
<div class="tab-group">
|
|
94
|
-
<div class="tab-bar">
|
|
95
|
-
<button class="tab active" data-tab="qs-cli">CLI</button>
|
|
96
|
-
<button class="tab" data-tab="qs-python">Python</button>
|
|
97
|
-
<button class="tab" data-tab="qs-node">Node.js</button>
|
|
98
|
-
</div>
|
|
99
|
-
<div class="tab-content active" data-tab="qs-cli">
|
|
100
|
-
<div class="grid cards">
|
|
101
|
-
<article class="card" data-reveal>
|
|
102
|
-
<h3>1. Install</h3>
|
|
103
|
-
<pre><code>npm install -g @magpiecloud/mags</code></pre>
|
|
104
|
-
</article>
|
|
105
|
-
<article class="card" data-reveal>
|
|
106
|
-
<h3>2. Authenticate</h3>
|
|
107
|
-
<pre><code>mags login</code></pre>
|
|
108
|
-
<p>Or set a token directly:</p>
|
|
109
|
-
<pre><code>export MAGS_API_TOKEN="your-token"</code></pre>
|
|
110
|
-
</article>
|
|
111
|
-
<article class="card" data-reveal>
|
|
112
|
-
<h3>3. Run</h3>
|
|
113
|
-
<pre><code>mags run 'echo Hello World'</code></pre>
|
|
114
|
-
<p>Add <code>-w myproject -p</code> to persist files to the cloud between runs.</p>
|
|
115
|
-
</article>
|
|
116
|
-
</div>
|
|
117
|
-
</div>
|
|
118
|
-
<div class="tab-content" data-tab="qs-python">
|
|
119
|
-
<div class="grid cards">
|
|
120
|
-
<article class="card" data-reveal>
|
|
121
|
-
<h3>1. Install</h3>
|
|
122
|
-
<pre><code>pip install magpie-mags</code></pre>
|
|
123
|
-
</article>
|
|
124
|
-
<article class="card" data-reveal>
|
|
125
|
-
<h3>2. Set your token</h3>
|
|
126
|
-
<pre><code>export MAGS_API_TOKEN="your-token"</code></pre>
|
|
127
|
-
<p>Or pass it directly: <code>Mags(api_token="...")</code></p>
|
|
128
|
-
</article>
|
|
129
|
-
<article class="card" data-reveal>
|
|
130
|
-
<h3>3. Run</h3>
|
|
131
|
-
<pre><code>from mags import Mags
|
|
132
|
-
|
|
133
|
-
m = Mags()
|
|
134
|
-
result = m.run_and_wait("echo Hello World")
|
|
135
|
-
for log in result["logs"]:
|
|
136
|
-
print(log["message"])</code></pre>
|
|
137
|
-
</article>
|
|
138
|
-
</div>
|
|
139
|
-
</div>
|
|
140
|
-
<div class="tab-content" data-tab="qs-node">
|
|
141
|
-
<div class="grid cards">
|
|
142
|
-
<article class="card" data-reveal>
|
|
143
|
-
<h3>1. Install</h3>
|
|
144
|
-
<pre><code>npm install @magpiecloud/mags</code></pre>
|
|
145
|
-
</article>
|
|
146
|
-
<article class="card" data-reveal>
|
|
147
|
-
<h3>2. Set your token</h3>
|
|
148
|
-
<pre><code>export MAGS_API_TOKEN="your-token"</code></pre>
|
|
149
|
-
<p>Or pass it directly: <code>new Mags({ apiToken: "..." })</code></p>
|
|
150
|
-
</article>
|
|
151
|
-
<article class="card" data-reveal>
|
|
152
|
-
<h3>3. Run</h3>
|
|
153
|
-
<pre><code>const Mags = require('@magpiecloud/mags');
|
|
154
|
-
const mags = new Mags();
|
|
155
|
-
|
|
156
|
-
const result = await mags.runAndWait('echo Hello');
|
|
157
|
-
console.log(result.status); // "completed"</code></pre>
|
|
158
|
-
</article>
|
|
159
|
-
</div>
|
|
160
|
-
</div>
|
|
161
|
-
</div>
|
|
162
|
-
</div>
|
|
163
|
-
</section>
|
|
164
|
-
|
|
165
|
-
<!-- ── Usage Patterns ──────────────────────────────── -->
|
|
166
|
-
<section class="section" id="patterns">
|
|
167
|
-
<div class="container">
|
|
168
|
-
<div class="section-title">
|
|
169
|
-
<p>Usage Patterns</p>
|
|
170
|
-
<h2>Run agents. Schedule jobs. Deploy apps. All sandboxed.</h2>
|
|
171
|
-
</div>
|
|
172
|
-
<div class="tab-group">
|
|
173
|
-
<div class="tab-bar">
|
|
174
|
-
<button class="tab active" data-tab="ref-cli">CLI</button>
|
|
175
|
-
<button class="tab" data-tab="ref-python">Python SDK</button>
|
|
176
|
-
<button class="tab" data-tab="ref-node">Node.js SDK</button>
|
|
177
|
-
</div>
|
|
178
|
-
|
|
179
|
-
<!-- ── CLI Reference ── -->
|
|
180
|
-
<div class="tab-content active" data-tab="ref-cli">
|
|
181
|
-
<div class="ref-section">
|
|
182
|
-
<h3>Install</h3>
|
|
183
|
-
<pre><code>npm install -g @magpiecloud/mags
|
|
184
|
-
mags login</code></pre>
|
|
185
|
-
</div>
|
|
186
|
-
|
|
187
|
-
<div class="ref-section">
|
|
188
|
-
<h3>Running Scripts</h3>
|
|
189
|
-
<div class="ref-table-wrap">
|
|
190
|
-
<table class="ref-table">
|
|
191
|
-
<thead><tr><th>Command</th><th>Description</th></tr></thead>
|
|
192
|
-
<tbody>
|
|
193
|
-
<tr><td><code>mags run <script></code></td><td>Run a script in a fresh sandbox. Fastest — no workspace, no persistence.</td></tr>
|
|
194
|
-
<tr><td><code>mags run -w <name> <script></code></td><td>Run with a named workspace. Data stays on the VM only — deleted after 10 min idle.</td></tr>
|
|
195
|
-
<tr><td><code>mags run -w <name> -p <script></code></td><td>Run with a persistent workspace. Files synced to S3 and survive across runs indefinitely.</td></tr>
|
|
196
|
-
<tr><td><code>mags run --url --port <port> <script></code></td><td>Request a public HTTPS URL for your sandbox (requires <code>-p</code>).</td></tr>
|
|
197
|
-
<tr><td><code>mags run --no-sleep <script></code></td><td>Keep sandbox running 24/7, never auto-sleep (requires <code>-p</code>).</td></tr>
|
|
198
|
-
<tr><td><code>mags run -e <script></code></td><td>Ephemeral — no workspace at all, fastest possible execution.</td></tr>
|
|
199
|
-
<tr><td><code>mags run --base <workspace> <script></code></td><td>Use an existing workspace as a read-only base image (OverlayFS).</td></tr>
|
|
200
|
-
<tr><td><code>mags run -f <file> <script></code></td><td>Upload file(s) into the sandbox before running (repeatable).</td></tr>
|
|
201
|
-
</tbody>
|
|
202
|
-
</table>
|
|
203
|
-
</div>
|
|
204
|
-
</div>
|
|
205
|
-
|
|
206
|
-
<div class="ref-section">
|
|
207
|
-
<h3>Sandboxes</h3>
|
|
208
|
-
<div class="ref-table-wrap">
|
|
209
|
-
<table class="ref-table">
|
|
210
|
-
<thead><tr><th>Command</th><th>Description</th></tr></thead>
|
|
211
|
-
<tbody>
|
|
212
|
-
<tr><td><code>mags new <name></code></td><td>Create a new sandbox. Workspace lives on local disk only.</td></tr>
|
|
213
|
-
<tr><td><code>mags new <name> -p</code></td><td>Create a sandbox with persistent workspace — synced to S3.</td></tr>
|
|
214
|
-
<tr><td><code>mags exec <name> <cmd></code></td><td>Execute a command on an existing sandbox.</td></tr>
|
|
215
|
-
<tr><td><code>mags ssh <name></code></td><td>SSH into a sandbox. Auto-starts if sleeping or stopped.</td></tr>
|
|
216
|
-
</tbody>
|
|
217
|
-
</table>
|
|
218
|
-
</div>
|
|
219
|
-
</div>
|
|
220
|
-
|
|
221
|
-
<div class="ref-section">
|
|
222
|
-
<h3>Management</h3>
|
|
223
|
-
<div class="ref-table-wrap">
|
|
224
|
-
<table class="ref-table">
|
|
225
|
-
<thead><tr><th>Command</th><th>Description</th></tr></thead>
|
|
226
|
-
<tbody>
|
|
227
|
-
<tr><td><code>mags list</code></td><td>List recent jobs</td></tr>
|
|
228
|
-
<tr><td><code>mags status <id></code></td><td>Get job status</td></tr>
|
|
229
|
-
<tr><td><code>mags logs <id></code></td><td>Get job output</td></tr>
|
|
230
|
-
<tr><td><code>mags stop <id></code></td><td>Stop a running job</td></tr>
|
|
231
|
-
<tr><td><code>mags set <id> [options]</code></td><td>Update VM settings (e.g. <code>--no-sleep</code>, <code>--sleep</code>)</td></tr>
|
|
232
|
-
<tr><td><code>mags sync <workspace></code></td><td>Sync workspace to the cloud now</td></tr>
|
|
233
|
-
<tr><td><code>mags url <id> [port]</code></td><td>Enable public URL access</td></tr>
|
|
234
|
-
<tr><td><code>mags resize <workspace> --disk <GB></code></td><td>Resize workspace disk</td></tr>
|
|
235
|
-
<tr><td><code>mags workspace list</code></td><td>List persistent workspaces</td></tr>
|
|
236
|
-
<tr><td><code>mags workspace delete <id></code></td><td>Delete workspace + cloud data</td></tr>
|
|
237
|
-
<tr><td><code>mags url alias <sub> <workspace></code></td><td>Create a stable URL alias</td></tr>
|
|
238
|
-
<tr><td><code>mags url alias list</code></td><td>List URL aliases</td></tr>
|
|
239
|
-
<tr><td><code>mags url alias remove <sub></code></td><td>Delete a URL alias</td></tr>
|
|
240
|
-
<tr><td><code>mags cron add [opts] <script></code></td><td>Create a scheduled cron job</td></tr>
|
|
241
|
-
<tr><td><code>mags cron list</code></td><td>List cron jobs</td></tr>
|
|
242
|
-
<tr><td><code>mags cron enable <id></code></td><td>Enable a cron job</td></tr>
|
|
243
|
-
<tr><td><code>mags cron disable <id></code></td><td>Disable a cron job</td></tr>
|
|
244
|
-
<tr><td><code>mags cron remove <id></code></td><td>Delete a cron job</td></tr>
|
|
245
|
-
</tbody>
|
|
246
|
-
</table>
|
|
247
|
-
</div>
|
|
248
|
-
</div>
|
|
249
|
-
|
|
250
|
-
<div class="ref-section">
|
|
251
|
-
<h3>Additional Flags</h3>
|
|
252
|
-
<div class="ref-table-wrap">
|
|
253
|
-
<table class="ref-table">
|
|
254
|
-
<thead><tr><th>Flag</th><th>Description</th></tr></thead>
|
|
255
|
-
<tbody>
|
|
256
|
-
<tr><td><code>-n, --name <name></code></td><td>Alias for <code>-w</code></td></tr>
|
|
257
|
-
<tr><td><code>-e, --ephemeral</code></td><td>No workspace at all, fastest possible execution</td></tr>
|
|
258
|
-
<tr><td><code>--base <workspace></code></td><td>Use an existing workspace as a read-only base image</td></tr>
|
|
259
|
-
<tr><td><code>--disk <GB></code></td><td>Custom disk size in GB (default: 2)</td></tr>
|
|
260
|
-
<tr><td><code>--startup-command <cmd></code></td><td>Command to run when sandbox wakes from sleep</td></tr>
|
|
261
|
-
</tbody>
|
|
262
|
-
</table>
|
|
263
|
-
</div>
|
|
264
|
-
</div>
|
|
265
|
-
|
|
266
|
-
<div class="ref-section">
|
|
267
|
-
<h3>Examples</h3>
|
|
268
|
-
<pre><code># Persistent workspace — install packages, then run your app
|
|
269
|
-
mags run -w myproject -p 'pip install flask requests'
|
|
270
|
-
mags run -w myproject -p 'python3 app.py'
|
|
271
|
-
|
|
272
|
-
# Golden image — create once, fork many times
|
|
273
|
-
mags run -w golden -p 'apk add nodejs npm && npm install -g typescript'
|
|
274
|
-
mags sync golden
|
|
275
|
-
mags run --base golden -w fork-1 -p 'npm test'
|
|
276
|
-
|
|
277
|
-
# Interactive sandbox with SSH
|
|
278
|
-
mags new dev -p
|
|
279
|
-
mags ssh dev
|
|
280
|
-
mags exec dev 'node --version'
|
|
281
|
-
|
|
282
|
-
# Always-on web server with public URL
|
|
283
|
-
mags run -w webapp -p --no-sleep --url --port 8080 \
|
|
284
|
-
--startup-command 'python3 -m http.server 8080' \
|
|
285
|
-
'python3 -m http.server 8080'
|
|
286
|
-
|
|
287
|
-
# Cron job
|
|
288
|
-
mags cron add --name backup --schedule "0 0 * * *" \
|
|
289
|
-
-w backups 'tar czf backup.tar.gz /data'</code></pre>
|
|
290
|
-
</div>
|
|
291
|
-
</div>
|
|
292
|
-
|
|
293
|
-
<!-- ── Python SDK Reference ── -->
|
|
294
|
-
<div class="tab-content" data-tab="ref-python">
|
|
295
|
-
<div class="ref-section">
|
|
296
|
-
<h3>Install</h3>
|
|
297
|
-
<pre><code>pip install magpie-mags
|
|
298
|
-
export MAGS_API_TOKEN="your-token"</code></pre>
|
|
299
|
-
</div>
|
|
300
|
-
|
|
301
|
-
<div class="ref-section">
|
|
302
|
-
<h3>Methods</h3>
|
|
303
|
-
<div class="ref-table-wrap">
|
|
304
|
-
<table class="ref-table">
|
|
305
|
-
<thead><tr><th>Method</th><th>Description</th></tr></thead>
|
|
306
|
-
<tbody>
|
|
307
|
-
<tr><td><code>run(script, **opts)</code></td><td>Submit a job (returns immediately)</td></tr>
|
|
308
|
-
<tr><td><code>run_and_wait(script, **opts)</code></td><td>Submit + block until complete</td></tr>
|
|
309
|
-
<tr><td><code>new(name, **opts)</code></td><td>Create VM sandbox (pass <code>persistent=True</code> for S3)</td></tr>
|
|
310
|
-
<tr><td><code>exec(name, command)</code></td><td>Run command on existing sandbox via SSH</td></tr>
|
|
311
|
-
<tr><td><code>stop(name_or_id)</code></td><td>Stop a running job</td></tr>
|
|
312
|
-
<tr><td><code>find_job(name_or_id)</code></td><td>Find job by name or workspace</td></tr>
|
|
313
|
-
<tr><td><code>url(name_or_id, port)</code></td><td>Enable public URL access</td></tr>
|
|
314
|
-
<tr><td><code>resize(workspace, disk_gb)</code></td><td>Resize workspace disk</td></tr>
|
|
315
|
-
<tr><td><code>status(request_id)</code></td><td>Get job status</td></tr>
|
|
316
|
-
<tr><td><code>logs(request_id)</code></td><td>Get job logs</td></tr>
|
|
317
|
-
<tr><td><code>list_jobs()</code></td><td>List recent jobs</td></tr>
|
|
318
|
-
<tr><td><code>update_job(request_id, **opts)</code></td><td>Update job settings (<code>no_sleep</code>, <code>startup_command</code>)</td></tr>
|
|
319
|
-
<tr><td><code>enable_access(id, port)</code></td><td>Enable URL or SSH access (low-level)</td></tr>
|
|
320
|
-
<tr><td><code>upload_file(path)</code></td><td>Upload a file, returns file ID</td></tr>
|
|
321
|
-
<tr><td><code>upload_files(paths)</code></td><td>Upload files, returns file IDs</td></tr>
|
|
322
|
-
<tr><td><code>list_workspaces()</code></td><td>List persistent workspaces</td></tr>
|
|
323
|
-
<tr><td><code>delete_workspace(id)</code></td><td>Delete workspace + cloud data</td></tr>
|
|
324
|
-
<tr><td><code>sync(request_id)</code></td><td>Sync workspace to S3 now</td></tr>
|
|
325
|
-
<tr><td><code>url_alias_create(sub, ws_id)</code></td><td>Create a stable URL alias</td></tr>
|
|
326
|
-
<tr><td><code>url_alias_list()</code></td><td>List URL aliases</td></tr>
|
|
327
|
-
<tr><td><code>url_alias_delete(sub)</code></td><td>Delete a URL alias</td></tr>
|
|
328
|
-
<tr><td><code>cron_create(**opts)</code></td><td>Create a cron job</td></tr>
|
|
329
|
-
<tr><td><code>cron_list()</code></td><td>List cron jobs</td></tr>
|
|
330
|
-
<tr><td><code>cron_update(id, **opts)</code></td><td>Update a cron job</td></tr>
|
|
331
|
-
<tr><td><code>cron_delete(id)</code></td><td>Delete a cron job</td></tr>
|
|
332
|
-
<tr><td><code>usage(window_days)</code></td><td>Get usage stats</td></tr>
|
|
333
|
-
</tbody>
|
|
334
|
-
</table>
|
|
335
|
-
</div>
|
|
336
|
-
</div>
|
|
337
|
-
|
|
338
|
-
<div class="ref-section">
|
|
339
|
-
<h3>Run Options</h3>
|
|
340
|
-
<div class="ref-table-wrap">
|
|
341
|
-
<table class="ref-table">
|
|
342
|
-
<thead><tr><th>Parameter</th><th>Description</th></tr></thead>
|
|
343
|
-
<tbody>
|
|
344
|
-
<tr><td><code>workspace_id</code></td><td>Name the workspace. Local only unless <code>persistent=True</code>.</td></tr>
|
|
345
|
-
<tr><td><code>persistent</code></td><td>Keep sandbox alive, sync workspace to S3. Files persist indefinitely.</td></tr>
|
|
346
|
-
<tr><td><code>base_workspace_id</code></td><td>Mount a workspace read-only as base image</td></tr>
|
|
347
|
-
<tr><td><code>no_sleep</code></td><td>Never auto-sleep (requires <code>persistent=True</code>)</td></tr>
|
|
348
|
-
<tr><td><code>ephemeral</code></td><td>No workspace, no sync (fastest)</td></tr>
|
|
349
|
-
<tr><td><code>file_ids</code></td><td>List of uploaded file IDs to include</td></tr>
|
|
350
|
-
<tr><td><code>startup_command</code></td><td>Command to run when sandbox wakes</td></tr>
|
|
351
|
-
</tbody>
|
|
352
|
-
</table>
|
|
353
|
-
</div>
|
|
354
|
-
</div>
|
|
355
|
-
|
|
356
|
-
<div class="ref-section">
|
|
357
|
-
<h3>Examples</h3>
|
|
358
|
-
<pre><code>from mags import Mags
|
|
359
|
-
m = Mags() # reads MAGS_API_TOKEN from env
|
|
360
|
-
|
|
361
|
-
# Run a command and wait
|
|
362
|
-
result = m.run_and_wait("echo Hello World")
|
|
363
|
-
print(result["status"]) # "completed"
|
|
364
|
-
|
|
365
|
-
# Local workspace (no S3 sync, good for analysis)
|
|
366
|
-
m.run_and_wait("python3 analyze.py", workspace_id="analysis")
|
|
367
|
-
|
|
368
|
-
# Persistent workspace (synced to S3)
|
|
369
|
-
m.run("pip install flask",
|
|
370
|
-
workspace_id="my-project", persistent=True)
|
|
371
|
-
|
|
372
|
-
# Create a sandbox (local disk)
|
|
373
|
-
m.new("my-project")
|
|
374
|
-
|
|
375
|
-
# Create with S3 persistence
|
|
376
|
-
m.new("my-project", persistent=True)
|
|
377
|
-
|
|
378
|
-
# Execute commands on existing sandbox
|
|
379
|
-
result = m.exec("my-project", "ls -la /root")
|
|
380
|
-
print(result["output"])
|
|
381
|
-
|
|
382
|
-
# Public URL
|
|
383
|
-
m.new("webapp", persistent=True)
|
|
384
|
-
info = m.url("webapp", port=3000)
|
|
385
|
-
print(info["url"]) # https://xyz.apps.magpiecloud.com
|
|
386
|
-
|
|
387
|
-
# Always-on sandbox (never auto-sleeps)
|
|
388
|
-
m.run("python3 worker.py",
|
|
389
|
-
workspace_id="worker", persistent=True, no_sleep=True)
|
|
390
|
-
|
|
391
|
-
# Upload files
|
|
392
|
-
file_ids = m.upload_files(["script.py", "data.csv"])
|
|
393
|
-
m.run_and_wait("python3 /uploads/script.py", file_ids=file_ids)
|
|
394
|
-
|
|
395
|
-
# Workspaces
|
|
396
|
-
workspaces = m.list_workspaces()
|
|
397
|
-
m.delete_workspace("myproject")
|
|
398
|
-
|
|
399
|
-
# Cron
|
|
400
|
-
m.cron_create(name="backup", cron_expression="0 0 * * *",
|
|
401
|
-
script="tar czf backup.tar.gz /data", workspace_id="backups")</code></pre>
|
|
402
|
-
</div>
|
|
403
|
-
<p><a class="text-link" href="https://pypi.org/project/magpie-mags/" rel="noreferrer">View on PyPI →</a></p>
|
|
404
|
-
</div>
|
|
405
|
-
|
|
406
|
-
<!-- ── Node.js SDK Reference ── -->
|
|
407
|
-
<div class="tab-content" data-tab="ref-node">
|
|
408
|
-
<div class="ref-section">
|
|
409
|
-
<h3>Install</h3>
|
|
410
|
-
<pre><code>npm install @magpiecloud/mags
|
|
411
|
-
export MAGS_API_TOKEN="your-token"</code></pre>
|
|
412
|
-
</div>
|
|
413
|
-
|
|
414
|
-
<div class="ref-section">
|
|
415
|
-
<h3>Methods</h3>
|
|
416
|
-
<div class="ref-table-wrap">
|
|
417
|
-
<table class="ref-table">
|
|
418
|
-
<thead><tr><th>Method</th><th>Description</th></tr></thead>
|
|
419
|
-
<tbody>
|
|
420
|
-
<tr><td><code>run(script, opts)</code></td><td>Submit a job (returns immediately)</td></tr>
|
|
421
|
-
<tr><td><code>runAndWait(script, opts)</code></td><td>Submit + block until complete</td></tr>
|
|
422
|
-
<tr><td><code>new(name, opts)</code></td><td>Create a VM sandbox (add <code>persistent: true</code> for S3)</td></tr>
|
|
423
|
-
<tr><td><code>exec(nameOrId, command)</code></td><td>Run command on existing sandbox via SSH</td></tr>
|
|
424
|
-
<tr><td><code>stop(nameOrId)</code></td><td>Stop a running job</td></tr>
|
|
425
|
-
<tr><td><code>findJob(nameOrId)</code></td><td>Find job by name or workspace</td></tr>
|
|
426
|
-
<tr><td><code>url(nameOrId, port)</code></td><td>Enable public URL access</td></tr>
|
|
427
|
-
<tr><td><code>status(requestId)</code></td><td>Get job status</td></tr>
|
|
428
|
-
<tr><td><code>logs(requestId)</code></td><td>Get job logs</td></tr>
|
|
429
|
-
<tr><td><code>list()</code></td><td>List recent jobs</td></tr>
|
|
430
|
-
<tr><td><code>updateJob(requestId, opts)</code></td><td>Update job settings (<code>noSleep</code>, <code>startupCommand</code>)</td></tr>
|
|
431
|
-
<tr><td><code>enableAccess(requestId, port)</code></td><td>Enable URL or SSH access</td></tr>
|
|
432
|
-
<tr><td><code>resize(workspace, diskGb)</code></td><td>Resize workspace disk</td></tr>
|
|
433
|
-
<tr><td><code>uploadFiles(paths)</code></td><td>Upload files, returns file IDs</td></tr>
|
|
434
|
-
<tr><td><code>sync(requestId)</code></td><td>Sync workspace to S3 now</td></tr>
|
|
435
|
-
<tr><td><code>listWorkspaces()</code></td><td>List persistent workspaces</td></tr>
|
|
436
|
-
<tr><td><code>deleteWorkspace(id)</code></td><td>Delete workspace + cloud data</td></tr>
|
|
437
|
-
<tr><td><code>urlAliasCreate(sub, wsId)</code></td><td>Create a stable URL alias</td></tr>
|
|
438
|
-
<tr><td><code>urlAliasList()</code></td><td>List URL aliases</td></tr>
|
|
439
|
-
<tr><td><code>urlAliasDelete(sub)</code></td><td>Delete a URL alias</td></tr>
|
|
440
|
-
<tr><td><code>cronCreate(opts)</code></td><td>Create a cron job</td></tr>
|
|
441
|
-
<tr><td><code>cronList()</code></td><td>List cron jobs</td></tr>
|
|
442
|
-
<tr><td><code>cronDelete(id)</code></td><td>Delete a cron job</td></tr>
|
|
443
|
-
<tr><td><code>usage(opts)</code></td><td>Get usage stats</td></tr>
|
|
444
|
-
</tbody>
|
|
445
|
-
</table>
|
|
446
|
-
</div>
|
|
447
|
-
</div>
|
|
448
|
-
|
|
449
|
-
<div class="ref-section">
|
|
450
|
-
<h3>Run Options</h3>
|
|
451
|
-
<div class="ref-table-wrap">
|
|
452
|
-
<table class="ref-table">
|
|
453
|
-
<thead><tr><th>Parameter</th><th>Description</th></tr></thead>
|
|
454
|
-
<tbody>
|
|
455
|
-
<tr><td><code>workspaceId</code></td><td>Name the workspace. Local only unless <code>persistent: true</code>.</td></tr>
|
|
456
|
-
<tr><td><code>persistent</code></td><td>Keep sandbox alive, sync workspace to S3. Files persist indefinitely.</td></tr>
|
|
457
|
-
<tr><td><code>baseWorkspaceId</code></td><td>Mount a workspace read-only as base image</td></tr>
|
|
458
|
-
<tr><td><code>noSleep</code></td><td>Never auto-sleep (requires <code>persistent: true</code>)</td></tr>
|
|
459
|
-
<tr><td><code>ephemeral</code></td><td>No workspace, no sync (fastest)</td></tr>
|
|
460
|
-
<tr><td><code>fileIds</code></td><td>Array of uploaded file IDs to include</td></tr>
|
|
461
|
-
<tr><td><code>startupCommand</code></td><td>Command to run when sandbox wakes</td></tr>
|
|
462
|
-
</tbody>
|
|
463
|
-
</table>
|
|
464
|
-
</div>
|
|
465
|
-
</div>
|
|
466
|
-
|
|
467
|
-
<div class="ref-section">
|
|
468
|
-
<h3>Examples</h3>
|
|
469
|
-
<pre><code>const Mags = require('@magpiecloud/mags');
|
|
470
|
-
const mags = new Mags({ apiToken: process.env.MAGS_API_TOKEN });
|
|
471
|
-
|
|
472
|
-
// Run a command and wait
|
|
473
|
-
const result = await mags.runAndWait('echo Hello World');
|
|
474
|
-
console.log(result.status); // "completed"
|
|
475
|
-
|
|
476
|
-
// Local workspace (no S3 sync, good for analysis)
|
|
477
|
-
await mags.runAndWait('python3 analyze.py', { workspaceId: 'analysis' });
|
|
478
|
-
|
|
479
|
-
// Persistent workspace (synced to S3)
|
|
480
|
-
await mags.runAndWait('pip install flask', { workspaceId: 'myproject', persistent: true });
|
|
481
|
-
await mags.runAndWait('python3 app.py', { workspaceId: 'myproject', persistent: true });
|
|
482
|
-
|
|
483
|
-
// Base image
|
|
484
|
-
await mags.runAndWait('npm test', { baseWorkspaceId: 'golden' });
|
|
485
|
-
await mags.runAndWait('npm test', { baseWorkspaceId: 'golden', workspaceId: 'fork-1', persistent: true });
|
|
486
|
-
|
|
487
|
-
// Create a sandbox
|
|
488
|
-
await mags.new('dev', { persistent: true });
|
|
489
|
-
|
|
490
|
-
// SSH access
|
|
491
|
-
const job = await mags.run('sleep 3600', { workspaceId: 'dev', persistent: true });
|
|
492
|
-
const ssh = await mags.enableAccess(job.requestId, 22);
|
|
493
|
-
console.log(`ssh root@${ssh.sshHost} -p ${ssh.sshPort}`);
|
|
494
|
-
|
|
495
|
-
// Public URL
|
|
496
|
-
const webJob = await mags.run('python3 -m http.server 8080', {
|
|
497
|
-
workspaceId: 'webapp', persistent: true,
|
|
498
|
-
startupCommand: 'python3 -m http.server 8080',
|
|
499
|
-
});
|
|
500
|
-
const { url } = await mags.url('webapp', 8080);
|
|
501
|
-
console.log(url);
|
|
502
|
-
|
|
503
|
-
// Always-on sandbox (never auto-sleeps)
|
|
504
|
-
await mags.run('python3 worker.py', {
|
|
505
|
-
workspaceId: 'worker', persistent: true, noSleep: true,
|
|
506
|
-
});
|
|
507
|
-
|
|
508
|
-
// Upload files
|
|
509
|
-
const fileId = await mags.uploadFile('script.py');
|
|
510
|
-
await mags.runAndWait('python3 /uploads/script.py', { fileIds: [fileId] });
|
|
511
|
-
|
|
512
|
-
// Cron
|
|
513
|
-
await mags.cronCreate({
|
|
514
|
-
name: 'backup', cronExpression: '0 0 * * *',
|
|
515
|
-
script: 'tar czf backup.tar.gz /data', workspaceId: 'backups',
|
|
516
|
-
});</code></pre>
|
|
517
|
-
</div>
|
|
518
|
-
<p><a class="text-link" href="https://www.npmjs.com/package/@magpiecloud/mags" rel="noreferrer">View on npm →</a></p>
|
|
519
|
-
</div>
|
|
520
|
-
</div>
|
|
521
|
-
</div>
|
|
522
|
-
</section>
|
|
523
|
-
|
|
524
|
-
<!-- ── Workspaces ──────────────────────────────────── -->
|
|
525
|
-
<section class="section" id="workspaces">
|
|
526
|
-
<div class="container">
|
|
527
|
-
<div class="section-title">
|
|
528
|
-
<p>Persistent Workspaces</p>
|
|
529
|
-
<h2>Your files survive. Every sandbox starts clean.</h2>
|
|
530
|
-
</div>
|
|
531
|
-
<div class="grid split">
|
|
532
|
-
<article class="panel" data-reveal>
|
|
533
|
-
<h3>Backed up to object storage</h3>
|
|
534
|
-
<ul class="list">
|
|
535
|
-
<li>Use <code>-w</code> for a local workspace (no cloud sync, good for throwaway analysis)</li>
|
|
536
|
-
<li>Add <code>-p</code> to sync to S3 — files, packages, and configs persist indefinitely</li>
|
|
537
|
-
<li>Clone a workspace as a read-only base for new sandboxes</li>
|
|
538
|
-
<li>Survives reboots, sleep, and agent restarts (with <code>-p</code>)</li>
|
|
539
|
-
</ul>
|
|
540
|
-
</article>
|
|
541
|
-
<article class="panel" data-reveal>
|
|
542
|
-
<h3>Fully isolated</h3>
|
|
543
|
-
<ul class="list">
|
|
544
|
-
<li>Every sandbox runs in its own isolated environment</li>
|
|
545
|
-
<li>No cross-user access — workspaces are private</li>
|
|
546
|
-
<li>Processes, memory, and ports reset between runs</li>
|
|
547
|
-
<li>Agents can't escape or affect the host</li>
|
|
548
|
-
</ul>
|
|
549
|
-
</article>
|
|
550
|
-
</div>
|
|
551
|
-
</div>
|
|
552
|
-
</section>
|
|
553
|
-
|
|
554
|
-
<!-- ── Always-On Servers ──────────────────────────── -->
|
|
555
|
-
<section class="section" id="always-on">
|
|
556
|
-
<div class="container">
|
|
557
|
-
<div class="section-title">
|
|
558
|
-
<p>Always-On Servers</p>
|
|
559
|
-
<h2>Keep your sandboxes running forever.</h2>
|
|
560
|
-
</div>
|
|
561
|
-
<div class="grid split">
|
|
562
|
-
<article class="panel" data-reveal>
|
|
563
|
-
<h3>Never auto-sleep</h3>
|
|
564
|
-
<p>By default, persistent sandboxes auto-sleep after 10 minutes of inactivity to save resources. With the <code>--no-sleep</code> flag, your VM stays running 24/7 — perfect for web servers, workers, and background processes.</p>
|
|
565
|
-
<pre><code># CLI
|
|
566
|
-
mags run -w my-api -p --no-sleep --url --port 3000 'node server.js'
|
|
567
|
-
|
|
568
|
-
# Python
|
|
569
|
-
m.run("node server.js",
|
|
570
|
-
workspace_id="my-api", persistent=True, no_sleep=True)
|
|
571
|
-
|
|
572
|
-
# Node.js
|
|
573
|
-
await mags.run('node server.js', {
|
|
574
|
-
workspaceId: 'my-api', persistent: true, noSleep: true,
|
|
575
|
-
});</code></pre>
|
|
576
|
-
</article>
|
|
577
|
-
<article class="panel" data-reveal>
|
|
578
|
-
<h3>Auto-recovery</h3>
|
|
579
|
-
<p>Always-on sandboxes are automatically monitored. If the host goes down, your VM is re-provisioned on a healthy server within ~60 seconds — no manual intervention needed.</p>
|
|
580
|
-
<h3 style="margin-top:1.2rem">How it works</h3>
|
|
581
|
-
<ul class="list">
|
|
582
|
-
<li>Requires <code>-p</code> (persistent) flag</li>
|
|
583
|
-
<li>VM stays in <code>running</code> state indefinitely</li>
|
|
584
|
-
<li>Combine with <code>--url</code> to expose a public HTTPS endpoint</li>
|
|
585
|
-
<li>Use <code>--startup-command</code> to auto-restart your process if the VM recovers</li>
|
|
586
|
-
<li>Files persist to the cloud via workspace sync</li>
|
|
587
|
-
</ul>
|
|
588
|
-
</article>
|
|
589
|
-
</div>
|
|
590
|
-
</div>
|
|
591
|
-
</section>
|
|
592
|
-
|
|
593
|
-
<!-- ── SDKs + API ──────────────────────────────────── -->
|
|
594
|
-
<section class="section" id="sdk">
|
|
595
|
-
<div class="container">
|
|
596
|
-
<div class="section-title">
|
|
597
|
-
<p>SDKs + API</p>
|
|
598
|
-
<h2>Let your agents spin up sandboxes programmatically.</h2>
|
|
599
|
-
</div>
|
|
600
|
-
<div class="tab-group">
|
|
601
|
-
<div class="tab-bar">
|
|
602
|
-
<button class="tab active" data-tab="sdk-python">Python</button>
|
|
603
|
-
<button class="tab" data-tab="sdk-node">Node.js</button>
|
|
604
|
-
<button class="tab" data-tab="sdk-rest">REST API</button>
|
|
605
|
-
</div>
|
|
606
|
-
<div class="tab-content active" data-tab="sdk-python">
|
|
607
|
-
<div class="grid split">
|
|
608
|
-
<article class="panel" data-reveal>
|
|
609
|
-
<h3>Install</h3>
|
|
610
|
-
<pre><code>pip install magpie-mags</code></pre>
|
|
611
|
-
<h3 style="margin-top:1.2rem">Quick example</h3>
|
|
612
|
-
<pre><code>from mags import Mags
|
|
613
|
-
|
|
614
|
-
m = Mags() # reads MAGS_API_TOKEN from env
|
|
615
|
-
|
|
616
|
-
# Create a sandbox, run commands on it
|
|
617
|
-
m.new("demo") # local disk; use persistent=True for S3
|
|
618
|
-
result = m.exec("demo", "uname -a")
|
|
619
|
-
print(result["output"])
|
|
620
|
-
|
|
621
|
-
# Or run a one-shot script
|
|
622
|
-
result = m.run_and_wait("echo Hello!")
|
|
623
|
-
print(result["status"]) # "completed"</code></pre>
|
|
624
|
-
</article>
|
|
625
|
-
<article class="panel" data-reveal>
|
|
626
|
-
<h3>Available methods</h3>
|
|
627
|
-
<ul class="list">
|
|
628
|
-
<li><code>run(script, **opts)</code> — submit a job</li>
|
|
629
|
-
<li><code>run_and_wait(script, **opts)</code> — submit + block</li>
|
|
630
|
-
<li><code>new(name, **opts)</code> — create VM sandbox</li>
|
|
631
|
-
<li><code>exec(name, command)</code> — run on existing sandbox</li>
|
|
632
|
-
<li><code>stop(name_or_id)</code> — stop a job</li>
|
|
633
|
-
<li><code>find_job(name_or_id)</code> — find by name/workspace</li>
|
|
634
|
-
<li><code>url(name_or_id, port)</code> — enable public URL</li>
|
|
635
|
-
<li><code>resize(workspace, disk_gb)</code> — resize disk</li>
|
|
636
|
-
<li><code>status(id)</code> / <code>logs(id)</code> / <code>list_jobs()</code></li>
|
|
637
|
-
<li><code>upload_file(path)</code> / <code>upload_files(paths)</code></li>
|
|
638
|
-
<li><code>list_workspaces()</code> / <code>delete_workspace(id)</code></li>
|
|
639
|
-
<li><code>sync(id)</code> — sync workspace to S3</li>
|
|
640
|
-
<li><code>cron_create(**opts)</code> / <code>cron_list()</code> / <code>cron_delete(id)</code></li>
|
|
641
|
-
</ul>
|
|
642
|
-
<p style="margin-top:1rem"><a class="text-link" href="https://pypi.org/project/magpie-mags/" rel="noreferrer">PyPI →</a></p>
|
|
643
|
-
</article>
|
|
644
|
-
</div>
|
|
645
|
-
</div>
|
|
646
|
-
<div class="tab-content" data-tab="sdk-node">
|
|
647
|
-
<div class="grid split">
|
|
648
|
-
<article class="panel" data-reveal>
|
|
649
|
-
<h3>Install</h3>
|
|
650
|
-
<pre><code>npm install @magpiecloud/mags</code></pre>
|
|
651
|
-
<h3 style="margin-top:1.2rem">Quick example</h3>
|
|
652
|
-
<pre><code>const Mags = require('@magpiecloud/mags');
|
|
653
|
-
|
|
654
|
-
const mags = new Mags({
|
|
655
|
-
apiToken: process.env.MAGS_API_TOKEN,
|
|
656
|
-
});
|
|
657
|
-
|
|
658
|
-
const result = await mags.runAndWait('echo Hello World');
|
|
659
|
-
console.log(result.status);
|
|
660
|
-
console.log(result.logs);</code></pre>
|
|
661
|
-
</article>
|
|
662
|
-
<article class="panel" data-reveal>
|
|
663
|
-
<h3>Available methods</h3>
|
|
664
|
-
<ul class="list">
|
|
665
|
-
<li><code>run(script, opts)</code> — submit a job</li>
|
|
666
|
-
<li><code>runAndWait(script, opts)</code> — submit + block</li>
|
|
667
|
-
<li><code>new(name, opts)</code> — create VM sandbox</li>
|
|
668
|
-
<li><code>exec(nameOrId, command)</code> — run on existing sandbox</li>
|
|
669
|
-
<li><code>stop(nameOrId)</code> — stop a job</li>
|
|
670
|
-
<li><code>findJob(nameOrId)</code> — find by name/workspace</li>
|
|
671
|
-
<li><code>url(nameOrId, port)</code> — enable public URL</li>
|
|
672
|
-
<li><code>status(id)</code> / <code>logs(id)</code> / <code>list()</code></li>
|
|
673
|
-
<li><code>enableAccess(requestId, port)</code> — URL or SSH</li>
|
|
674
|
-
<li><code>uploadFiles(paths)</code> — upload files</li>
|
|
675
|
-
<li><code>listWorkspaces()</code> / <code>deleteWorkspace(id)</code></li>
|
|
676
|
-
<li><code>sync(id)</code> — sync workspace to S3</li>
|
|
677
|
-
<li><code>cronCreate(opts)</code> / <code>cronList()</code> / <code>cronDelete(id)</code></li>
|
|
678
|
-
</ul>
|
|
679
|
-
<p style="margin-top:1rem"><a class="text-link" href="https://www.npmjs.com/package/@magpiecloud/mags" rel="noreferrer">npm →</a></p>
|
|
680
|
-
</article>
|
|
681
|
-
</div>
|
|
682
|
-
</div>
|
|
683
|
-
<div class="tab-content" data-tab="sdk-rest">
|
|
684
|
-
<div class="grid split">
|
|
685
|
-
<article class="panel" data-reveal>
|
|
686
|
-
<h3>Submit a job</h3>
|
|
687
|
-
<pre><code>curl -X POST https://api.magpiecloud.com/api/v1/mags-jobs \
|
|
688
|
-
-H "Authorization: Bearer $MAGS_API_TOKEN" \
|
|
689
|
-
-H "Content-Type: application/json" \
|
|
690
|
-
-d '{
|
|
691
|
-
"script": "echo Hello World",
|
|
692
|
-
"type": "inline",
|
|
693
|
-
"workspace_id": "myproject"
|
|
694
|
-
}'</code></pre>
|
|
695
|
-
</article>
|
|
696
|
-
<article class="panel" data-reveal>
|
|
697
|
-
<h3>Endpoints</h3>
|
|
698
|
-
<ul class="list">
|
|
699
|
-
<li><code>POST /mags-jobs</code> — submit job</li>
|
|
700
|
-
<li><code>GET /mags-jobs</code> — list jobs</li>
|
|
701
|
-
<li><code>GET /mags-jobs/:id/status</code> — status</li>
|
|
702
|
-
<li><code>GET /mags-jobs/:id/logs</code> — logs</li>
|
|
703
|
-
<li><code>POST /mags-jobs/:id/access</code> — URL/SSH</li>
|
|
704
|
-
<li><code>POST /mags-jobs/:id/stop</code> — stop job</li>
|
|
705
|
-
<li><code>POST /mags-jobs/:id/sync</code> — sync workspace</li>
|
|
706
|
-
<li><code>PATCH /mags-jobs/:id</code> — update</li>
|
|
707
|
-
<li><code>POST /mags-files</code> — upload file</li>
|
|
708
|
-
<li><code>GET /mags-workspaces</code> — list ws</li>
|
|
709
|
-
<li><code>DELETE /mags-workspaces/:id</code> — delete ws</li>
|
|
710
|
-
<li><code>POST /mags-url-aliases</code> — create alias</li>
|
|
711
|
-
<li><code>GET /mags-url-aliases</code> — list aliases</li>
|
|
712
|
-
<li><code>DELETE /mags-url-aliases/:sub</code> — delete alias</li>
|
|
713
|
-
<li><code>POST /mags-cron</code> — create cron</li>
|
|
714
|
-
<li><code>GET /mags-cron</code> — list cron</li>
|
|
715
|
-
<li><code>PATCH /mags-cron/:id</code> — update cron</li>
|
|
716
|
-
<li><code>DELETE /mags-cron/:id</code> — delete cron</li>
|
|
717
|
-
</ul>
|
|
718
|
-
<p style="margin-top:1rem"><a class="text-link" href="api.html">Full API reference →</a></p>
|
|
719
|
-
</article>
|
|
720
|
-
</div>
|
|
721
|
-
</div>
|
|
722
|
-
</div>
|
|
723
|
-
</div>
|
|
724
|
-
</section>
|
|
725
|
-
|
|
726
|
-
<!-- ── Resources ───────────────────────────────────── -->
|
|
727
|
-
<section class="section" id="resources">
|
|
728
|
-
<div class="container">
|
|
729
|
-
<div class="section-title">
|
|
730
|
-
<p>Resources</p>
|
|
731
|
-
<h2>Everything you need to get started.</h2>
|
|
732
|
-
</div>
|
|
733
|
-
<div class="grid cards">
|
|
734
|
-
<article class="card" data-reveal>
|
|
735
|
-
<h3>Login</h3>
|
|
736
|
-
<p>Sign in with Google or email to access jobs and tokens.</p>
|
|
737
|
-
<a class="text-link" href="login.html">Open login</a>
|
|
738
|
-
</article>
|
|
739
|
-
<article class="card" data-reveal>
|
|
740
|
-
<h3>Usage + jobs</h3>
|
|
741
|
-
<p>View usage summaries and recent jobs.</p>
|
|
742
|
-
<a class="text-link" href="usage.html">Open usage</a>
|
|
743
|
-
</article>
|
|
744
|
-
<article class="card" data-reveal>
|
|
745
|
-
<h3>API tokens</h3>
|
|
746
|
-
<p>Create and manage tokens for CLI and SDK access.</p>
|
|
747
|
-
<a class="text-link" href="tokens.html">Open tokens</a>
|
|
748
|
-
</article>
|
|
749
|
-
<article class="card" data-reveal>
|
|
750
|
-
<h3>Claude skill</h3>
|
|
751
|
-
<p>Install the Claude Code skill to run sandboxes from Claude.</p>
|
|
752
|
-
<a class="text-link" href="claude-skill.html">Open Claude skill</a>
|
|
753
|
-
</article>
|
|
754
|
-
<article class="card" data-reveal>
|
|
755
|
-
<h3>Cookbook</h3>
|
|
756
|
-
<p>Copy ready-to-run recipes for common workflows.</p>
|
|
757
|
-
<a class="text-link" href="cookbook.html">Open cookbook</a>
|
|
758
|
-
</article>
|
|
759
|
-
</div>
|
|
760
|
-
</div>
|
|
761
|
-
</section>
|
|
762
|
-
</main>
|
|
763
|
-
|
|
764
|
-
<footer class="site-footer">
|
|
765
|
-
<div class="container footer-grid">
|
|
766
|
-
<div>
|
|
767
|
-
<div class="brand">
|
|
768
|
-
<span class="logo">Mags</span>
|
|
769
|
-
<span class="tag">Secure cloud sandboxes for the AI age</span>
|
|
770
|
-
</div>
|
|
771
|
-
<p>Secure, instant sandboxes for AI agents, developers, and automation.</p>
|
|
772
|
-
</div>
|
|
773
|
-
<div class="footer-links">
|
|
774
|
-
<a href="login.html">Login</a>
|
|
775
|
-
<a href="usage.html">Usage</a>
|
|
776
|
-
<a href="tokens.html">Tokens</a>
|
|
777
|
-
<a href="https://pypi.org/project/magpie-mags/" rel="noreferrer">Python SDK</a>
|
|
778
|
-
<a href="https://www.npmjs.com/package/@magpiecloud/mags" rel="noreferrer">Node.js SDK</a>
|
|
779
|
-
<a href="api.html">API Reference</a>
|
|
780
|
-
<a href="claude-skill.html">Claude Skill</a>
|
|
781
|
-
<a href="cookbook.html">Cookbook</a>
|
|
782
|
-
<a href="https://discord.gg/3avpC2nS" rel="noreferrer" target="_blank">Discord</a>
|
|
783
|
-
<a href="https://github.com/magpiecloud/mags/issues" rel="noreferrer">Issues</a>
|
|
784
|
-
</div>
|
|
785
|
-
</div>
|
|
786
|
-
</footer>
|
|
787
|
-
|
|
788
|
-
<script src="script.js?v=8"></script>
|
|
789
|
-
<script>
|
|
790
|
-
(function() {
|
|
791
|
-
var token = localStorage.getItem('microvm-access-token');
|
|
792
|
-
if (token) {
|
|
793
|
-
var nav = document.getElementById('nav-auth-link');
|
|
794
|
-
var cta = document.getElementById('cta-auth-link');
|
|
795
|
-
if (nav) { nav.textContent = 'Usage'; nav.href = 'usage.html'; }
|
|
796
|
-
if (cta) { cta.textContent = 'Dashboard'; cta.href = 'usage.html'; }
|
|
797
|
-
}
|
|
798
|
-
})();
|
|
799
|
-
</script>
|
|
800
|
-
</body>
|
|
801
|
-
</html>
|