Using snlctl
Authentication
Section titled “Authentication”Before using any command, authenticate with your Google account:
snlctl auth loginThis opens your browser for Google SSO. After signing in, the token is saved to ~/.snl/token.json.
Check your auth status:
snlctl auth statusCommand structure
Section titled “Command structure”snlctl <resource> <action> [flags]Examples:
snlctl deploy listsnlctl pods get my-podsnlctl db create --name mydb --engine postgressnlctl domain create --name myapp --service myapp --port 3000Global flags
Section titled “Global flags”| Flag | Description |
|---|---|
--json | Output raw JSON instead of tables |
--quiet | Suppress non-essential output |
--no-color | Disable colored output |
--no-update | Skip the daily auto-update check |
--api-url <url> | Override API endpoint |
--token <token> | Override auth token |
Common workflows
Section titled “Common workflows”Deploy an app
Section titled “Deploy an app”# Create a deploymentsnlctl deploy create --name myapp --image nginx:latest --port 80 --replicas 2
# Expose it on a subdomainsnlctl domain create --name myapp --service myapp --port 80
# Check statussnlctl statusYour app is now live at myapp.synoralab.dev.
Scale and restart
Section titled “Scale and restart”# Scale to 3 replicassnlctl deploy scale myapp --replicas 3
# Restart (rolling)snlctl deploy restart myappCreate a database
Section titled “Create a database”# PostgreSQL (default)snlctl db create --name mydb --engine postgres
# MySQLsnlctl db create --name mydb --engine mysql
# MongoDBsnlctl db create --name mydb --engine mongo
# Get connection credentialssnlctl db credentials mydbManage environment variables
Section titled “Manage environment variables”# Set env vars on a deploymentsnlctl env set myapp --key DATABASE_URL --value "postgres://..."
# Import from a .env filesnlctl env import myapp --file .env
# Link database credentials automaticallysnlctl env link-db myapp --db mydbView logs
Section titled “View logs”# Tail logs from a podsnlctl logs my-pod-abc123
# Logs from a specific deployment's podssnlctl pods list # find the pod namesnlctl logs <pod-name>S3 storage
Section titled “S3 storage”# Create a bucketsnlctl s3 bucket-create --name assets
# Create an access tokensnlctl s3 token-create --bucket assets --permissions readwrite
# Link S3 credentials to your deployment's envsnlctl env link-s3 myapp --bucket assetsCustom domains
Section titled “Custom domains”# Let's Encrypt (automatic TLS)snlctl custom-domain create --domain myapp.example.com --service myapp --port 80 --tls-mode letsencrypt
# Verify DNS is set up correctlysnlctl custom-domain verify myapp.example.comPoint your domain’s CNAME to cname.synoralab.dev first.
GitHub auto-deploy
Section titled “GitHub auto-deploy”# Enable push-to-deploysnlctl build enable --repo my-org/my-repo --name myapp --branch main
# Check recent buildssnlctl build runs <id>If the bot doesn’t have access to your repo, the CLI will prompt you to invite @ST4RCHASER-Automation as a collaborator. After you send the invite, press Enter and it will automatically accept and retry.
Rollback
Section titled “Rollback”# View deployment historysnlctl deploy history myapp
# Rollback to previous revisionsnlctl rollback myappFull command reference
Section titled “Full command reference”Resource groups
Section titled “Resource groups”| Resource | Actions |
|---|---|
auth | login, status, refresh, logout |
deploy | create, list, get, delete, restart, scale, history |
pods | list, get, status, delete |
services | list, get, delete |
apply | (apply k8s manifest) |
exec | (exec into pod) |
job | create |
cronjob | create, list, get, delete |
events | (show namespace events) |
env | list, set, delete, import, link-db, link-s3 |
db | create, list, credentials, delete, backup, backups, restore |
s3 | bucket-create, bucket-list, bucket-delete, token-create, token-list, token-update, token-delete |
domain | create, list, check, update, delete |
directport | create, list, delete |
custom-domain | create, list, verify, delete |
pages | deploy, list, status, upload, set-domain, delete |
build | enable, list, update, delete, runs, check-access, accept-invites |
rollback | (rollback deployment) |
logs | (view logs), archive, archives |
notify | create, list, update, delete, test |
share | grant, revoke, list |
diagnose | (auto-diagnose issues) |
autoscale | create, list, update, delete |
schedule | create, list, delete |
quota | get, update |
status | (overview), usage, events, reset |
kubeconfig | (generate kubeconfig) |
template | list, deploy |
admin | users, cluster, delete-user, cleanup, offboard, reprovision |
- Use
--jsonwhen piping output tojqor scripts snlctl deploy listshows the same info askubectl get deployments- All destructive actions (delete) ask for confirmation — use
--quietto skip in scripts - Config is stored in
~/.snl/—config.jsonfor settings,token.jsonfor auth - You can override the API URL with
SNL_API_URLenv var or--api-urlflag