Local Sync
Sync markdown procedures from your repo to Myelin. Keep runbooks in version control, make them searchable via search, and get analytics on how agents use them.
Installation
pip install myelin-sdkUsage
# Sync all procedures from default directory
myelin-sync
# Sync from a custom directory
myelin-sync --dir ./runbooks
# Sync specific files
myelin-sync deploy.md hotfix.mdDefault directory: .claude/procedures/*.md — same place Claude Code looks for project instructions.
How it works
- Reads each
.mdfile and extracts the description from the first# heading - Normalizes file paths relative to your project root
- Uploads to Myelin via
POST /v1/workflows/sync - Synced procedures appear alongside manually created ones —
searchsearches everything
Behavior
- Idempotent — running twice with the same files produces no changes
- Additive — deleting a local file does NOT remove it from the server
- Content-based updates — only re-uploads if file content changed
- Auto-approved — synced procedures are immediately available to agents
Configuration
Requires the same environment variables as other SDK tools:
MYELIN_API_KEY— your API keyMYELIN_BASE_URL— server URL (defaults tohttps://myelin.fly.dev)MYELIN_PROJECT_ID— target project
Or reads from .mcp.json in the project root (same as Claude Code integration).
Programmatic usage
from myelin_sdk import MyelinClient
client = MyelinClient(api_key="...", project_id="...")
result = await client.sync_workflows([
{"path": "deploy.md", "content": "# Deploy\n...", "description": "Deploy procedure"}
])
print(f"Created: {result.created}, Updated: {result.updated}")Dashboard
Synced procedures show a “Local” badge in the dashboard. Their content is read-only — edit the source file and re-run myelin-sync to update.