Skip to content

nkapp service

Manage services in your nanokit.yml configuration without manually editing YAML.

bash
nkapp service <subcommand> [options]

Subcommands

service add [name]

Add a new service to nanokit.yml. Supports both interactive and non-interactive modes.

bash
nkapp service add [name] [options]
FlagTypeDescription
-i, --image <image>stringDocker image (e.g., nginx, node:20-slim)
-p, --port <port>numberHost port
-r, --runtime <runtime>stringRuntime (e.g., node)
--path <path>stringLocal path to service code

Interactive Mode: If name is omitted, Nanokit launches an interactive wizard that prompts for the service name, image, and port.

bash
# Non-interactive
nkapp service add api --image node:20-slim --port 3000 --path ./apps/api

# Interactive wizard
nkapp service add

service del <name> (alias: rm)

Remove a service from nanokit.yml and all environment overrides.

bash
nkapp service del <name> [-y]
FlagTypeDescription
-y, --yesbooleanSkip confirmation prompt

When a service is deleted, Nanokit automatically cleans up its entries from all environments.*.services.* blocks.


service set <name> <key=value>

Update a specific property for a service.

bash
nkapp service set <name> <key=value> [-e <env>]
FlagTypeDescription
-e, --env <target>stringSet the property for a specific environment override
bash
# Set globally
nkapp service set api image=node:22-slim

# Set for staging only
nkapp service set api port=8080 -e stage

Examples

bash
# Add a new worker service
nkapp service add worker --image node:20-slim --port 4000 --path ./apps/worker

# Remove old service
nkapp service del legacy-api -y

# Change image for production
nkapp service set web image=my-app:v2.1 -e production