COMMAND USE CASES - nself-org/cli GitHub Wiki

nself Commands by Use Case

Find the right command for what you want to do.

This guide is organized by task, not by command name. If you know WHAT you want to accomplish but not WHICH command to use, start here.


Getting Started

I want to... Command Details
Create a new project nself init init
Create a demo project with all features nself init --demo init
Use the simple setup wizard nself init --simple init
Generate all configuration files nself build build
Start all services nself start start
Stop all services nself stop stop
Restart everything nself restart restart
See all service URLs nself urls urls
Check if everything is healthy nself status status
Run diagnostics when something is wrong nself doctor doctor
Auto-fix common issues nself doctor --fix doctor

Database Operations

I want to... Command Details
Open a PostgreSQL shell nself db shell db
Run a SQL query directly nself db query "SELECT ..." db
Scaffold a schema from a template nself db schema scaffold saas db
Import a DBML schema file nself db schema import schema.dbml db
Run pending migrations nself db migrate up db
Roll back the last migration nself db migrate down db
Create a new migration file nself db migrate create add_users db
Check migration status nself db migrate status db
Seed the database with sample data nself db seed db
Generate realistic mock data nself db mock auto db
Back up the database nself db backup db
Restore from a backup nself db restore latest db
Generate TypeScript types from schema nself db types typescript db
Generate Go structs from schema nself db types go db
Check table sizes and disk usage nself db inspect size db
Find slow queries nself db inspect slow db
Export table data to CSV nself db data export users db
Anonymize PII in the database nself db data anonymize db

Adding & Managing Services

I want to... Command Details
See which services are running nself status status
Enable Redis caching Set REDIS_ENABLED=true in .env, then nself build service
Enable file storage (MinIO) Set MINIO_ENABLED=true in .env, then nself build service
Enable search (MeiliSearch) Set MEILISEARCH_ENABLED=true in .env, then nself build service
Enable email testing (MailPit) Set MAILPIT_ENABLED=true in .env, then nself build service
Enable serverless functions Set FUNCTIONS_ENABLED=true in .env, then nself build service
Enable ML experiment tracking Set MLFLOW_ENABLED=true in .env, then nself build service
Enable the admin UI Set NSELF_ADMIN_ENABLED=true in .env, then nself build admin
Enable full monitoring stack Set MONITORING_ENABLED=true in .env, then nself build ../services/MONITORING-BUNDLE.md
List available service templates nself service list service
Scaffold a new custom service nself service scaffold service
Use the service creation wizard nself service wizard service
Add a custom service via env Add CS_1=api:express-js:8001 to .env, then nself build ../services/SERVICES_CUSTOM.md

Custom Services (CS_N)

I want to... Command Details
Add an Express.js API CS_1=api:express-js:8001 in .env ../services/SERVICES_CUSTOM.md
Add a background worker CS_2=worker:bullmq-js:8002 in .env ../services/SERVICES_CUSTOM.md
Add a gRPC service CS_3=grpc:grpc:8003 in .env ../services/SERVICES_CUSTOM.md
Add a Python API CS_4=ml-api:python-api:8004 in .env ../services/SERVICES_CUSTOM.md
View available templates nself service list ../reference/SERVICE_TEMPLATES.md
Rebuild after adding a service nself build && nself restart build

Deployment

I want to... Command Details
Deploy to staging nself deploy staging deploy
Deploy to production nself deploy production deploy
Create a preview environment for a branch nself deploy preview feature-branch deploy
Do a zero-downtime deployment nself deploy blue-green deploy
Do a gradual canary rollout nself deploy canary --percentage 20 deploy
Roll back the last deployment nself deploy rollback deploy
Roll back to a specific version nself backup rollback --version 3 backup
Check deployment status nself deploy status deploy
View deployment history nself deploy history deploy
Promote staging to production nself deploy promote staging production deploy

Server Management

I want to... Command Details
Provision a new server nself deploy provision digitalocean deploy
Initialize a VPS for nself nself deploy server init <host> deploy
Check if a server is ready nself deploy server check <host> deploy
List all configured servers nself deploy server list deploy
SSH into a server nself deploy server ssh <name> deploy
Run diagnostics on a server nself deploy server diagnose <env> deploy
Sync config to a remote server nself deploy sync push staging deploy
Pull config from a remote server nself deploy sync pull staging deploy

Cloud Infrastructure

