Myelin

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-sdk

Usage

# 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.md

Default directory: .claude/procedures/*.md — same place Claude Code looks for project instructions.

How it works

  1. Reads each .md file and extracts the description from the first # heading
  2. Normalizes file paths relative to your project root
  3. Uploads to Myelin via POST /v1/workflows/sync
  4. Synced procedures appear alongside manually created ones — search searches 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 key
  • MYELIN_BASE_URL — server URL (defaults to https://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.