Composable devcontainer scaffolds that collapse into normal, editable configs.
This project follows spec-first development. Every feature MUST start with a
reviewed spec committed under docs/specs/ before implementation code is
written.
# Discover available overlays and presets
npx container-superposition list
npx container-superposition explain postgres
# Preview before writing files
npx container-superposition plan --stack compose --overlays nodejs,postgres,grafana
npx container-superposition plan --stack compose --overlays grafana --verbose
# Guided questionnaire — writes shared project intent and generated output
npx container-superposition init
# Declarative project config committed in the repo
cat > superposition.yml <<'YAML'
stack: compose
overlays:
- nodejs
- postgres
env:
APP_ENV: development
mounts:
- "./local-tools:/workspace/tools"
ports:
- ${API_PORT:-8080}:8080
customizations:
envTemplate:
POSTGRES_PASSWORD: postgres
YAML
npx container-superposition init --no-interactive
# Regenerate from the repository project file
npx container-superposition regen
# Or select the project file explicitly
npx container-superposition regen --from-project
# Non-interactive CLI example
npx container-superposition init --stack compose --language nodejs --database postgres
# Write only superposition.yml without generating .devcontainer/
npx container-superposition init --stack compose --language nodejs --no-scaffold
# Migrate a manifest-only repo to the project-file model
npx container-superposition migrate- Base templates:
plain(single image) andcompose(multi-service). - Overlays: add languages, databases, observability, cloud tools, dev tools.
- Composition: merges overlays into a standard
.devcontainer/you can edit freely. - Compose defaults: tool-owned compose port bindings are hard-rendered to final numeric host ports;
.devcontainer/.envand.devcontainer/.env.exampleare opt-in artifacts only via--compose-env-files/composeEnvFiles: true. - Project config:
superposition.yml(or.superposition.yml) is the canonical input for all generation and regeneration flows. Commit it to your repo for reproducible team and CI builds.initalways writessuperposition.ymlas its primary outputregenreads only the project file —superposition.jsonis an output-only receipt- Repos without a project file should run
cs migrateonce to create one from their manifest - Optional
~/.superposition.ymldefaults can prefill only eligible freshinitruns (~/.container-superposition.ymlstill works and wins when both exist) doctorcompares the project file against the last-generated manifest and reports drift
init— run the interactive questionnaire; always writessuperposition.ymland (by default) scaffolds.devcontainer/- Add
--compose-env-filesto persistcomposeEnvFiles: trueand generate.devcontainer/.envplus.devcontainer/.env.example - Add
--no-scaffoldto write only the project file without generating.devcontainer/ - Add
--ignore-global-defaultsto bypass~/.container-superposition.ymland~/.superposition.ymlfor one run - Add
--project-root <path>to resolve persisted input from a different repository root
- Add
regen— deterministically replay the repository project file (superposition.ymlrequired)- Add
--compose-env-filesto update shared intent tocomposeEnvFiles: truebefore regeneration - Add
--project-root <path>to resolve persisted input from a different repository root
- Add
migrate— one-time migration: createssuperposition.ymlfrom an existingsuperposition.json- Required for repos that ran
initbefore this project-file-first model was introduced
- Required for repos that ran
adopt— migrate an existing.devcontainer/to the overlay-based workflowlist— browse overlays and presetsexplain— inspect overlay or preset detailsplan— preview output before writing- Add
--verboseto narrate dependency resolution and inclusion reasons - Add
--from-manifest <path>to preview an existing manifest with the same explanation model
- Add
hash— deterministic environment fingerprintdoctor— validate environment and detect project-file drift
Start here:
- Docs index
- superposition.yml reference ← project file authoring guide
- Versioned private catalogs
- Quick reference
- Adopt command
- Hash command
- Examples
- Presets
- Architecture
- Overlays
- Custom patches
- Workflows and regen
- Filesystem contract
- Security
- Publishing
See CONTRIBUTING.md. Overlay and generated-output behavior changes now use the shared Behave workflow via npm run test:bdd / task test:bdd, with task validate:generated as the full pre-handoff path.
MIT. See LICENSE