CLI for deploying and managing Supabase Edge Functions on self-hosted Supabase (Coolify, Docker Compose). Sync functions via rsync, stream logs, and invoke endpoints.
npm install shsuSelf-Hosted Supabase Utilities
Deploy and manage Supabase Edge Functions and migrations on Coolify-hosted Supabase.
``bash`
npm install -g shsuor use directly
npx shsu
Run the init command to configure your project:
`bash`
npx shsu init
This adds config to your package.json:
`json`
{
"shsu": {
"server": "root@your-coolify-server",
"remotePath": "/data/coolify/services/YOUR_SERVICE_ID/volumes/functions",
"url": "https://your-supabase.example.com",
"edgeContainer": "edge",
"dbContainer": "postgres"
}
}
remotePath - SSH to your server and run:
`bash`
docker inspect $(docker ps -q --filter 'name=edge') | grep -A 5 "Mounts"
Container names - SSH to your server and run docker ps to list containers. Coolify names containers using the pattern (e.g., abc123-supabase-edge-functions-1). The filter does substring matching, so edge matches any container with "edge" in its name.
`bashConfigure project
shsu init
Migrations
Place SQL files in
./supabase/migrations/ (or your configured migrationsPath). Files are sorted alphabetically and executed in order.`
supabase/migrations/
001_create_users.sql
002_add_email_index.sql
`Run with:
`bash
shsu migrate
`Configuration
Config is read from
package.json "shsu" key. Environment variables override package.json values.| Key / Env Var | Required | Description |
|---------------|----------|-------------|
|
server / SHSU_SERVER | Yes | SSH host (e.g., root@your-server.com) |
| remotePath / SHSU_REMOTE_PATH | Yes | Remote path to functions directory |
| url / SHSU_URL | For invoke | Supabase URL |
| localPath / SHSU_LOCAL_PATH | No | Local functions path (default: ./supabase/functions) |
| migrationsPath / SHSU_MIGRATIONS_PATH | No | Local migrations path (default: ./supabase/migrations) |
| edgeContainer / SHSU_EDGE_CONTAINER | No | Edge runtime container filter (default: edge) |
| dbContainer / SHSU_DB_CONTAINER | No | Database container filter (default: postgres) |MCP Server
shsu can run as an MCP server for AI assistants.
$3
Add to
.mcp.json in your project root:`json
{
"mcpServers": {
"shsu": {
"command": "npx",
"args": ["shsu", "mcp"]
}
}
}
`$3
Add to
~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):`json
{
"mcpServers": {
"shsu": {
"command": "npx",
"args": ["shsu", "mcp"],
"cwd": "/path/to/your/project"
}
}
}
`$3
Add to
.cursor/mcp.json in your project:`json
{
"mcpServers": {
"shsu": {
"command": "npx",
"args": ["shsu", "mcp"]
}
}
}
`$3
-
deploy - Deploy edge functions
- migrate - Run database migrations
- list - List local and remote functions
- invoke - Invoke a function
- restart - Restart edge-runtime
- new - Create new function from template
- config - Show current configuration
- docs - Get setup documentationReleasing
`bash
npm version patch # or minor/major
git push --follow-tags
``GitHub Actions will automatically publish to npm when the tag is pushed.
MIT