Initialize a new nSelf project in the current directory. Generates .env.dev, Hasura metadata stubs, and a docker-compose.yml tailored to one of five presets.
# Standard setup (Postgres + Hasura + Auth + Nginx + Redis)
nself init
# Minimal — Postgres + Hasura + Auth only
nself init --profile tiny
# Full stack including MinIO, Functions, Mail, MeiliSearch
nself init --profile full
# Team preset with monitoring bundle enabled
nself init --profile team
# Cloud preset — full stack + multi-tenancy + ɳCloud hooks
nself init --profile cloudnself init [--profile <preset>] [FLAGS]nself init is the first command you run in a new project directory. It scaffolds the config files that nself build and nself start depend on. All generated files follow the environment cascade convention: .env.dev → .env.local → .env.staging/.env.prod → .env.secrets → .env.computed.
The generated docker-compose.yml carries a # GENERATED BY nself build — DO NOT HAND EDITheader and must be regenerated via nself build after any config change. Never edit it directly.
v1.1.0 added five named presets (previously init had no --profile flag and always produced the standard stack). If you are upgrading from v1.0.x, your existing project directory is already equivalent to --profile standard — no re-init needed.
| Profile | Services included | Best for |
|---|---|---|
tiny | Postgres, Hasura, Auth, Nginx | Minimal API backend, hobby projects, resource-constrained servers |
standard (default) | tiny + Redis | Most projects — session caching and queue support without full object storage |
full | standard + MinIO, Functions, Mail, MeiliSearch | Production-ready apps needing file storage, serverless functions, email, and full-text search |
team | full + Prometheus, Grafana, Loki, Alertmanager (monitoring bundle) | Team deployments requiring observability and alerting out of the box |
cloud | team + multi-tenancy config + ɳCloud registration hooks | Projects that will be managed via ɳCloud or white-label deployments |
.env.dev — environment defaults with dev-stub secrets.env.example — placeholder template safe to commithasura/metadata/ — Hasura metadata stubs (databases, sources, permissions)hasura/migrations/ — empty migrations directorynginx/conf.d/default.conf — hand-managed Nginx config (safe to edit).nself/project.json — project identity (name, created date, profile)docker-compose.yml and nginx/nginx.conf are generated by nself build, not by init. Run nself build after init to produce them.
| Flag | Type | Default | Description |
|---|---|---|---|
--profile | string | standard | Init preset: tiny, standard, full, team, cloud |
--name | string | directory name | Project name (written to .nself/project.json) |
--domain | string | — | Primary domain (pre-fills Nginx and SSL config) |
--force | bool | false | Overwrite existing config files without prompting |
--no-git | bool | false | Skip the git init that init runs by default |
--json | bool | false | Emit a JSON summary of generated files on completion |
mkdir my-app && cd my-app
nself init
nself build
nself startnself init --profile full --domain api.example.com --name my-apinself init --profile team --forcenself init --profile tiny --no-git --jsonnself init --profile cloud --domain myapp.nself.org
nself build
nself cloud registerNSELF_DEFAULT_PROFILE — override the default profile when --profile is omittedNSELF_PROJECT_NAME — override the inferred project name0 — project initialized successfully1 — initialization error (permissions, disk space)2 — invalid arguments3 — directory already initialized (use --force to overwrite)