Skip to content

Commit 7da71f0

Browse files
kylemclarenclaude
andcommitted
Replace curl-sprite-api with sprite-env commands
Update documentation to use the new sprite-env CLI instead of the deprecated curl-sprite-api command. Also removes non-working checkpoint delete commands from internal API sections (delete is only available via external CLI). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent 8403d5b commit 7da71f0

File tree

3 files changed

+34
-53
lines changed

3 files changed

+34
-53
lines changed

src/content/docs/concepts/checkpoints.mdx

Lines changed: 8 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -260,12 +260,6 @@ sprite checkpoint delete v3
260260
# Output: Deleted
261261
```
262262
</TabItem>
263-
<TabItem label="cURL">
264-
```bash
265-
# Delete via internal API (from inside the Sprite)
266-
curl-sprite-api -X DELETE /v1/checkpoints/v3
267-
```
268-
</TabItem>
269263
</Tabs>
270264

271265
### Delete Restrictions
@@ -290,25 +284,19 @@ To delete an active checkpoint, first restore to a different checkpoint, then de
290284

291285
You can create and restore checkpoints from within the Sprite itself using the internal API. This is particularly useful for LLMs and automation scripts.
292286

293-
### Using curl-sprite-api
287+
### Using sprite-env
294288

295-
The `curl-sprite-api` command simplifies access to the internal API:
289+
The `sprite-env` command simplifies access to the internal API:
296290

297291
```bash
298292
# List all checkpoints
299-
curl-sprite-api /v1/checkpoints
300-
301-
# Get details for a specific checkpoint
302-
curl-sprite-api /v1/checkpoints/v2
293+
sprite-env checkpoints list
303294

304295
# Create a new checkpoint (streams progress)
305-
curl-sprite-api -X POST /v1/checkpoint
296+
sprite-env checkpoints create
306297

307298
# Restore from a checkpoint
308-
curl-sprite-api -X POST /v1/checkpoints/v1/restore
309-
310-
# Delete a checkpoint
311-
curl-sprite-api -X DELETE /v1/checkpoints/v3
299+
sprite-env checkpoints restore v1
312300
```
313301

314302
### Direct API Access
@@ -325,10 +313,6 @@ curl --unix-socket /.sprite/api.sock \
325313
curl --unix-socket /.sprite/api.sock \
326314
-H "Content-Type: application/json" \
327315
-X POST http://sprite/v1/checkpoint
328-
329-
# Delete checkpoint
330-
curl --unix-socket /.sprite/api.sock \
331-
-X DELETE http://sprite/v1/checkpoints/v3
332316
```
333317

334318
### Checkpoint Creation Response
@@ -347,7 +331,7 @@ Restore requests return immediately with HTTP 202 (Accepted) and trigger the res
347331

348332
```bash
349333
# This returns immediately, then the sprite restarts with restored state
350-
curl-sprite-api -X POST /v1/checkpoints/v1/restore
334+
sprite-env checkpoints restore v1
351335
```
352336

353337
### LLM Self-Checkpointing
@@ -356,17 +340,14 @@ AI coding agents can checkpoint their own work. Point your LLM at `/.sprite/llm.
356340

357341
```bash
358342
# Before risky operations
359-
curl-sprite-api -X POST /v1/checkpoint
343+
sprite-env checkpoints create
360344
# Output: {"status": "complete", "id": "v4"}
361345

362346
# Try something risky...
363347
rm -rf node_modules && npm install
364348

365349
# If things go wrong, restore
366-
curl-sprite-api -X POST /v1/checkpoints/v4/restore
367-
368-
# Clean up old checkpoints when done
369-
curl-sprite-api -X DELETE /v1/checkpoints/v3
350+
sprite-env checkpoints restore v4
370351
```
371352

372353
This enables autonomous recovery when experiments fail.

src/content/docs/concepts/services.mdx

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ Services are long-running processes managed by the Sprite runtime that automatic
77

88
## Overview
99

10-
Services are managed through the internal API at `/.sprite/api.sock`. The `curl-sprite-api` command provides a convenient wrapper:
10+
Services are managed through the internal API at `/.sprite/api.sock`. The `sprite-env` command provides a convenient wrapper:
1111

1212
```bash
1313
# List all services
14-
curl-sprite-api /v1/services
14+
sprite-env services list
1515

1616
# Get help and see all endpoints
17-
curl-sprite-api --help
17+
sprite-env services --help
1818
```
1919

2020
## Creating Services
@@ -23,13 +23,13 @@ Create a service with a PUT request:
2323

2424
```bash
2525
# Simple service
26-
curl-sprite-api -X PUT /v1/services/myapp -d '{
26+
sprite-env curl -X PUT /v1/services/myapp -d '{
2727
"cmd": "/usr/bin/myapp",
2828
"args": ["--port", "8080"]
2929
}'
3030

3131
# Service with dependencies
32-
curl-sprite-api -X PUT /v1/services/webapp -d '{
32+
sprite-env curl -X PUT /v1/services/webapp -d '{
3333
"cmd": "npm",
3434
"args": ["run", "dev"],
3535
"needs": ["database"]
@@ -50,7 +50,7 @@ When you create a service, the API streams logs in NDJSON format:
5050

