Repository navigation
cmd init
Initialize a new ɳSelf project. It asks no questions:
nself init && nself startworks with zero prompts.
nself init <subcommand> [flags]
nself init launches an interactive setup wizard that creates a pristine .env configuration for a new ɳSelf project. It uses the project directory name and the default base domain local.nself.org (override with --name and --domain), then auto-generates cryptographically secure secrets (Postgres password, Hasura admin secret, JWT key).
You can choose which optional services to enable during init (Redis, MinIO, MeiliSearch, Mailpit, Monitoring). Each selection updates the generated .env accordingly. All values are validated before being written, domain format, password strength, and required fields are all checked.
After nself init completes, run nself build to generate docker-compose.yml and nginx configs, then nself start to boot the stack.
init takes the project name from the current directory name and writes it to
PROJECT_NAME. It also derives POSTGRES_DB from that name, because a
database name has to be a valid SQL identifier and a directory name frequently
is not.
The derivation lowercases the name, folds -, . and space to _, drops
anything else, prefixes a leading digit with _, and truncates to Postgres's
63-byte identifier limit. So my-app yields database my_app, while
PROJECT_NAME keeps its hyphens for Docker compatibility. The two values are
allowed to differ and normally do.
Set POSTGRES_DB yourself in .env if you want a specific name. A directory
name that reduces to nothing usable (---, for example) is rejected at init
rather than at first start.
Clone templates are full-stack app starters embedded in the CLI binary. They include a Postgres schema with RLS policies, Hasura metadata, seed data, and a Flutter UI starter. The files are embedded, so scaffolding downloads nothing; the plugin check below reads the plugin catalog (the cached copy works offline).
| Template | Tables | Required plugins |
|---|---|---|
airbnb-clone |
np_listings, np_bookings, np_reviews
|
auth, notify, photos
|
discord-clone |
np_servers, np_channels, np_messages, np_members, np_roles
|
chat, realtime, auth, moderation
|
notion-clone |
np_workspaces, np_pages, np_blocks, np_page_members
|
cms, auth, realtime
|
slack-clone |
np_workspaces, np_channels, np_messages, np_threads, np_reactions
|
chat, livekit, realtime, auth, notify
|
substack-clone |
np_newsletters, np_posts, np_subscribers, np_tiers
|
cms, notify, auth
|
zoom-clone |
np_meetings, np_participants, np_recordings
|
livekit, recording, auth, notify
|
Before it writes anything, nself init --template <x>-clone looks up each required plugin in the plugin catalog and checks your licence against the Bundles that include the licensed ones. A template whose plugins are all free makes no licence call.
| Finding | From v1.5 | In v1.4 mode |
|---|---|---|
| A licensed plugin your licence does not cover | Refused with E110 (exit 3); the message lists each plugin, the Bundles that include it and the purchase link. Nothing is written. |
The same text is printed as a warning and the template is scaffolded. |
A plugin that is in no registry (recording, required by zoom-clone) |
Refused with E137 (exit 1). |
Warning, then scaffold. |
| No catalog and no cached copy | Refused with E115 (exit 2). |
Scaffold, no message. |
A licensed plugin is covered when any of your configured licence keys covers one of its Bundles (an all-access licence such as ɳSelf+ covers them all). A licensed plugin that is in no Bundle cannot be decided here; init prints a note and nself plugin install checks it later. A plugin that exists in both tiers counts as free, as it does for nself plugin install without a licence. In v1.4 mode the whole check gives up after 8 seconds, so a slow network never holds up the scaffold, and a check that timed out prints nothing. Init may print a note: line for licensed plugins that are in no Bundle, and the licence client's offline-grace warning when the licence server is unreachable. Buy a Bundle at https://nself.org/pricing or run nself license set <key>, then run the command again.
# Scaffold a clone template into the current directory
nself init --template airbnb-clone
# Scaffold into a named directory
nself init --template discord-clone ./my-discord
# Skip seed data (schema only)
nself init --template notion-clone --no-seed
# Preview files without writing
nself init --template slack-clone --dry-run
# Scaffold and immediately install required plugins
nself init --template substack-clone ./my-newsletter
cd my-newsletter
nself plugin install cms notify auth
nself start
nself db migrate
nself hasura metadata apply --file hasura/metadata.jsonEach clone template writes:
<dest>/
migrations/
001_schema.sql — CREATE TABLE np_* statements with RLS policies
002_seed.sql — demo data (omitted with --no-seed)
hasura/
metadata.json — Hasura permissions and relationships
flutter/
pubspec.yaml
lib/main.dart — starter app with GraphQL client and skeleton screens
nself.yml — project config with required plugins list
.env.example — environment variable template
README.md — getting started guide
Use nself template list to see all bundled and marketplace templates together.
nself init emits a single anonymous init_complete event when NSELF_TELEMETRY_OPT_IN=1 is set. The event is sent in a background goroutine with a 1-second timeout and is silently dropped on failure.
Opt-in only. No data is collected unless you explicitly set the environment variable. Absence of the variable means zero network calls.
Fields collected:
| Field | Type | Example | Notes |
|---|---|---|---|
wizard_mode |
string |
fast, wizard, demo, non-interactive, default
|
Which init mode was used |
duration_ms |
integer | 312 |
Time from command start to completion |
success |
bool | true |
Whether init completed without error |
err_category |
string | docker-not-found |
Error bucket; one of timeout, permission-denied, docker-not-found, other
|
install_source |
string | hn |
Source tag from ?ref= in install.sh (nullable) |
install_method |
string | brew |
How nself was installed: brew, curl, docker, other (nullable) |
app_context |
string | nclaw |
Which Type-C app initiated this install (nullable) |
No PII is collected. Email addresses, file paths, project names, and license keys are never included. All values are categorical or numeric.
To opt in:
export NSELF_TELEMETRY_OPT_IN=1
nself init --fast| Name | Shorthand | Type | Default | Env | Escalates to | JSON override | Description |
|---|---|---|---|---|---|---|---|
--cs-template |
string |
"" |
Scaffold a custom service at init time: specify language (go, node, python, rust, other) | ||||
--demo |
bool |
false |
Auto-configure with all services enabled | ||||
--domain |
string |
"" |
BASE_DOMAIN |
Base domain (default: local.nself.org; init never prompts for it, e.g. myapp.dev) | |||
--dry-run |
bool |
false |
Print files that would be written without writing them (clone templates only) | ||||
--fast |
bool |
false |
Skip advanced options, use smart defaults | ||||
--force |
bool |
false |
Overwrite existing configuration | ||||
--full |
bool |
false |
Create all environment files (.env.dev, .env.staging, .env.prod, .env.secrets) | ||||
--interactive |
bool |
false |
Explicitly enable interactive wizard | ||||
--list-presets |
bool |
false |
List all available project presets and exit | ||||
--name |
string |
"" |
Project name (sets PROJECT_NAME in generated .env) | ||||
--no-pgvector |
bool |
false |
Skip pgvector extension and RAG scaffold tables (sets PGVECTOR_ENABLED=false) | ||||
--no-seed |
bool |
false |
Skip seed data when scaffolding a clone template | ||||
--non-interactive |
bool |
false |
Use all defaults without prompts | ||||
--preset |
string |
"" |
Use a project-type preset: b2b-saas, mobile-backend, ai-assistant, community-forum, media-hosting, dev, sentry, nclaw-app | ||||
--profile |
string |
"" |
Resource profile: 'tiny' for small VPS (Postgres+nginx only) | ||||
--quiet |
bool |
false |
Suppress output messages | ||||
--skip-validation |
bool |
false |
Skip configuration validation | ||||
--template |
string |
"" |
Use a built-in, clone, or marketplace template (e.g. airbnb-clone, go, rust) | ||||
--wizard |
bool |
false |
Run the full 10-step interactive wizard | ||||
--help |
-h |
bool |
false |
Show help |
| Name | Description |
|---|---|
template |
Browse and publish full-stack app templates |
-
Side effect:
write -
Output:
document -
JSON:
envelope(data schema) - Exit codes: none declared
# Minimal interactive setup
nself init
# Full 10-step wizard
nself init --wizard
# All services enabled (demo/evaluation)
nself init --demo
# Create all env files at once
nself init --full
# Smart defaults, no prompts
nself init --fast
# Non-interactive — all defaults, safe for CI
nself init --non-interactive
# Small VPS (512 MB–1 GB RAM): start with Postgres + nginx only
nself init --profile=tiny
# Skip prompts by supplying name and domain directly
nself init --name myapp --domain myapp.dev
# Start from a Go project template
nself init --template go --name myapi --domain myapi.local- Commands — full command index
- Core-Services — what a stack is made of
Getting Started
Commands
- Commands, Overview
- Lifecycle: cmd-init · cmd-build · cmd-start · cmd-stop · cmd-restart · cmd-dev
- Monitoring: cmd-status · cmd-logs · cmd-health · cmd-urls · cmd-doctor · cmd-monitor · cmd-alerts · cmd-sentry · cmd-watchdog
- Data: cmd-db · cmd-backup · cmd-dr · cmd-queue · cmd-webhooks
- Config: cmd-config · cmd-service · cmd-env · cmd-promote
- Networking: cmd-ssl · cmd-trust · cmd-dns-setup
- Security: cmd-access · cmd-security · cmd-secrets
- Tenancy: cmd-tenant · cmd-billing
- Plugins: cmd-plugin · cmd-license · cmd-dogfood (extracted, CLI-R11) · cmd-k8s (extracted, CLI-R11) · cmd-encryption (extracted, CLI-R11) · cmd-waf (extracted, CLI-R11) · cmd-federation (extracted, CLI-R11) · cmd-mail (extracted, CLI-R11) · cmd-dlq (extracted, CLI-R11)
- AI: cmd-ai · cmd-claw · cmd-model
- Templates: cmd-template
- Utilities: cmd-exec · cmd-clean · cmd-reset · cmd-update · cmd-upgrade · cmd-version · cmd-admin · cmd-migrate · cmd-migrate-firebase · cmd-migrate-supabase · cmd-completion
Features
- Features, Overview
- Feature-Auth
- Feature-Storage
- Feature-Search
- Feature-Functions
- Feature-Email
- Feature-Monitoring
- Feature-Plugins
- Feature-nClaw, AI Assistant
- Feature-nChat, Messaging
- Feature-nFamily, Family Social
- Feature-nCloud, Managed Hosting
- Feature-Memory-Rooms, Knowledge Organization
- Feature-Agent-Dashboard, Agent Metrics
- Feature-Image-Generation, AI Image Generation
Configuration
- Configuration, Overview
- Config-Env-Vars
- Config-Postgres
- Config-Hasura
- Config-Auth
- Config-Nginx
- Shared-Proxy
- Config-Optional-Services
- Config-Custom-Services
- Config-System
Plugins (87 + 10 monitoring)
- Plugin-Overview
- Plugin-Catalog
- Plugin-Install
- Plugin-Licensing
- Plugin-Architecture
- Plugin-Dev-Guide
- Plugin-Migrations-Contract
Free (25)
- plugin-backup
- plugin-content-acquisition
- plugin-content-progress
- plugin-cron
- plugin-donorbox
- plugin-feature-flags
- plugin-github
- plugin-github-runner
- plugin-invitations
- plugin-jobs
- plugin-link-preview
- plugin-mdns
- plugin-mlflow
- plugin-monitoring
- plugin-notifications
- plugin-notify
- plugin-paypal
- plugin-search
- plugin-shopify
- plugin-stripe
- plugin-subtitle-manager
- plugin-tokens
- plugin-torrent-manager
- plugin-vpn
- plugin-webhooks
Pro (62)
- plugin-access-controls
- plugin-activity-feed
- plugin-admin-api
- plugin-analytics
- plugin-auth
- plugin-bots
- plugin-browser
- plugin-calendar
- plugin-cdn
- plugin-chat
- plugin-claw
- plugin-claw-budget
- plugin-claw-news
- plugin-claw-web
- plugin-cloudflare
- plugin-cms
- plugin-compliance
- plugin-ddns
- plugin-devices
- plugin-documents
- plugin-entitlements
- plugin-file-processing
- plugin-game-metadata
- plugin-geocoding
- plugin-geolocation
- plugin-google
- plugin-home
- plugin-idme
- plugin-knowledge-base
- plugin-linkedin
- plugin-livekit
- plugin-media-processing
- plugin-meetings
- plugin-moderation
- plugin-mux
- plugin-object-storage
- plugin-observability
- plugin-photos
- plugin-podcast
- plugin-post
- plugin-realtime
- plugin-retro-gaming
- plugin-rom-discovery
- plugin-social
- plugin-sports
- plugin-support
- plugin-tmdb
- plugin-voice
- plugin-web3
- plugin-workflows
Planned (26)
plugin-auditplugin-blogplugin-checkoutplugin-commerceplugin-drmplugin-exportplugin-flowplugin-importplugin-ldapplugin-mailgunplugin-mediaplugin-oauth-providersplugin-pagesplugin-postmarkplugin-rate-limitplugin-reportsplugin-samlplugin-schedulerplugin-sendgridplugin-ssoplugin-subscriptionplugin-thumbplugin-transcoderplugin-twilioplugin-wafplugin-watermark
Guides
- Guide-Production-Deployment
- Guide-SSL-Setup
- Guide-Multi-Tenancy
- Guide-Security-Hardening
- Guide-Monitoring-Setup
- Guide-Backup-Restore
- Guide-Custom-Services
- Guide-Migration-from-v1
Architecture
- Architecture
- Architecture-Guardrails
- Service-Graph
- Compose-Generation
- Nginx-Generation
- Plugin-Architecture
Reference
Machine interface
-
JSON-Output,
--jsonenvelope -
Command-Registry,
nself help --json - Exit-Codes
- error-codes, Error Codes
-
Compat-V15,
NSELF_V15gate
Licensing
Security
Brand
Operations
- operations/release-cascade, Release Cascade
- operations/self-healing, Self-Healing Schema
- operations/redis-tuning, Redis Pool Tuning
- operations/meilisearch-warmup, MeiliSearch Warm-Up
- operations/jwt-rotation, JWT Key Rotation
- operations/windows-wsl2-setup, Windows / WSL2 Setup
- operations/gemini-oauth-reauth, Gemini OAuth Reauth
Contributing
Admin
- USER-ACTION-QUEUE, Pending Admin Actions
All commands (21)
- A: cmd-add · cmd-admin
- B: cmd-backup · cmd-build
- C: cmd-clean · cmd-config
- D: cmd-db · cmd-deploy · cmd-doctor
- E: cmd-exec
- I: cmd-init
- L: cmd-license · cmd-logs
- M: cmd-mcp
- R: cmd-remove · cmd-reset · cmd-restart
- S: cmd-start · cmd-status · cmd-stop
- U: cmd-update