Generate a new custom service from one of 40+ pre-configured language templates. The scaffolded service is wired into the nSelf stack as a CS_N slot — no Docker boilerplate to write by hand.
# Browse available templates
nself template list
# Scaffold a FastAPI service into ./my-api/
nself template scaffold fastapi my-api
# Scaffold into a specific directory
nself template scaffold gin my-api --into ./services/
# Remove a template you no longer need
nself template remove fastapinself template <SUBCOMMAND> [ARGS] [FLAGS]Custom services (CS_1 through CS_10) let you run any HTTP service alongside the core nSelf stack.nself template scaffold generates the boilerplate for one of those slots: a working service skeleton with a health endpoint, environment variable wiring, and a Dockerfile tuned for the target runtime. After scaffolding, add the service to your .env and run nself build to include it in the generated compose file.
Templates are versioned alongside the CLI. Use nself template list to see which templates are available in your installed version.
Print all available templates with their language, framework, and a short description.
nself template list
# TEMPLATE LANGUAGE FRAMEWORK
# express-ts TypeScript Express
# nest-ts TypeScript NestJS
# fastapi Python FastAPI
# flask Python Flask
# django Python Django
# gin Go Gin
# echo Go Echo
# fiber Go Fiber
# axum Rust Axum
# actix Rust Actix-web
# spring Java Spring Boot
# rails Ruby Rails API
# phoenix Elixir Phoenix
# ...and 30+ more
nself template list --jsonGenerate a service from the named template. dir is the output directory name — defaults to the template name if omitted.
# Scaffold into ./fastapi/
nself template scaffold fastapi
# Scaffold into ./my-api/
nself template scaffold fastapi my-api
# Scaffold into a specific parent directory
nself template scaffold nest-ts worker --into ./services/The scaffolded directory contains:
GET /healthz endpointDockerfile optimised for the target runtime.env.example with the variables the service expectsREADME.md with wiring instructionsRemove a template from the local cache. The template is re-downloaded if you scaffold it again.
nself template remove fastapi| Flag | Type | Default | Description |
|---|---|---|---|
--into <dir> | string | ./ | Parent directory to scaffold into |
--slot <n> | int | auto | Force a specific CS_N slot (1–10) |
--no-git | bool | false | Skip git init in the scaffolded directory |
After scaffolding, add the service to your project:
# 1. Add to .env (or .env.dev)
CUSTOM_SERVICE_1_NAME=my-api
CUSTOM_SERVICE_1_PATH=./my-api
CUSTOM_SERVICE_1_PORT=3100
# 2. Regenerate docker-compose
nself build
# 3. Start the full stack
nself start| Name | Language | Framework |
|---|---|---|
express-ts | TypeScript | Express |
nest-ts | TypeScript | NestJS |
fastapi | Python | FastAPI |
flask | Python | Flask |
django | Python | Django REST Framework |
gin | Go | Gin |
echo | Go | Echo |
fiber | Go | Fiber |
axum | Rust | Axum |
actix | Rust | Actix-web |
spring | Java | Spring Boot |
rails | Ruby | Rails API |
phoenix | Elixir | Phoenix |
Run nself template list for the complete set in your installed version.