muster setup
Set up a project: detect its services and write muster.json plus one hook folder per service.
Synopsis
muster setup [flags]
muster init [flags] # aliasDescription
Without flags, setup runs an interactive wizard (it needs a terminal). It scans the project, including docker/, k8s/, deploy/ and infra/, for Dockerfiles, compose files, Kubernetes manifests and app manifests such as package.json, then proposes services, a deploy order, health checks and credentials. Paths in .musterignore and folders named archived, deprecated, old or backup are skipped.
On a Kubernetes stack, setup also reads the live cluster (kubectl get deployments) for real deployment names, ports and probes. Services found in files but not in the cluster get skip_deploy: true. Without kubectl or a reachable cluster this step is skipped with a warning.
Infrastructure services (redis, postgres, mysql, mongo, rabbitmq, kafka, nginx and similar) get pull-only hooks and are ordered before app services. Setup adds .muster/logs/ and .muster/pids/ to .gitignore; commit muster.json and .muster/hooks/. All files are written at the end, so Ctrl+C leaves the project unchanged.
Flags
| Flag | Description |
|---|---|
--path, -p <dir> | Project directory (default: .). |
--scan | Auto-detect stack and services from project files. |
--stack, -s <type> | Stack: k8s, compose, docker, bare, dev. |
--services <list> | Comma-separated service names. |
--order <list> | Comma-separated deploy order (default: services order). |
--health <spec> | Per-service health: svc=type[:arg:arg] (repeatable). |
--creds <spec> | Per-service credentials: svc=mode (repeatable). Modes: off, save, session, always. |
--remote <spec> | Per-service remote: svc=user@host[:port][:path]. |
--git-pull <spec> | Per-service git pull: svc[=remote:branch] (repeatable; default origin/main). |
--strategy <spec> | Per-service strategy: svc=rolling|blue-green|canary (k8s services). With --update alone it switches an existing service and regenerates its unedited hooks. |
--namespace <ns> | Kubernetes namespace (default: default). |
--name, -n <name> | Project name (default: directory name). |
--force, -f | Start over: regenerate muster.json and hooks (hooks you edited are backed up first). |
--update, -u | Re-run on an existing project: add new services, keep your muster.json changes and edited hooks. |
--dry-run | With --scan: show what setup would do, write nothing. |
--json | With --scan --dry-run: print the preview as JSON. |
Spec formats
| Flag | Description |
|---|---|
--health api=http:/health:8080 | HTTP check on path and port. |
--health redis=tcp:6379 | TCP check on a port. |
--health worker=command:./check.sh | Run a command. |
--health api=none | No health check. |
--git-pull api=upstream:develop | Pull upstream/develop before each deploy. |
--remote [email protected]:2222:/opt/myapp | Run api's hooks on that host, port and directory. |
Examples
muster setup # interactive wizard
muster setup --scan # detect everything, no prompts
muster setup --path /app --scan
muster setup --stack k8s --services api,redis --name myapp
muster setup --scan --health api=http:/health:3000 --name myapp
muster setup --scan --dry-run --json # preview detected services as JSON
muster setup --update --scan # add new services, keep your edits
muster setup --update --strategy api=canary # switch api to canary deploysExit codes and JSON
--scan --dry-run --json prints the detected stack, services, health checks and deploy order without writing anything. Shape: JSON API.