Remove generated artifacts: docker-compose.yml, nginx/ configs,ssl/ certificates, and the build cache. Safe by design — never touches Docker volumes or your project data.
Data-safe
nself clean only removes files that nself build generates. Your .env, your Postgres data volumes, your uploaded files in MinIO, and your nginx/conf.d/ customizations are never touched. For a full wipe including data, use nself reset.
# Remove all generated artifacts
nself clean
# Preview what would be removed without deleting anything
nself clean --dry-run
# Clean and immediately rebuild
nself clean && nself buildnself clean [FLAGS]After a failed or partial build, generated files can be in an inconsistent state.nself clean removes all of them so you can start fresh withnself build. It is also useful when switching between environments — clean out the dev-environment config before generating a production build.
The command removes only files and directories that are written by nself build:
docker-compose.yml — the generated Compose filenginx/nginx.conf and nginx/sites/ — generated nginx configsssl/cert.pem and ssl/key.pem — generated certificates.nself-build-cache/ — incremental build cache (speeds up repeated builds)The following are never removed:
.env and all .env.* variantsnginx/conf.d/ — your hand-managed nginx customizations~/.nself/)| Flag | Default | Description |
|---|---|---|
--dry-run | false | List files that would be removed without deleting them |
--cache-only | false | Remove only the build cache, leave generated config files in place |
--force, -f | false | Skip the confirmation prompt when running interactively |
--verbose, -v | false | Print each file path as it is removed |
nself clean
nself build
nself startnself clean --dry-run
# Would remove: docker-compose.yml
# Would remove: nginx/nginx.conf
# Would remove: nginx/sites/ (14 files)
# Would remove: ssl/cert.pem
# Would remove: ssl/key.pem
# Would remove: .nself-build-cache/ (87 files)# Useful when you want to force a full re-evaluation
# of all template decisions without removing the output
nself clean --cache-onlynself clean --force
nself build --env prod
nself start| Command | Removes generated files | Removes Docker volumes | Removes project data |
|---|---|---|---|
nself clean | Yes | No | No |
nself reset | Yes | Yes | Yes — destructive |