I want to... Command Details
List supported cloud providers nself infra provider list infra
Configure cloud credentials nself infra provider init aws infra
Estimate hosting costs nself infra provider cost estimate digitalocean infra
Compare provider pricing nself infra provider cost compare infra
Quick-deploy to a cloud provider nself infra provider deploy quick digitalocean infra
Create a managed K8s cluster nself infra provider k8s-create aws my-cluster us-east-1 3 medium infra
Convert Compose to K8s manifests nself infra k8s convert infra
Deploy to Kubernetes nself infra k8s deploy infra
Create a Helm chart nself infra helm init infra
Install a Helm release nself infra helm install infra

Multi-Tenancy

I want to... Command Details
Initialize multi-tenancy nself tenant init tenant
Create a new tenant nself tenant create "Acme Corp" --plan pro tenant
List all tenants nself tenant list tenant
View tenant details nself tenant show <tenant-id> tenant
Suspend a tenant nself tenant suspend <tenant-id> tenant
Add a member to a tenant nself tenant member add <tenant-id> [email protected] admin tenant
Invite a member nself tenant member invite <tenant-id> [email protected] tenant
Set up billing plans nself tenant billing plans tenant
View tenant usage nself tenant billing usage <tenant-id> tenant
View invoices nself tenant billing invoice <tenant-id> tenant
Create an organization nself tenant org create "My Org" tenant

Branding & White-Label

I want to... Command Details
Upload a tenant logo nself tenant branding logo <tenant-id> logo.png tenant
Set brand colors nself tenant branding colors <tenant-id> --primary #0066cc tenant
Preview branding changes nself tenant branding preview <tenant-id> tenant
Add a custom domain nself tenant domains add <tenant-id> app.example.com tenant
Verify domain DNS nself tenant domains verify <tenant-id> app.example.com tenant
Provision SSL for a custom domain nself tenant domains ssl <tenant-id> app.example.com tenant
Customize email templates nself tenant email edit <tenant-id> welcome tenant
Apply a theme nself tenant themes apply <tenant-id> dark-mode tenant
Configure white-label settings nself dev whitelabel config dev

Security & Authentication

I want to... Command Details
Set up OAuth (Google, GitHub, etc.) nself auth oauth enable --providers google,github auth
Configure OAuth credentials nself auth oauth config google --client-id=... --client-secret=... auth
Test an OAuth provider nself auth oauth test google auth
Enable multi-factor authentication nself auth mfa enable auth
Generate MFA backup codes nself auth mfa backup-codes auth
Create a new role nself auth roles create editor auth
Assign a role to a user nself auth roles assign [email protected] editor auth
Generate SSL certificates nself auth ssl generate auth
Trust local SSL certs (no browser warnings) nself auth ssl trust auth
Renew SSL certificates nself auth ssl renew auth
Configure rate limiting nself auth rate-limit config auth
Run a security scan nself auth security scan auth
Generate a security audit report nself auth security report auth
Create a webhook endpoint nself auth webhooks create <url> [events] auth
Test a webhook nself auth webhooks test <id> auth

Configuration & Environment

I want to... Command Details
Show current configuration nself config show config
Edit configuration nself config edit config
Validate my configuration nself config validate config
Switch to a different environment nself config env switch staging config
List all environments nself config env list config
Compare two environments nself config env diff staging prod config
Check my access level nself config env access config
List all secrets nself config secrets list config
Set a secret nself config secrets set API_KEY value config
Rotate all secrets nself config secrets rotate config
Initialize Vault integration nself config vault init config
Export config to a file nself config export > config.json config
Import config from a file nself config import config.json config

Monitoring & Debugging

I want to... Command Details
Check service health nself status status
Watch service health in real time nself status --watch status
View logs for a service nself logs postgres logs
Follow logs in real time nself logs hasura -f logs
View the last 100 log lines nself logs --tail 100 logs
Open Grafana dashboards nself monitor grafana monitor
Open Prometheus nself monitor prometheus monitor
Open Alertmanager nself monitor alertmanager monitor
Run a deep health check nself health --deep health
Set a monitoring profile nself metrics profile standard metrics
Run system diagnostics nself doctor doctor
Execute a command inside a container nself exec postgres psql -U postgres exec
View command history / audit trail nself history history
View security audit logs nself audit audit

Performance & Scaling