5151
```bash
5252
# Stream logs for 10 seconds after creation
53-
curl-sprite-api -X PUT '/v1/services/myapp?duration=10s' -d '{
53+
sprite-env curl -X PUT '/v1/services/myapp?duration=10s' -d '{
5454
"cmd": "npm",
5555
"args": ["run", "dev"]
5656
}'
@@ -63,7 +63,7 @@ The default streaming duration is 5 seconds. Set `duration=0` to return immediat
6363
### List Services
6464

6565
```bash
66-
curl-sprite-api /v1/services
66+
sprite-env services list
6767
```
6868

6969
Returns a JSON array of services with their current states:
@@ -88,13 +88,13 @@ Returns a JSON array of services with their current states:
8888
### Get Service State
8989

9090
```bash
91-
curl-sprite-api /v1/services/webapp
91+
sprite-env services get webapp
9292
```
9393

9494
### Delete a Service
9595

9696
```bash
97-
curl-sprite-api -X DELETE /v1/services/webapp
97+
sprite-env services delete webapp
9898
```
9999

100100
### Send Signals
@@ -103,19 +103,19 @@ Send Unix signals to a service:
103103

104104
```bash
105105
# Graceful shutdown
106-
curl-sprite-api -X POST /v1/services/signal -d '{
106+
sprite-env curl -X POST /v1/services/signal -d '{
107107
"name": "webapp",
108108
"signal": "TERM"
109109
}'
110110

111111
# Force kill
112-
curl-sprite-api -X POST /v1/services/signal -d '{
112+
sprite-env curl -X POST /v1/services/signal -d '{
113113
"name": "webapp",
114114
"signal": "KILL"
115115
}'
116116

117117
# Reload configuration (for services that support it)
118-
curl-sprite-api -X POST /v1/services/signal -d '{
118+
sprite-env curl -X POST /v1/services/signal -d '{
119119
"name": "nginx",
120120
"signal": "HUP"
121121
}'
@@ -152,7 +152,7 @@ Choose the right approach for your use case:
152152

153153
```bash
154154
# Create a Node.js dev server service
155-
curl-sprite-api -X PUT /v1/services/devserver -d '{
155+
sprite-env curl -X PUT /v1/services/devserver -d '{
156156
"cmd": "npm",
157157
"args": ["run", "dev"]
158158
}'
@@ -162,13 +162,13 @@ curl-sprite-api -X PUT /v1/services/devserver -d '{
162162

163163
```bash
164164
# First, create the database service
165-
curl-sprite-api -X PUT /v1/services/postgres -d '{
165+
sprite-env curl -X PUT /v1/services/postgres -d '{
166166
"cmd": "/usr/lib/postgresql/16/bin/postgres",
167167
"args": ["-D", "/home/sprite/pgdata"]
168168
}'
169169

170170
# Then create a service that depends on it
171-
curl-sprite-api -X PUT /v1/services/webapp -d '{
171+
sprite-env curl -X PUT /v1/services/webapp -d '{
172172
"cmd": "npm",
173173
"args": ["start"],
174174
"needs": ["postgres"]
@@ -178,7 +178,7 @@ curl-sprite-api -X PUT /v1/services/webapp -d '{
178178
### Python Background Worker
179179

180180
```bash
181-
curl-sprite-api -X PUT /v1/services/worker -d '{
181+
sprite-env curl -X PUT /v1/services/worker -d '{
182182
"cmd": "python",
183183
"args": ["-m", "celery", "worker", "-A", "tasks"]
184184
}'
@@ -190,17 +190,17 @@ AI coding agents can manage services through the internal API. Point your LLM at
190190

191191
```bash
192192
# LLM creates a service for the project it's working on
193-
curl-sprite-api -X PUT /v1/services/devserver -d '{
193+
sprite-env curl -X PUT /v1/services/devserver -d '{
194194
"cmd": "npm",
195195
"args": ["run", "dev"],
196196
"dir": "/home/sprite/project"
197197
}'
198198

199199
# Check if it's running
200-
curl-sprite-api /v1/services/devserver
200+
sprite-env services get devserver
201201

202202
# Restart after making changes
203-
curl-sprite-api -X POST /v1/services/signal -d '{"name": "devserver", "signal": "TERM"}'
203+
sprite-env curl -X POST /v1/services/signal -d '{"name": "devserver", "signal": "TERM"}'
204204
# Service auto-restarts
205205
```
206206

@@ -225,7 +225,7 @@ The service manager will restart crashed services. If a service exits immediatel
225225
Stream logs when creating the service:
226226

227227
```bash
228-
curl-sprite-api -X PUT '/v1/services/myapp?duration=60s' -d '{...}'
228+
sprite-env curl -X PUT '/v1/services/myapp?duration=60s' -d '{...}'
229229
```
230230

231231
Or check system logs:

src/content/docs/reference/base-images.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -322,19 +322,19 @@ cat /.sprite/languages/rust/llm.txt
322322

323323
The base image includes several tools for interacting with the Sprite runtime from inside the environment.
324324

325-
### curl-sprite-api
325+
### sprite-env
326326

327-
A convenience wrapper for accessing the internal API via Unix socket:
327+
A convenience command for managing Sprite environment services and checkpoints:
328328

329329
```bash
330330
# Instead of:
331331
curl --unix-socket /.sprite/api.sock -H "Content-Type: application/json" http://sprite/v1/services
332332

333333
# You can use:
334-
curl-sprite-api /v1/services
334+
sprite-env services list
335335

336-
# See all available endpoints
337-
curl-sprite-api --help
336+
# See all available commands
337+
sprite-env --help
338338
```
339339

340340
The internal API manages:
@@ -362,7 +362,7 @@ Launches the appropriate login shell based on your local environment. When you r
362362

363363
### Internal API Socket
364364

365-
The Sprite runtime exposes a Unix socket at `/.sprite/api.sock` for internal management. While `curl-sprite-api` is the recommended way to interact with it, you can also use it directly:
365+
The Sprite runtime exposes a Unix socket at `/.sprite/api.sock` for internal management. While `sprite-env` is the recommended way to interact with it, you can also use the socket directly with `sprite-env curl` or raw curl:
366366

367367
```bash
368368
# Using curl directly

0 commit comments

Comments
 (0)