Scripts API
Persistent script store — save reusable shell, Python, or Node scripts and fetch them via curl | bash.
Scripts API
The Scripts API provides a persistent store for reusable scripts. Scripts are
named and versioned within a mind, and can be fetched as plain text — perfect
for curl | bash patterns.
Endpoints
POST /script
Store or update a script.
curl -X POST https://synapse.schaefer.zone/script \
-H "Authorization: Bearer YOUR_MIND_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "deploy-synapse",
"content": "#!/bin/bash\nset -euo pipefail\ngit pull\nnpm ci\nnpm run build\ndocker compose up -d",
"description": "Deploy Synapse to production",
"language": "bash"
}'GET /script/:name
Fetch script content as text/plain. Perfect for piping to bash.
curl -H "Authorization: Bearer YOUR_MIND_KEY" \
https://synapse.schaefer.zone/script/deploy-synapse | bashGET /script/:name/info
Get script metadata without the content.
curl -H "Authorization: Bearer YOUR_MIND_KEY" \
https://synapse.schaefer.zone/script/deploy-synapse/infoResponse:
{
"name": "deploy-synapse",
"description": "Deploy Synapse to production",
"language": "bash",
"size_bytes": 142,
"created_at": "2026-06-27T...",
"updated_at": "2026-06-27T..."
}GET /scripts
List all scripts in the current mind.
curl -H "Authorization: Bearer YOUR_MIND_KEY" \
https://synapse.schaefer.zone/scriptsDELETE /script/:name
Delete a script.
curl -X DELETE -H "Authorization: Bearer YOUR_MIND_KEY" \
https://synapse.schaefer.zone/script/deploy-synapseCommon Use Cases
Deployment scripts
Store standard deployment procedures so the LLM can run them without re-deriving the steps each time:
# LLM stores this once
curl -X POST .../script -d '{
"name": "deploy-vps1",
"content": "#!/bin/bash\nssh vps1 \"cd /opt/synapse && git pull && docker compose up -d --build\"",
"language": "bash"
}'
# Later sessions just run it
curl -H "Authorization: ..." .../script/deploy-vps1 | bashTroubleshooting snippets
Store diagnostic commands for common issues:
curl -X POST .../script -d '{
"name": "check-docker",
"content": "#!/bin/bash\ndocker ps\ndocker stats --no-stream\ndocker system df",
"description": "Quick Docker health check",
"language": "bash"
}'Configuration generators
Store scripts that generate configs:
curl -X POST .../script -d '{
"name": "gen-nginx-conf",
"content": "#!/usr/bin/env python3\nimport sys\n# ... generate nginx config from template ...",
"language": "python"
}'