I want to... Command Details
Profile a service nself perf profile postgres perf
Run a benchmark / load test nself perf bench perf
Scale a service horizontally nself perf scale hasura 3 perf
Get optimization suggestions nself perf optimize perf
Auto-apply optimizations nself perf optimize --auto-fix perf

Backup & Recovery

I want to... Command Details
Create a full backup nself backup create --full backup
Create an incremental backup nself backup create --incremental backup
List available backups nself backup list backup
Restore from a backup nself backup restore <backup-id> backup
Roll back to a previous version nself backup rollback --version 3 backup
Reset to a clean state nself backup reset --confirm backup
Clean up old backups nself backup clean --age 30 backup

Developer Tools

I want to... Command Details
Add a frontend app for routing nself dev frontend add myapp 3000 dev
List frontend apps nself dev frontend list dev
Remove a frontend app nself dev frontend remove myapp dev
Generate CI/CD config for GitHub Actions nself dev ci generate --provider github dev
Generate CI/CD config for GitLab nself dev ci generate --provider gitlab dev
Generate project documentation nself dev docs generate dev
Serve documentation locally nself dev docs serve dev
Configure white-label branding nself dev whitelabel config dev
Toggle developer mode nself dev mode on dev

Plugins

I want to... Command Details
See available plugins nself plugin list plugin
Install the Stripe plugin nself plugin install stripe ../plugins/stripe
Install the GitHub plugin nself plugin install github ../plugins/github
Install the Shopify plugin nself plugin install shopify ../plugins/shopify
Update all plugins nself plugin update --all plugin
Check for plugin updates nself plugin updates plugin
Remove a plugin nself plugin remove stripe plugin
Create a custom plugin nself plugin create my-plugin ../plugins/development

File Storage

I want to... Command Details
Initialize the storage system nself service storage init service
Upload a file nself service storage upload photo.jpg service
Upload with thumbnail generation nself service storage upload avatar.png --thumbnails service
List stored files nself service storage list service
Delete a file nself service storage delete path/to/file.txt service
Check pipeline status nself service storage status service
Set up GraphQL integration nself service storage graphql-setup service

Email

I want to... Command Details
Send a test email nself service email test service
Configure email provider nself service email config <provider> service
Manage email templates nself service email template list service

Search

I want to... Command Details
Initialize a search provider nself service search init meilisearch service
Rebuild search indexes nself service search index service
Test a search query nself service search query "search term" service
Configure search settings nself service search config service

System Maintenance

I want to... Command Details
Update nself to the latest version nself update update
Check for available updates nself version --check version
Show current version nself version version
Set up shell completions nself completion bash completion
Open the admin UI nself admin admin
Tear down all infrastructure nself destroy destroy
Preview what destroy would do nself destroy --dry-run destroy
Destroy containers but keep data nself destroy --keep-volumes destroy

Migrating From Other Platforms

I want to... Command Details
Migrate from Firebase nself perf migrate from firebase ../migrations/FROM-FIREBASE.md
Migrate from Supabase nself perf migrate from supabase ../migrations/FROM-SUPABASE.md
Migrate from Nhost nself perf migrate from nhost ../migrations/FROM-NHOST.md

Common Workflows

New Project (5 minutes)

nself init --demo           # Create project with all features
nself build                 # Generate configuration
nself start                 # Start 25 containers
nself urls                  # See all service URLs
nself status                # Verify everything is healthy

Daily Development

nself start                 # Start services
nself db migrate up         # Run any new migrations
nself logs hasura -f        # Follow API logs while working
nself stop                  # Stop when done

Database Schema Workflow

nself db schema scaffold saas       # Start with a template
# Edit the generated DBML file
nself db schema apply schema.dbml   # Import + migrate
nself db types typescript           # Generate TypeScript types
nself db seed                       # Add sample data

Deploy to Production

nself config validate               # Validate configuration
nself deploy staging                # Deploy to staging first
# Verify staging works
nself deploy production             # Deploy to production
nself deploy status                 # Check deployment status

Set Up Multi-Tenant SaaS

nself tenant init                                   # Initialize multi-tenancy
nself tenant create "Acme Corp" --plan pro          # Create first tenant
nself tenant billing plans                          # Configure billing plans
nself tenant domains add acme app.acme.com          # Add custom domain
nself tenant branding logo acme logo.png            # Upload branding

Still Cannot Find What You Need?


Back to Commands Index | Back to Documentation Home

⚠️ **GitHub.com Fallback** ⚠️