container-superposition 0.1.3 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +72 -1014
- package/dist/scripts/init.js +512 -238
- package/dist/scripts/init.js.map +1 -1
- package/dist/tool/commands/adopt.d.ts +62 -0
- package/dist/tool/commands/adopt.d.ts.map +1 -0
- package/dist/tool/commands/adopt.js +767 -0
- package/dist/tool/commands/adopt.js.map +1 -0
- package/dist/tool/commands/doctor.js +2 -2
- package/dist/tool/commands/explain.d.ts.map +1 -1
- package/dist/tool/commands/explain.js +88 -0
- package/dist/tool/commands/explain.js.map +1 -1
- package/dist/tool/commands/hash.d.ts +36 -0
- package/dist/tool/commands/hash.d.ts.map +1 -0
- package/dist/tool/commands/hash.js +242 -0
- package/dist/tool/commands/hash.js.map +1 -0
- package/dist/tool/commands/plan.d.ts +53 -0
- package/dist/tool/commands/plan.d.ts.map +1 -1
- package/dist/tool/commands/plan.js +784 -42
- package/dist/tool/commands/plan.js.map +1 -1
- package/dist/tool/questionnaire/composer.d.ts +12 -3
- package/dist/tool/questionnaire/composer.d.ts.map +1 -1
- package/dist/tool/questionnaire/composer.js +133 -20
- package/dist/tool/questionnaire/composer.js.map +1 -1
- package/dist/tool/schema/project-config.d.ts +15 -0
- package/dist/tool/schema/project-config.d.ts.map +1 -0
- package/dist/tool/schema/project-config.js +359 -0
- package/dist/tool/schema/project-config.js.map +1 -0
- package/dist/tool/schema/types.d.ts +57 -1
- package/dist/tool/schema/types.d.ts.map +1 -1
- package/dist/tool/utils/backup.d.ts +23 -0
- package/dist/tool/utils/backup.d.ts.map +1 -0
- package/dist/tool/utils/backup.js +123 -0
- package/dist/tool/utils/backup.js.map +1 -0
- package/dist/tool/utils/gitignore.d.ts +15 -0
- package/dist/tool/utils/gitignore.d.ts.map +1 -0
- package/dist/tool/utils/gitignore.js +41 -0
- package/dist/tool/utils/gitignore.js.map +1 -0
- package/dist/tool/utils/services-export.d.ts +14 -0
- package/dist/tool/utils/services-export.d.ts.map +1 -0
- package/dist/tool/utils/services-export.js +478 -0
- package/dist/tool/utils/services-export.js.map +1 -0
- package/dist/tool/utils/summary.d.ts +69 -0
- package/dist/tool/utils/summary.d.ts.map +1 -0
- package/dist/tool/utils/summary.js +260 -0
- package/dist/tool/utils/summary.js.map +1 -0
- package/docs/README.md +12 -2
- package/docs/adopt.md +196 -0
- package/docs/custom-patches.md +1 -1
- package/docs/discovery-commands.md +55 -3
- package/docs/examples.md +40 -6
- package/docs/filesystem-contract.md +58 -0
- package/docs/hash.md +183 -0
- package/docs/minimal-and-editor.md +1 -1
- package/docs/overlays.md +108 -5
- package/docs/presets-architecture.md +1 -1
- package/docs/presets.md +1 -1
- package/docs/publishing.md +36 -23
- package/docs/security.md +43 -0
- package/docs/specs/001-verbose-plan-graph/checklists/requirements.md +36 -0
- package/docs/specs/001-verbose-plan-graph/contracts/plan-verbose-output.md +96 -0
- package/docs/specs/001-verbose-plan-graph/data-model.md +111 -0
- package/docs/specs/001-verbose-plan-graph/plan.md +127 -0
- package/docs/specs/001-verbose-plan-graph/quickstart.md +106 -0
- package/docs/specs/001-verbose-plan-graph/research.md +100 -0
- package/docs/specs/001-verbose-plan-graph/spec.md +128 -0
- package/docs/specs/001-verbose-plan-graph/tasks.md +223 -0
- package/docs/specs/002-superposition-config-file/checklists/requirements.md +36 -0
- package/docs/specs/002-superposition-config-file/contracts/init-project-config.md +98 -0
- package/docs/specs/002-superposition-config-file/data-model.md +126 -0
- package/docs/specs/002-superposition-config-file/plan.md +208 -0
- package/docs/specs/002-superposition-config-file/quickstart.md +140 -0
- package/docs/specs/002-superposition-config-file/research.md +144 -0
- package/docs/specs/002-superposition-config-file/spec.md +130 -0
- package/docs/specs/002-superposition-config-file/tasks.md +213 -0
- package/docs/team-workflow.md +27 -1
- package/docs/workflows.md +136 -0
- package/overlays/.presets/microservice.yml +32 -6
- package/overlays/.presets/sdd.yml +84 -0
- package/overlays/.presets/web-api.yml +76 -56
- package/overlays/README.md +7 -1
- package/overlays/amp/README.md +70 -0
- package/overlays/amp/devcontainer.patch.json +3 -0
- package/overlays/amp/overlay.yml +15 -0
- package/overlays/amp/setup.sh +21 -0
- package/overlays/amp/verify.sh +21 -0
- package/overlays/claude-code/README.md +83 -0
- package/overlays/claude-code/devcontainer.patch.json +3 -0
- package/overlays/claude-code/overlay.yml +15 -0
- package/overlays/claude-code/setup.sh +21 -0
- package/overlays/claude-code/verify.sh +21 -0
- package/overlays/cloudflared/README.md +190 -0
- package/overlays/cloudflared/devcontainer.patch.json +3 -0
- package/overlays/cloudflared/overlay.yml +15 -0
- package/overlays/cloudflared/setup.sh +49 -0
- package/overlays/cloudflared/verify.sh +21 -0
- package/overlays/direnv/README.md +6 -4
- package/overlays/direnv/setup.sh +0 -12
- package/overlays/gemini-cli/README.md +77 -0
- package/overlays/gemini-cli/devcontainer.patch.json +3 -0
- package/overlays/gemini-cli/overlay.yml +15 -0
- package/overlays/gemini-cli/setup.sh +21 -0
- package/overlays/gemini-cli/verify.sh +21 -0
- package/overlays/grpc-tools/README.md +242 -0
- package/overlays/grpc-tools/devcontainer.patch.json +14 -0
- package/overlays/grpc-tools/overlay.yml +14 -0
- package/overlays/grpc-tools/setup.sh +57 -0
- package/overlays/grpc-tools/verify.sh +47 -0
- package/overlays/keycloak/.env.example +5 -0
- package/overlays/keycloak/README.md +238 -0
- package/overlays/keycloak/devcontainer.patch.json +17 -0
- package/overlays/keycloak/docker-compose.yml +32 -0
- package/overlays/keycloak/overlay.yml +23 -0
- package/overlays/keycloak/verify.sh +54 -0
- package/overlays/mailpit/.env.example +4 -0
- package/overlays/mailpit/README.md +191 -0
- package/overlays/mailpit/devcontainer.patch.json +20 -0
- package/overlays/mailpit/docker-compose.yml +17 -0
- package/overlays/mailpit/overlay.yml +26 -0
- package/overlays/mailpit/verify.sh +52 -0
- package/overlays/ngrok/overlay.yml +2 -1
- package/overlays/opencode/README.md +76 -0
- package/overlays/opencode/devcontainer.patch.json +3 -0
- package/overlays/opencode/overlay.yml +14 -0
- package/overlays/opencode/setup.sh +21 -0
- package/overlays/opencode/verify.sh +21 -0
- package/overlays/python/README.md +51 -35
- package/overlays/python/devcontainer.patch.json +7 -4
- package/overlays/python/setup.sh +50 -23
- package/overlays/python/verify.sh +29 -1
- package/overlays/spec-kit/README.md +181 -0
- package/overlays/spec-kit/devcontainer.patch.json +6 -0
- package/overlays/spec-kit/overlay.yml +19 -0
- package/overlays/spec-kit/setup.sh +45 -0
- package/overlays/spec-kit/verify.sh +33 -0
- package/overlays/windsurf-cli/README.md +69 -0
- package/overlays/windsurf-cli/devcontainer.patch.json +3 -0
- package/overlays/windsurf-cli/overlay.yml +15 -0
- package/overlays/windsurf-cli/setup.sh +21 -0
- package/overlays/windsurf-cli/verify.sh +21 -0
- package/package.json +1 -1
- package/tool/schema/config.schema.json +138 -9
package/README.md
CHANGED
|
@@ -4,1045 +4,103 @@
|
|
|
4
4
|
[](https://github.com/veggerby/container-superposition/actions/workflows/build-devcontainers.yml)
|
|
5
5
|
[](https://www.npmjs.com/package/container-superposition)
|
|
6
6
|
|
|
7
|
-
Composable devcontainer scaffolds that collapse into
|
|
7
|
+
Composable devcontainer scaffolds that collapse into normal, editable configs.
|
|
8
8
|
|
|
9
|
-
##
|
|
9
|
+
## Development Policy
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
This project follows spec-first development. Every feature MUST start with a
|
|
12
|
+
reviewed spec committed under `docs/specs/` before implementation code is
|
|
13
|
+
written.
|
|
12
14
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
- **Leverage, Don't Duplicate** - Use official images and features from containers.dev
|
|
16
|
-
- **Minimal Base + Composable Overlays** - Start simple, add what you need
|
|
17
|
-
- **Copy-Paste Ready** - Works immediately, customize as needed
|
|
18
|
-
- **Observability First-Class** - Full OpenTelemetry stack available as overlays
|
|
19
|
-
|
|
20
|
-
## 📋 Philosophy: Opinionated with Battle-Tested Defaults
|
|
21
|
-
|
|
22
|
-
This tool is **opinionated by design**, providing carefully curated configurations that have been tested in real-world development scenarios:
|
|
23
|
-
|
|
24
|
-
- **🎯 Battle-Tested Defaults** - Base images and configurations are chosen based on proven stability and broad compatibility
|
|
25
|
-
- **🔧 Customization Available** - While we provide sensible defaults, you can customize base images and configurations
|
|
26
|
-
- **⚠️ With Great Power...** - Custom images may introduce conflicts with overlays; test thoroughly
|
|
27
|
-
- **📝 Editable Output** - Generated configurations are plain JSON/YAML you can modify post-generation
|
|
28
|
-
|
|
29
|
-
**Default Base Image**: `mcr.microsoft.com/devcontainers/base:bookworm` (Debian Bookworm)
|
|
30
|
-
|
|
31
|
-
- Well-maintained by Microsoft
|
|
32
|
-
- Broad compatibility with devcontainer features
|
|
33
|
-
- Regular security updates
|
|
34
|
-
- Proven stability across diverse projects
|
|
35
|
-
|
|
36
|
-
**Alternative Base Images**:
|
|
37
|
-
|
|
38
|
-
- **Debian Trixie**: Newer packages, testing stability
|
|
39
|
-
- **Alpine Linux**: Minimal footprint (~5MB), ideal for resource-constrained environments
|
|
40
|
-
- **Ubuntu LTS**: Popular, familiar, extensive package ecosystem
|
|
41
|
-
- **Custom Images**: Specify your own, but be aware of potential overlay conflicts
|
|
42
|
-
|
|
43
|
-
All overlays are designed to work across Debian, Alpine, and Ubuntu bases with automatic package manager detection.
|
|
44
|
-
|
|
45
|
-
## 📁 Structure
|
|
46
|
-
|
|
47
|
-
```
|
|
48
|
-
container-superposition/
|
|
49
|
-
├── templates/ # Minimal base templates (plain, compose)
|
|
50
|
-
│ ├── plain/ # Simple image-based devcontainer
|
|
51
|
-
│ └── compose/ # Docker Compose-based devcontainer
|
|
52
|
-
├── overlays/ # Composable capability overlays
|
|
53
|
-
│ ├── index.yml # Overlay registry and metadata
|
|
54
|
-
│ ├── presets/ # Stack presets (meta-overlays)
|
|
55
|
-
│ │ ├── web-api.yml
|
|
56
|
-
│ │ ├── microservice.yml
|
|
57
|
-
│ │ ├── docs-site.yml
|
|
58
|
-
│ │ └── fullstack.yml
|
|
59
|
-
│ ├── dotnet/ # Language overlays
|
|
60
|
-
│ ├── nodejs/
|
|
61
|
-
│ ├── python/
|
|
62
|
-
│ ├── mkdocs/
|
|
63
|
-
│ ├── bun/
|
|
64
|
-
│ ├── go/
|
|
65
|
-
│ ├── java/
|
|
66
|
-
│ ├── rust/
|
|
67
|
-
│ ├── powershell/
|
|
68
|
-
│ ├── postgres/ # Database/messaging overlays
|
|
69
|
-
│ ├── redis/
|
|
70
|
-
│ ├── mongodb/
|
|
71
|
-
│ ├── mysql/
|
|
72
|
-
│ ├── sqlite/
|
|
73
|
-
│ ├── sqlserver/
|
|
74
|
-
│ ├── minio/
|
|
75
|
-
│ ├── rabbitmq/
|
|
76
|
-
│ ├── redpanda/
|
|
77
|
-
│ ├── nats/
|
|
78
|
-
│ ├── otel-collector/ # Observability overlays
|
|
79
|
-
│ ├── jaeger/
|
|
80
|
-
│ ├── prometheus/
|
|
81
|
-
│ ├── grafana/
|
|
82
|
-
│ ├── loki/
|
|
83
|
-
│ ├── tempo/
|
|
84
|
-
│ ├── alertmanager/
|
|
85
|
-
│ ├── promtail/
|
|
86
|
-
│ ├── otel-demo-nodejs/
|
|
87
|
-
│ ├── otel-demo-python/
|
|
88
|
-
│ ├── aws-cli/ # Cloud tool overlays
|
|
89
|
-
│ ├── azure-cli/
|
|
90
|
-
│ ├── gcloud/
|
|
91
|
-
│ ├── kubectl-helm/
|
|
92
|
-
│ ├── terraform/
|
|
93
|
-
│ ├── pulumi/
|
|
94
|
-
│ ├── docker-in-docker/ # Dev tool overlays
|
|
95
|
-
│ ├── docker-sock/
|
|
96
|
-
│ ├── playwright/
|
|
97
|
-
│ ├── codex/
|
|
98
|
-
│ ├── git-helpers/
|
|
99
|
-
│ ├── pre-commit/
|
|
100
|
-
│ ├── commitlint/
|
|
101
|
-
│ ├── just/
|
|
102
|
-
│ ├── direnv/
|
|
103
|
-
│ ├── modern-cli-tools/
|
|
104
|
-
│ └── ngrok/
|
|
105
|
-
├── features/ # Custom devcontainer features
|
|
106
|
-
├── tool/ # Composition logic and schema
|
|
107
|
-
│ ├── questionnaire/ # Composition engine
|
|
108
|
-
│ └── schema/ # TypeScript types and JSON schema
|
|
109
|
-
├── docs/ # Complete documentation
|
|
110
|
-
│ ├── presets.md # Stack presets guide
|
|
111
|
-
│ └── ...
|
|
112
|
-
└── scripts/ # CLI entry points
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
### `/templates` - Minimal Base Templates
|
|
116
|
-
|
|
117
|
-
Two foundational templates that serve as starting points:
|
|
118
|
-
|
|
119
|
-
- **plain** - Simple image-based devcontainer with essential tools
|
|
120
|
-
- **compose** - Docker Compose-based for multi-service environments
|
|
121
|
-
|
|
122
|
-
Each template is minimal by design. Capabilities are added via overlays.
|
|
123
|
-
|
|
124
|
-
### `/overlays` - Composable Capabilities
|
|
125
|
-
|
|
126
|
-
Overlays are modular configuration fragments organized by category:
|
|
127
|
-
|
|
128
|
-
**Language & Framework:**
|
|
129
|
-
|
|
130
|
-
- **dotnet** - .NET SDK with C# development tools
|
|
131
|
-
- **nodejs** - Node.js LTS with npm and TypeScript support
|
|
132
|
-
- **python** - Python with pip and common data science tools
|
|
133
|
-
- **mkdocs** - MkDocs for documentation sites
|
|
134
|
-
- **bun** - Bun JavaScript runtime and toolkit
|
|
135
|
-
- **go** - Go programming language
|
|
136
|
-
- **java** - Java Development Kit
|
|
137
|
-
- **rust** - Rust programming language
|
|
138
|
-
- **powershell** - PowerShell Core
|
|
139
|
-
|
|
140
|
-
**Databases & Message Brokers:**
|
|
141
|
-
|
|
142
|
-
- **postgres** - PostgreSQL relational database
|
|
143
|
-
- **redis** - Redis in-memory data store
|
|
144
|
-
- **mongodb** - MongoDB document database
|
|
145
|
-
- **mysql** - MySQL relational database
|
|
146
|
-
- **sqlite** - SQLite embedded database
|
|
147
|
-
- **sqlserver** - Microsoft SQL Server
|
|
148
|
-
- **minio** - MinIO S3-compatible object storage
|
|
149
|
-
- **rabbitmq** - RabbitMQ message broker (AMQP)
|
|
150
|
-
- **redpanda** - Redpanda Kafka-compatible streaming
|
|
151
|
-
- **nats** - NATS messaging system
|
|
152
|
-
|
|
153
|
-
**Observability:**
|
|
154
|
-
|
|
155
|
-
- **otel-collector** - OpenTelemetry Collector (telemetry pipeline)
|
|
156
|
-
- **jaeger** - Jaeger distributed tracing
|
|
157
|
-
- **prometheus** - Prometheus metrics collection
|
|
158
|
-
- **grafana** - Grafana visualization and dashboards
|
|
159
|
-
- **loki** - Loki log aggregation
|
|
160
|
-
- **tempo** - Tempo distributed tracing backend
|
|
161
|
-
- **alertmanager** - Prometheus Alertmanager
|
|
162
|
-
- **promtail** - Promtail log collector for Loki
|
|
163
|
-
- **otel-demo-nodejs** - OpenTelemetry demo app (Node.js)
|
|
164
|
-
- **otel-demo-python** - OpenTelemetry demo app (Python)
|
|
165
|
-
|
|
166
|
-
**Cloud Tools:**
|
|
167
|
-
|
|
168
|
-
- **aws-cli** - AWS Command Line Interface
|
|
169
|
-
- **azure-cli** - Azure Command Line Interface
|
|
170
|
-
- **gcloud** - Google Cloud SDK
|
|
171
|
-
- **kubectl-helm** - Kubernetes CLI and Helm package manager
|
|
172
|
-
- **terraform** - Terraform infrastructure as code
|
|
173
|
-
- **pulumi** - Pulumi infrastructure as code
|
|
174
|
-
|
|
175
|
-
**Dev Tools:**
|
|
176
|
-
|
|
177
|
-
- **docker-in-docker** - Docker daemon in container
|
|
178
|
-
- **docker-sock** - Access to host Docker daemon
|
|
179
|
-
- **playwright** - Playwright browser automation
|
|
180
|
-
- **codex** - Codex AI coding assistant
|
|
181
|
-
- **git-helpers** - Git with LFS, GPG, GitHub CLI
|
|
182
|
-
- **pre-commit** - Pre-commit hook framework
|
|
183
|
-
- **commitlint** - Commit message linting
|
|
184
|
-
- **just** - Just command runner
|
|
185
|
-
- **direnv** - Directory-based environment variables
|
|
186
|
-
- **modern-cli-tools** - Modern alternatives (ripgrep, fd, bat, jq, yq)
|
|
187
|
-
- **ngrok** - Ngrok secure tunnels
|
|
188
|
-
|
|
189
|
-
Each overlay includes:
|
|
190
|
-
|
|
191
|
-
- `devcontainer.patch.json` - Configuration to merge
|
|
192
|
-
- `docker-compose.yml` (if needed) - Service definitions
|
|
193
|
-
- `.env.example` - Environment variables
|
|
194
|
-
- Configuration files (e.g., `otel-collector-config.yaml`)
|
|
195
|
-
- README with usage instructions
|
|
196
|
-
|
|
197
|
-
### `/features` - Custom Building Blocks
|
|
198
|
-
|
|
199
|
-
Custom devcontainer features that add value beyond containers.dev:
|
|
200
|
-
|
|
201
|
-
- **cross-distro-packages** - Cross-distribution package manager with automatic distro detection (apt/apk)
|
|
202
|
-
- **project-scaffolder** - Interactive project initialization
|
|
203
|
-
- **team-conventions** - Shared linting, formatting, commit standards
|
|
204
|
-
- **local-secrets-manager** - Safe local development secrets
|
|
205
|
-
|
|
206
|
-
## 🚀 Quick Start
|
|
207
|
-
|
|
208
|
-
### Via npx (Recommended)
|
|
209
|
-
|
|
210
|
-
No installation required! Use npx to run the tool directly:
|
|
211
|
-
|
|
212
|
-
```bash
|
|
213
|
-
# Interactive mode - guided questionnaire
|
|
214
|
-
npx container-superposition init
|
|
215
|
-
|
|
216
|
-
# With CLI flags - skip to your stack
|
|
217
|
-
npx container-superposition init --stack compose --language nodejs --database postgres
|
|
218
|
-
|
|
219
|
-
# List all available overlays
|
|
220
|
-
npx container-superposition list
|
|
221
|
-
|
|
222
|
-
# Check your environment
|
|
223
|
-
npx container-superposition doctor
|
|
224
|
-
```
|
|
225
|
-
|
|
226
|
-
### Global Installation (Optional)
|
|
227
|
-
|
|
228
|
-
Install globally for faster repeated use:
|
|
229
|
-
|
|
230
|
-
```bash
|
|
231
|
-
# Install globally
|
|
232
|
-
npm install -g container-superposition
|
|
233
|
-
|
|
234
|
-
# Now use without npx
|
|
235
|
-
container-superposition init
|
|
236
|
-
container-superposition list
|
|
237
|
-
container-superposition doctor
|
|
238
|
-
```
|
|
239
|
-
|
|
240
|
-
### From Source (Development)
|
|
241
|
-
|
|
242
|
-
For contributors or those who want to modify the tool:
|
|
243
|
-
|
|
244
|
-
```bash
|
|
245
|
-
# Clone the repository
|
|
246
|
-
git clone https://github.com/veggerby/container-superposition.git
|
|
247
|
-
cd container-superposition
|
|
248
|
-
|
|
249
|
-
# Install dependencies
|
|
250
|
-
npm install
|
|
251
|
-
|
|
252
|
-
# Run the interactive setup
|
|
253
|
-
npm run init
|
|
254
|
-
```
|
|
255
|
-
|
|
256
|
-
### Available Commands
|
|
257
|
-
|
|
258
|
-
- **`init`** - Initialize a new devcontainer configuration (default command)
|
|
259
|
-
- **`regen`** - Regenerate devcontainer from existing manifest
|
|
260
|
-
- **`list`** - List all available overlays and presets with filtering options
|
|
261
|
-
- **`explain`** - Show detailed information about a specific overlay
|
|
262
|
-
- **`plan`** - Preview what will be generated before creating devcontainer
|
|
263
|
-
- **`doctor`** - Check environment and validate configuration
|
|
264
|
-
|
|
265
|
-
#### Discovery Commands
|
|
266
|
-
|
|
267
|
-
**List available overlays:**
|
|
268
|
-
|
|
269
|
-
```bash
|
|
270
|
-
# List all overlays grouped by category
|
|
271
|
-
npx container-superposition list
|
|
272
|
-
|
|
273
|
-
# Filter by category
|
|
274
|
-
npx container-superposition list --category database
|
|
275
|
-
|
|
276
|
-
# Filter by tags
|
|
277
|
-
npx container-superposition list --tags observability
|
|
278
|
-
|
|
279
|
-
# Filter by stack support
|
|
280
|
-
npx container-superposition list --supports compose
|
|
281
|
-
|
|
282
|
-
# JSON output for scripting
|
|
283
|
-
npx container-superposition list --json
|
|
284
|
-
```
|
|
285
|
-
|
|
286
|
-
**Explain an overlay in detail:**
|
|
287
|
-
|
|
288
|
-
```bash
|
|
289
|
-
# Show detailed information about an overlay
|
|
290
|
-
npx container-superposition explain postgres
|
|
291
|
-
|
|
292
|
-
# JSON output
|
|
293
|
-
npx container-superposition explain nodejs --json
|
|
294
|
-
```
|
|
295
|
-
|
|
296
|
-
**Plan before generating:**
|
|
297
|
-
|
|
298
|
-
```bash
|
|
299
|
-
# Preview what will be created
|
|
300
|
-
npx container-superposition plan --stack compose --overlays postgres,grafana
|
|
301
|
-
|
|
302
|
-
# Include port offset
|
|
303
|
-
npx container-superposition plan --stack compose --overlays postgres,redis --port-offset 100
|
|
304
|
-
|
|
305
|
-
# JSON output
|
|
306
|
-
npx container-superposition plan --stack compose --overlays nodejs,postgres --json
|
|
307
|
-
```
|
|
308
|
-
|
|
309
|
-
The `plan` command shows:
|
|
310
|
-
|
|
311
|
-
- Selected overlays and auto-added dependencies
|
|
312
|
-
- Port mappings (with offset applied)
|
|
313
|
-
- Files that will be created/modified
|
|
314
|
-
- Conflict detection
|
|
315
|
-
|
|
316
|
-
#### Environment Validation
|
|
317
|
-
|
|
318
|
-
The `doctor` command provides comprehensive environment diagnostics:
|
|
319
|
-
|
|
320
|
-
```bash
|
|
321
|
-
# Check environment and configuration
|
|
322
|
-
npx container-superposition doctor
|
|
323
|
-
|
|
324
|
-
# Check specific devcontainer
|
|
325
|
-
npx container-superposition doctor --output /path/to/.devcontainer
|
|
326
|
-
|
|
327
|
-
# Get JSON output for CI/CD
|
|
328
|
-
npx container-superposition doctor --json
|
|
329
|
-
|
|
330
|
-
# Apply automatic fixes (where possible)
|
|
331
|
-
npx container-superposition doctor --fix
|
|
332
|
-
```
|
|
333
|
-
|
|
334
|
-
**Doctor checks:**
|
|
335
|
-
|
|
336
|
-
- ✅ Node.js version compatibility (>= 18)
|
|
337
|
-
- ✅ Docker daemon connectivity
|
|
338
|
-
- ✅ Docker Compose v2 availability (when using compose stack)
|
|
339
|
-
- ✅ Overlay integrity (valid manifests, required files)
|
|
340
|
-
- ✅ Manifest compatibility
|
|
341
|
-
- ⚠️ Port conflicts (best-effort detection)
|
|
342
|
-
|
|
343
|
-
**Example output:**
|
|
344
|
-
|
|
345
|
-
```
|
|
346
|
-
🔍 Running diagnostics...
|
|
347
|
-
|
|
348
|
-
Environment:
|
|
349
|
-
✓ Node.js version: v20.10.0 (>= 18.0.0 required)
|
|
350
|
-
✓ Docker daemon: Docker version 24.0.5
|
|
351
|
-
✓ Docker Compose: v2.23.0 (v2 required)
|
|
352
|
-
|
|
353
|
-
Overlays:
|
|
354
|
-
✓ All 46 overlays valid
|
|
355
|
-
|
|
356
|
-
Manifest:
|
|
357
|
-
✓ Manifest version: Format version 0.1.0
|
|
358
|
-
✓ DevContainer config: devcontainer.json valid
|
|
359
|
-
|
|
360
|
-
Summary:
|
|
361
|
-
✓ 51 passed
|
|
362
|
-
```
|
|
363
|
-
|
|
364
|
-
The questionnaire guides you through:
|
|
365
|
-
|
|
366
|
-
1. **Preset or Custom** - Start from a pre-configured stack or build custom?
|
|
367
|
-
2. **Base template** - plain or compose?
|
|
368
|
-
3. **Overlays** - All available overlays in one multi-select (language, databases, observability, cloud tools, dev tools)
|
|
369
|
-
4. **Output path** - Where to generate the configuration
|
|
370
|
-
|
|
371
|
-
#### Stack Presets (NEW!)
|
|
372
|
-
|
|
373
|
-
Quickly get started with common development scenarios:
|
|
374
|
-
|
|
375
|
-
**🌐 Web API Stack**
|
|
376
|
-
|
|
377
|
-
- Language choice (Node.js, .NET, Python, Go, Java)
|
|
378
|
-
- PostgreSQL + Redis
|
|
379
|
-
- Full observability (OTEL, Prometheus, Grafana, Loki)
|
|
380
|
-
- Pre-configured connection strings
|
|
381
|
-
|
|
382
|
-
**🔀 Microservice Stack**
|
|
383
|
-
|
|
384
|
-
- Language choice
|
|
385
|
-
- Message broker (RabbitMQ, Redpanda, NATS)
|
|
386
|
-
- Distributed tracing (Jaeger)
|
|
387
|
-
- Metrics & monitoring (Prometheus, Grafana)
|
|
388
|
-
|
|
389
|
-
**📚 Documentation Site**
|
|
390
|
-
|
|
391
|
-
- MkDocs + Python
|
|
392
|
-
- Pre-commit hooks
|
|
393
|
-
- Modern CLI tools
|
|
394
|
-
- GitHub Pages ready
|
|
395
|
-
|
|
396
|
-
**🎨 Full-Stack Application**
|
|
397
|
-
|
|
398
|
-
- Node.js frontend + Backend language choice
|
|
399
|
-
- PostgreSQL + Redis + MinIO
|
|
400
|
-
- Complete observability stack
|
|
401
|
-
|
|
402
|
-
See [docs/presets.md](docs/presets.md) for detailed preset documentation.
|
|
403
|
-
|
|
404
|
-
**Example compositions:**
|
|
15
|
+
## Quickstart
|
|
405
16
|
|
|
406
17
|
```bash
|
|
407
|
-
#
|
|
18
|
+
# Guided questionnaire
|
|
408
19
|
npx container-superposition init
|
|
409
|
-
# Select "Web API Stack" → Choose Node.js → Done!
|
|
410
|
-
|
|
411
|
-
# Node.js API with PostgreSQL and observability
|
|
412
|
-
npx container-superposition init --stack compose --language nodejs --database postgres --observability otel-collector,jaeger,prometheus,grafana
|
|
413
|
-
|
|
414
|
-
# .NET microservice with full observability stack
|
|
415
|
-
npx container-superposition init --stack compose --language dotnet --database postgres,redis --observability otel-collector,jaeger,prometheus,grafana,loki --cloud-tools aws-cli,kubectl-helm
|
|
416
|
-
|
|
417
|
-
# Go microservice with RabbitMQ messaging
|
|
418
|
-
npx container-superposition init --stack compose --language go --database rabbitmq,redis --observability jaeger,prometheus
|
|
419
|
-
|
|
420
|
-
# Rust development environment with modern CLI tools
|
|
421
|
-
npx container-superposition init --stack plain --language rust --dev-tools modern-cli-tools,git-helpers,pre-commit
|
|
422
|
-
|
|
423
|
-
# Java Spring Boot with MySQL
|
|
424
|
-
npx container-superposition init --stack compose --language java --database mysql,redis --cloud-tools kubectl-helm
|
|
425
20
|
|
|
426
|
-
#
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
# Documentation site with MkDocs
|
|
442
|
-
npx container-superposition init --stack plain --language mkdocs --dev-tools pre-commit,modern-cli-tools
|
|
443
|
-
|
|
444
|
-
# PowerShell scripting environment
|
|
445
|
-
npx container-superposition init --stack plain --language powershell --cloud-tools aws-cli,azure-cli
|
|
446
|
-
```
|
|
447
|
-
|
|
448
|
-
**Port Offset for Multiple Instances:**
|
|
449
|
-
|
|
450
|
-
If you're running multiple devcontainer instances simultaneously (e.g., multiple microservices), use `--port-offset` to avoid port conflicts:
|
|
451
|
-
|
|
452
|
-
```bash
|
|
453
|
-
# Service 1 (default ports)
|
|
454
|
-
npm run init -- --stack compose --language nodejs --postgres --output ./service1
|
|
455
|
-
|
|
456
|
-
# Service 2 (ports shifted by 100)
|
|
457
|
-
npm run init -- --stack compose --language nodejs --postgres --port-offset 100 --output ./service2
|
|
458
|
-
|
|
459
|
-
# Service 3 (ports shifted by 200)
|
|
460
|
-
npm run init -- --stack compose --language nodejs --postgres --port-offset 200 --output ./service3
|
|
461
|
-
```
|
|
462
|
-
|
|
463
|
-
This automatically adjusts all exposed ports in docker-compose.yml and documents the offset in .env.example.
|
|
464
|
-
|
|
465
|
-
### Deployment Target Support
|
|
466
|
-
|
|
467
|
-
Container Superposition validates overlay compatibility with different deployment environments (local, Codespaces, Gitpod, DevPod) using the `--target` flag.
|
|
468
|
-
|
|
469
|
-
```bash
|
|
470
|
-
# Specify deployment target
|
|
471
|
-
npx container-superposition init --target codespaces
|
|
472
|
-
npx container-superposition init --target gitpod
|
|
473
|
-
npx container-superposition init --target local # default
|
|
474
|
-
```
|
|
475
|
-
|
|
476
|
-
The tool automatically validates overlay compatibility and warns you when selecting overlays that won't work in your target environment (e.g., `docker-sock` doesn't work in Codespaces).
|
|
477
|
-
|
|
478
|
-
**📖 See [Deployment Targets Documentation](docs/deployment-targets.md) for:**
|
|
479
|
-
|
|
480
|
-
- Complete target comparison table
|
|
481
|
-
- Interactive mode examples
|
|
482
|
-
- Environment-specific configuration
|
|
483
|
-
- Compatibility rules and best practices
|
|
484
|
-
|
|
485
|
-
### Regenerating from Manifest
|
|
486
|
-
|
|
487
|
-
Every devcontainer generation creates a `superposition.json` manifest file that records your configuration choices. You can use this manifest to:
|
|
488
|
-
|
|
489
|
-
- **Iterate on your setup** - Modify overlay selections and regenerate
|
|
490
|
-
- **Update to latest** - Regenerate with newer overlay versions
|
|
491
|
-
- **Experiment safely** - Try different configurations with automatic backup
|
|
492
|
-
- **Share configurations** - Commit the manifest for team consistency
|
|
493
|
-
|
|
494
|
-
**Quick regeneration (recommended):**
|
|
495
|
-
|
|
496
|
-
```bash
|
|
497
|
-
# Simple regen command - automatically finds manifest in .devcontainer/
|
|
21
|
+
# Declarative project config committed in the repo
|
|
22
|
+
cat > .superposition.yml <<'YAML'
|
|
23
|
+
stack: compose
|
|
24
|
+
language:
|
|
25
|
+
- nodejs
|
|
26
|
+
database:
|
|
27
|
+
- postgres
|
|
28
|
+
customizations:
|
|
29
|
+
environment:
|
|
30
|
+
APP_ENV: development
|
|
31
|
+
YAML
|
|
32
|
+
npx container-superposition init --no-interactive
|
|
33
|
+
|
|
34
|
+
# Regenerate from the repository project file
|
|
498
35
|
npx container-superposition regen
|
|
499
36
|
|
|
500
|
-
#
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
**Interactive regeneration with changes:**
|
|
504
|
-
|
|
505
|
-
```bash
|
|
506
|
-
# Loads manifest, creates backup, shows questionnaire with pre-selected options
|
|
507
|
-
npx container-superposition init --from-manifest ./.devcontainer/superposition.json
|
|
508
|
-
|
|
509
|
-
# Or from a different location (regenerates in the manifest's directory)
|
|
510
|
-
npx container-superposition init --from-manifest /path/to/project/.devcontainer/superposition.json
|
|
511
|
-
```
|
|
512
|
-
|
|
513
|
-
> **Note:** When using `--from-manifest`, the devcontainer is generated relative to the manifest file's location, not your current working directory. This means you can run the command from anywhere and the output will go to the correct project directory.
|
|
514
|
-
|
|
515
|
-
**Non-interactive regeneration (CI/CD):**
|
|
516
|
-
|
|
517
|
-
```bash
|
|
518
|
-
# Truly non-interactive: use manifest values directly without questionnaire
|
|
519
|
-
npx container-superposition init --from-manifest ./.devcontainer/superposition.json --no-interactive --no-backup
|
|
520
|
-
```
|
|
521
|
-
|
|
522
|
-
> **Note:** The `--no-interactive` option skips the questionnaire entirely and uses all values from the manifest. This is perfect for CI/CD pipelines or when you want to ensure exact reproducibility.
|
|
523
|
-
|
|
524
|
-
**Workflow examples:**
|
|
37
|
+
# Or select the project file explicitly
|
|
38
|
+
npx container-superposition regen --from-project
|
|
525
39
|
|
|
526
|
-
|
|
527
|
-
# 1. Initial setup
|
|
40
|
+
# Non-interactive example
|
|
528
41
|
npx container-superposition init --stack compose --language nodejs --database postgres
|
|
529
|
-
# Creates .devcontainer/ and superposition.json
|
|
530
|
-
|
|
531
|
-
# 2. Later: Add Redis and observability (interactive)
|
|
532
|
-
npx container-superposition init --from-manifest ./.devcontainer/superposition.json
|
|
533
|
-
# Questionnaire shows with nodejs and postgres pre-selected
|
|
534
|
-
# Add redis, otel-collector, grafana
|
|
535
|
-
# Original .devcontainer/ backed up automatically
|
|
536
|
-
|
|
537
|
-
# 3. Update to latest overlay versions (simple regen)
|
|
538
|
-
npx container-superposition regen
|
|
539
|
-
# Uses exact manifest values, creates backup
|
|
540
|
-
# Perfect for pulling latest overlay updates
|
|
541
|
-
|
|
542
|
-
# 4. Switch languages (e.g., Node.js → Python)
|
|
543
|
-
npx container-superposition init --from-manifest ./.devcontainer/superposition.json
|
|
544
|
-
# Change nodejs to python in questionnaire
|
|
545
|
-
# Regenerate with new language
|
|
546
|
-
```
|
|
547
|
-
|
|
548
|
-
**Backup behavior:**
|
|
549
|
-
|
|
550
|
-
- **Default**: Creates timestamped backup next to the devcontainer directory (e.g., `.devcontainer.backup-2026-02-08-143022/`)
|
|
551
|
-
- **`--no-backup`**: Skip backup (destructive, use with caution)
|
|
552
|
-
- **`--backup-dir <path>`**: Custom backup location
|
|
553
|
-
- **Automatic .gitignore**: Backup patterns added to project root `.gitignore`
|
|
554
|
-
|
|
555
|
-
**What's preserved from manifest:**
|
|
556
|
-
|
|
557
|
-
- Base template (plain/compose)
|
|
558
|
-
- Preset selection (if used)
|
|
559
|
-
- All overlay selections
|
|
560
|
-
- Port offset
|
|
561
|
-
- Output path
|
|
562
|
-
- Container name
|
|
563
|
-
|
|
564
|
-
See [tool/README.md](tool/README.md) for full documentation.
|
|
565
|
-
|
|
566
|
-
### Preserving Project-Specific Customizations
|
|
567
|
-
|
|
568
|
-
**Problem**: When you regenerate a devcontainer (to add overlays or update), manual customizations are lost.
|
|
569
|
-
|
|
570
|
-
**Solution**: Use the `.devcontainer/custom/` directory for customizations that persist across regenerations.
|
|
571
|
-
|
|
572
|
-
**Quick example:**
|
|
573
|
-
|
|
574
|
-
```bash
|
|
575
|
-
# 1. Generate initial devcontainer
|
|
576
|
-
npm run init -- --stack compose --language nodejs --database postgres
|
|
577
|
-
|
|
578
|
-
# 2. Add custom patches
|
|
579
|
-
mkdir -p .devcontainer/custom
|
|
580
|
-
|
|
581
|
-
# Add custom mounts, extensions, etc.
|
|
582
|
-
cat > .devcontainer/custom/devcontainer.patch.json << 'EOF'
|
|
583
|
-
{
|
|
584
|
-
"mounts": [
|
|
585
|
-
"source=${localWorkspaceFolder}/../shared-libs,target=/workspace/shared,type=bind"
|
|
586
|
-
],
|
|
587
|
-
"customizations": {
|
|
588
|
-
"vscode": {
|
|
589
|
-
"extensions": ["eamodio.gitlens"]
|
|
590
|
-
}
|
|
591
|
-
}
|
|
592
|
-
}
|
|
593
|
-
EOF
|
|
594
|
-
|
|
595
|
-
# 3. Regenerate (e.g., to add Redis)
|
|
596
|
-
npm run init -- --from-manifest .devcontainer/superposition.json
|
|
597
|
-
# Select redis in addition to existing overlays
|
|
598
|
-
|
|
599
|
-
# 4. Your custom patches are automatically preserved and merged! ✅
|
|
600
|
-
```
|
|
601
|
-
|
|
602
|
-
**Supported customization files:**
|
|
603
|
-
|
|
604
|
-
- `devcontainer.patch.json` - Merges into devcontainer.json
|
|
605
|
-
- `docker-compose.patch.yml` - Merges into docker-compose.yml
|
|
606
|
-
- `environment.env` - Additional environment variables
|
|
607
|
-
- `scripts/post-create.sh` - Custom one-time setup script
|
|
608
|
-
- `scripts/post-start.sh` - Custom startup script
|
|
609
|
-
- `files/` - Additional files to copy
|
|
610
|
-
|
|
611
|
-
See **[Custom Patches Guide](docs/custom-patches.md)** for complete documentation and examples.
|
|
612
|
-
|
|
613
|
-
### Team Collaboration Workflow
|
|
614
|
-
|
|
615
|
-
**Use Case:** Standardize dev environments across a team while allowing personal customizations.
|
|
616
|
-
|
|
617
|
-
Container Superposition supports a **manifest-first workflow** where:
|
|
618
|
-
|
|
619
|
-
- **Manifest** (`superposition.json`) is committed to version control
|
|
620
|
-
- **.devcontainer/** is generated locally and gitignored
|
|
621
|
-
- **Custom patches** (`.devcontainer/custom/`) can be committed for shared customizations
|
|
622
|
-
|
|
623
|
-
#### Quick Setup
|
|
624
|
-
|
|
625
|
-
**1. Team lead creates the manifest:**
|
|
626
|
-
|
|
627
|
-
```bash
|
|
628
|
-
# Generate manifest only (no .devcontainer/ files)
|
|
629
|
-
npx container-superposition init --write-manifest-only \
|
|
630
|
-
--stack compose \
|
|
631
|
-
--language nodejs \
|
|
632
|
-
--database postgres,redis
|
|
633
|
-
|
|
634
|
-
# Commit to repo
|
|
635
|
-
git add superposition.json .gitignore
|
|
636
|
-
git commit -m "Add team devcontainer manifest"
|
|
637
|
-
```
|
|
638
|
-
|
|
639
|
-
**2. Add to `.gitignore`:**
|
|
640
|
-
|
|
641
|
-
```gitignore
|
|
642
|
-
# DevContainer - generated locally
|
|
643
|
-
.devcontainer/
|
|
644
|
-
|
|
645
|
-
# Except custom directory (personal/shared customizations)
|
|
646
|
-
!.devcontainer/custom/
|
|
647
|
-
```
|
|
648
|
-
|
|
649
|
-
**3. Team members clone and generate:**
|
|
650
|
-
|
|
651
|
-
```bash
|
|
652
|
-
git clone <repo>
|
|
653
|
-
cd <repo>
|
|
654
|
-
|
|
655
|
-
# Generate .devcontainer/ from manifest
|
|
656
|
-
npx container-superposition regen
|
|
657
|
-
|
|
658
|
-
# Open in VS Code and rebuild container
|
|
659
|
-
code .
|
|
660
|
-
```
|
|
661
|
-
|
|
662
|
-
**4. Personal customizations (optional):**
|
|
663
|
-
|
|
664
|
-
```bash
|
|
665
|
-
# Add personal VS Code extensions, themes, etc.
|
|
666
|
-
mkdir -p .devcontainer/custom
|
|
667
|
-
cat > .devcontainer/custom/devcontainer.patch.json << 'EOF'
|
|
668
|
-
{
|
|
669
|
-
"customizations": {
|
|
670
|
-
"vscode": {
|
|
671
|
-
"extensions": ["eamodio.gitlens"],
|
|
672
|
-
"settings": {
|
|
673
|
-
"editor.fontSize": 14
|
|
674
|
-
}
|
|
675
|
-
}
|
|
676
|
-
}
|
|
677
|
-
}
|
|
678
|
-
EOF
|
|
679
|
-
|
|
680
|
-
# Regenerate to apply
|
|
681
|
-
npx container-superposition regen
|
|
682
|
-
```
|
|
683
|
-
|
|
684
|
-
**Benefits:**
|
|
685
|
-
|
|
686
|
-
- ✅ One command onboarding for new developers
|
|
687
|
-
- ✅ No lock-in - generated files are plain JSON/YAML
|
|
688
|
-
- ✅ Personal customizations don't conflict with team standard
|
|
689
|
-
- ✅ CI can validate manifest without committing generated files
|
|
690
|
-
|
|
691
|
-
See **[Team Workflow Guide](docs/team-workflow.md)** for complete documentation, CI examples, and troubleshooting.
|
|
692
|
-
|
|
693
|
-
### Option 2: Manual Composition
|
|
694
|
-
|
|
695
|
-
1. **Copy a base template:**
|
|
696
|
-
|
|
697
|
-
```bash
|
|
698
|
-
cp -r templates/compose/.devcontainer /path/to/your/project/
|
|
699
|
-
```
|
|
700
|
-
|
|
701
|
-
2. **Add overlay configurations:**
|
|
702
|
-
|
|
703
|
-
```bash
|
|
704
|
-
# Merge devcontainer.patch.json files
|
|
705
|
-
# Copy docker-compose.yml files as docker-compose.{overlay}.yml
|
|
706
|
-
# Merge .env.example files
|
|
707
|
-
```
|
|
708
|
-
|
|
709
|
-
3. **Open in VS Code** and reopen in container
|
|
710
|
-
|
|
711
|
-
## 🔧 Architecture
|
|
712
|
-
|
|
713
|
-
- **Questionnaire**: 5–8 questions to understand your needs
|
|
714
|
-
- **Composition**: Merges base templates with lightweight overlays
|
|
715
|
-
- **Output**: Plain `.devcontainer/` folder — fully editable, no lock-in
|
|
716
|
-
- **Overlays**: Add-ons for databases (Postgres, Redis), Playwright, cloud tools, etc.
|
|
717
|
-
|
|
718
|
-
**Key Design Decisions:**
|
|
719
|
-
|
|
720
|
-
- ✅ Generate once, edit forever (no "sync" or "update")
|
|
721
|
-
- ✅ Output is standard JSON — no proprietary formats
|
|
722
|
-
- ✅ Tool is optional — templates work standalone
|
|
723
|
-
- ✅ Cross-platform via Node.js/TypeScript
|
|
724
|
-
- ✅ Metadata-driven overlays (no hardcoded menus)
|
|
725
|
-
|
|
726
|
-
### Metadata-Driven Overlays
|
|
727
|
-
|
|
728
|
-
All overlays are defined in [overlays/index.yml](overlays/index.yml):
|
|
729
|
-
|
|
730
|
-
```yaml
|
|
731
|
-
observability_overlays:
|
|
732
|
-
- id: otel-collector
|
|
733
|
-
name: OpenTelemetry Collector
|
|
734
|
-
description: Telemetry collection pipeline
|
|
735
|
-
category: observability
|
|
736
|
-
order: 2 # Start after backends
|
|
737
|
-
```
|
|
738
|
-
|
|
739
|
-
**Benefits:**
|
|
740
|
-
|
|
741
|
-
- Add new overlays without code changes
|
|
742
|
-
- Consistent naming and descriptions
|
|
743
|
-
- Control display order and categorization
|
|
744
|
-
- Easy maintenance and documentation
|
|
745
|
-
|
|
746
|
-
**Overlay Categories:**
|
|
747
|
-
|
|
748
|
-
- `base_templates` - plain, compose
|
|
749
|
-
- `base_images` - bookworm, trixie, alpine, ubuntu, custom
|
|
750
|
-
- `language_overlays` - dotnet, nodejs, python, mkdocs, bun, go, java, rust, powershell
|
|
751
|
-
- `database_overlays` - postgres, redis, mongodb, mysql, sqlite, sqlserver, minio, rabbitmq, redpanda, nats
|
|
752
|
-
- `observability_overlays` - otel-collector, jaeger, prometheus, grafana, loki, tempo, alertmanager, promtail, otel-demo-nodejs, otel-demo-python
|
|
753
|
-
- `cloud_tool_overlays` - aws-cli, azure-cli, gcloud, kubectl-helm, terraform, pulumi
|
|
754
|
-
- `dev_tool_overlays` - docker-in-docker, docker-sock, playwright, codex, git-helpers, pre-commit, commitlint, just, direnv, modern-cli-tools, ngrok
|
|
755
|
-
|
|
756
|
-
See [tool/docs/questionnaire-updates.md](tool/docs/questionnaire-updates.md) for details.
|
|
757
|
-
|
|
758
|
-
### Dependency Management & Auto-Resolution
|
|
759
|
-
|
|
760
|
-
Container Superposition includes an intelligent dependency model that automatically resolves required dependencies:
|
|
761
42
|
|
|
762
|
-
|
|
43
|
+
# Preview before writing files
|
|
44
|
+
npx container-superposition plan --stack compose --overlays nodejs,postgres,grafana
|
|
763
45
|
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
- **`conflicts`** - Mutually exclusive overlays
|
|
46
|
+
# Explain why dependencies were included
|
|
47
|
+
npx container-superposition plan --stack compose --overlays grafana --verbose
|
|
767
48
|
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
```bash
|
|
771
|
-
# Select grafana, and prometheus is automatically added
|
|
772
|
-
npm run init -- --stack compose --observability grafana
|
|
773
|
-
|
|
774
|
-
# Output includes both:
|
|
775
|
-
# ✅ grafana
|
|
776
|
-
# ✅ prometheus (auto-resolved, required by grafana)
|
|
777
|
-
```
|
|
778
|
-
|
|
779
|
-
**Explicit Metadata in overlays/index.yml:**
|
|
780
|
-
|
|
781
|
-
```yaml
|
|
782
|
-
observability_overlays:
|
|
783
|
-
- id: grafana
|
|
784
|
-
name: Grafana
|
|
785
|
-
requires: [prometheus] # Auto-add prometheus
|
|
786
|
-
suggests: [loki, jaeger] # Could work well together
|
|
787
|
-
conflicts: []
|
|
788
|
-
tags: [observability, ui]
|
|
789
|
-
ports: [3000] # Explicit port declarations
|
|
790
|
-
```
|
|
791
|
-
|
|
792
|
-
**Benefits:**
|
|
793
|
-
|
|
794
|
-
- ✅ Predictable behavior - no hidden "if overlay == ..." logic
|
|
795
|
-
- ✅ Automatic dependency resolution
|
|
796
|
-
- ✅ Clear conflict detection
|
|
797
|
-
- ✅ Port-offset becomes data-driven
|
|
798
|
-
|
|
799
|
-
**Superposition Manifest:**
|
|
800
|
-
|
|
801
|
-
Every generated configuration includes a `superposition.json` manifest for debugging:
|
|
802
|
-
|
|
803
|
-
```json
|
|
804
|
-
{
|
|
805
|
-
"version": "0.1.0",
|
|
806
|
-
"generated": "2026-02-04T10:30:00Z",
|
|
807
|
-
"baseTemplate": "compose",
|
|
808
|
-
"baseImage": "bookworm",
|
|
809
|
-
"overlays": ["dotnet", "postgres", "prometheus", "grafana"],
|
|
810
|
-
"portOffset": 100,
|
|
811
|
-
"autoResolved": {
|
|
812
|
-
"added": ["prometheus"],
|
|
813
|
-
"reason": "prometheus (required by grafana)"
|
|
814
|
-
}
|
|
815
|
-
}
|
|
816
|
-
```
|
|
817
|
-
|
|
818
|
-
This manifest answers "why is this here?" without reading generated configs.
|
|
819
|
-
|
|
820
|
-
See [tool/docs/overlays.md](tool/docs/overlays.md) for complete overlay reference.
|
|
821
|
-
|
|
822
|
-
### Service Dependency Management
|
|
823
|
-
|
|
824
|
-
The composer intelligently manages docker-compose service dependencies:
|
|
825
|
-
|
|
826
|
-
1. **Filters docker-compose** - Removes `depends_on` references to unselected services
|
|
827
|
-
2. **Orders services** - Uses `_serviceOrder` field (0=infra, 1=backends, 2=middleware, 3=UI)
|
|
828
|
-
3. **Merges runServices** - Creates ordered startup sequence
|
|
829
|
-
4. **Validates overlays** - Ensures compatible combinations
|
|
830
|
-
|
|
831
|
-
Example: If you select `grafana` without `prometheus`, the `depends_on: [prometheus]` is automatically removed.
|
|
832
|
-
|
|
833
|
-
See [tool/README.md](tool/README.md) for architecture details.
|
|
834
|
-
|
|
835
|
-
## 🔧 Customization
|
|
836
|
-
|
|
837
|
-
### Using Official Features
|
|
838
|
-
|
|
839
|
-
All templates use official features from [containers.dev/features](https://containers.dev/features). Add more by editing `devcontainer.json`:
|
|
840
|
-
|
|
841
|
-
```json
|
|
842
|
-
{
|
|
843
|
-
"features": {
|
|
844
|
-
"ghcr.io/devcontainers/features/node:1": {},
|
|
845
|
-
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
|
|
846
|
-
"ghcr.io/devcontainers/features/github-cli:1": {}
|
|
847
|
-
}
|
|
848
|
-
}
|
|
849
|
-
```
|
|
850
|
-
|
|
851
|
-
### Adding Custom Features
|
|
852
|
-
|
|
853
|
-
Use our custom features for specialized needs:
|
|
854
|
-
|
|
855
|
-
```json
|
|
856
|
-
{
|
|
857
|
-
"features": {
|
|
858
|
-
"./features/project-scaffolder": { "template": "express-api" },
|
|
859
|
-
"./features/team-conventions": { "preset": "airbnb" }
|
|
860
|
-
}
|
|
861
|
-
}
|
|
49
|
+
# Explain an existing manifest without re-entering overlays
|
|
50
|
+
npx container-superposition plan --from-manifest .devcontainer/superposition.json --verbose
|
|
862
51
|
```
|
|
863
52
|
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
Start with one template and enhance it:
|
|
867
|
-
|
|
868
|
-
- Add features from containers.dev
|
|
869
|
-
- Include custom features from this repo
|
|
870
|
-
- Copy useful scripts from other templates
|
|
53
|
+
## What It Does
|
|
871
54
|
|
|
872
|
-
|
|
55
|
+
- Base templates: `plain` (single image) and `compose` (multi-service).
|
|
56
|
+
- Overlays: add languages, databases, observability, cloud tools, dev tools.
|
|
57
|
+
- Composition: merges overlays into a standard `.devcontainer/` you can edit freely.
|
|
58
|
+
- Project config: commit `.superposition.yml` or `superposition.yml` to make team and CI generation declarative.
|
|
59
|
+
- `regen` uses that project file by default when present
|
|
60
|
+
- `--from-project` selects it explicitly
|
|
61
|
+
- conflicting source combinations fail early
|
|
62
|
+
- `init` stays the editable flow; `regen` is the deterministic replay flow
|
|
873
63
|
|
|
874
|
-
|
|
64
|
+
## Core Commands
|
|
875
65
|
|
|
876
|
-
|
|
66
|
+
- `init` — generate or modify a devcontainer, optionally starting from a project file or manifest
|
|
67
|
+
- `regen` — deterministically replay the repository project file or a manifest
|
|
68
|
+
- `adopt` — migrate an existing `.devcontainer/` to the overlay-based workflow
|
|
69
|
+
- `list` — browse overlays
|
|
70
|
+
- `explain` — overlay details
|
|
71
|
+
- `plan` — preview output
|
|
72
|
+
- Add `--verbose` to narrate dependency resolution and inclusion reasons
|
|
73
|
+
- Add `--from-manifest <path>` to preview an existing manifest with the same explanation model
|
|
74
|
+
- `hash` — deterministic environment fingerprint
|
|
75
|
+
- `doctor` — validate environment
|
|
877
76
|
|
|
878
|
-
|
|
879
|
-
# Run all tests
|
|
880
|
-
npm test
|
|
881
|
-
|
|
882
|
-
# Run tests in watch mode
|
|
883
|
-
npm run test:watch
|
|
884
|
-
|
|
885
|
-
# Run smoke tests
|
|
886
|
-
npm run test:smoke
|
|
887
|
-
```
|
|
888
|
-
|
|
889
|
-
**Test Coverage:**
|
|
77
|
+
## Documentation
|
|
890
78
|
|
|
891
|
-
|
|
892
|
-
- ✅ devcontainer.json merging
|
|
893
|
-
- ✅ docker-compose.yml merging
|
|
894
|
-
- ✅ Port offset application
|
|
895
|
-
- ✅ Environment variable merging
|
|
896
|
-
- ✅ Manifest generation
|
|
897
|
-
|
|
898
|
-
### Overlay Verification Scripts
|
|
899
|
-
|
|
900
|
-
Each overlay includes a `verify.sh` script for validation:
|
|
901
|
-
|
|
902
|
-
```bash
|
|
903
|
-
# Inside a devcontainer, run verification scripts
|
|
904
|
-
bash ./verify-postgres.sh
|
|
905
|
-
bash ./verify-redis.sh
|
|
906
|
-
bash ./verify-grafana.sh
|
|
907
|
-
```
|
|
79
|
+
Start here:
|
|
908
80
|
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
-
|
|
912
|
-
-
|
|
913
|
-
-
|
|
914
|
-
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
psql (PostgreSQL) 16.1
|
|
923
|
-
✅ psql client found
|
|
924
|
-
|
|
925
|
-
2️⃣ Checking PostgreSQL service...
|
|
926
|
-
✅ PostgreSQL service is ready
|
|
927
|
-
postgres:5432 - accepting connections
|
|
928
|
-
|
|
929
|
-
✅ PostgreSQL overlay verification complete
|
|
930
|
-
```
|
|
931
|
-
|
|
932
|
-
## 📦 Design Principles
|
|
933
|
-
|
|
934
|
-
- **Copy-Paste First** - Templates should work immediately without modification
|
|
935
|
-
- **Fast Builds** - Optimized Dockerfiles with layer caching
|
|
936
|
-
- **Composability** - Features can be mixed and matched
|
|
937
|
-
- **Minimal Bloat** - Only include what's needed
|
|
938
|
-
- **No Lock-In** - Standard devcontainer format, works anywhere
|
|
939
|
-
- **Preserve Customizations** - Project-specific changes survive regeneration via `.devcontainer/custom/`
|
|
940
|
-
|
|
941
|
-
## 🏗️ Building Your Own Template
|
|
942
|
-
|
|
943
|
-
Create a custom template for your team or project:
|
|
944
|
-
|
|
945
|
-
1. **Start with an official base** from [containers.dev/images](https://containers.dev/images)
|
|
946
|
-
2. **Add official features** from [containers.dev/features](https://containers.dev/features)
|
|
947
|
-
3. **Include custom features** from this repo for specialized needs
|
|
948
|
-
4. **Add project scripts** for your specific workflow
|
|
949
|
-
5. **Test thoroughly** - build and verify all tools work
|
|
950
|
-
6. **Document** - explain what's included and why
|
|
951
|
-
|
|
952
|
-
Example `devcontainer.json` structure:
|
|
953
|
-
|
|
954
|
-
```json
|
|
955
|
-
{
|
|
956
|
-
"name": "My Custom Template",
|
|
957
|
-
"image": "mcr.microsoft.com/devcontainers/typescript-node:20",
|
|
958
|
-
"features": {
|
|
959
|
-
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
|
|
960
|
-
"./features/team-conventions": {}
|
|
961
|
-
},
|
|
962
|
-
"postCreateCommand": "npm install && npm run setup",
|
|
963
|
-
"customizations": {
|
|
964
|
-
"vscode": {
|
|
965
|
-
"extensions": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"]
|
|
966
|
-
}
|
|
967
|
-
}
|
|
968
|
-
}
|
|
969
|
-
```
|
|
970
|
-
|
|
971
|
-
## 📚 Documentation
|
|
972
|
-
|
|
973
|
-
Complete documentation is available in the [docs/](docs/) folder:
|
|
974
|
-
|
|
975
|
-
- **[Documentation Index](docs/README.md)** - Complete documentation overview
|
|
976
|
-
- **[Custom Patches](docs/custom-patches.md)** - Preserve project-specific customizations across regenerations
|
|
977
|
-
- **[Publishing Guide](docs/publishing.md)** - How to publish to npm
|
|
978
|
-
- **[Quick Reference](docs/quick-reference.md)** - Templates, overlays, ports, commands
|
|
979
|
-
- **[Architecture](docs/architecture.md)** - Design principles and composition logic
|
|
980
|
-
- **[Creating Overlays](docs/creating-overlays.md)** - Guide for adding new overlays
|
|
981
|
-
- [Overlay Manifest Schema](tool/schema/overlay-manifest.schema.json) - JSON schema for overlay.yml
|
|
982
|
-
- [Overlay Index Guide](.github/instructions/overlay-index.instructions.md) - Comprehensive field documentation
|
|
983
|
-
- **[Examples](docs/examples.md)** - Common usage patterns
|
|
984
|
-
|
|
985
|
-
Additional resources:
|
|
986
|
-
|
|
987
|
-
- [VS Code Dev Containers Documentation](https://code.visualstudio.com/docs/devcontainers/containers)
|
|
988
|
-
- [Dev Container Specification](https://containers.dev/)
|
|
989
|
-
- [Docker Best Practices](https://docs.docker.com/develop/dev-best-practices/)
|
|
990
|
-
|
|
991
|
-
## 💻 Development
|
|
992
|
-
|
|
993
|
-
### Working on Container Superposition
|
|
994
|
-
|
|
995
|
-
This repository dogfoods its own tooling! The development environment is set up using Container Superposition itself.
|
|
996
|
-
|
|
997
|
-
**Quick Start:**
|
|
998
|
-
|
|
999
|
-
```bash
|
|
1000
|
-
# Clone and open in VS Code
|
|
1001
|
-
git clone https://github.com/veggerby/container-superposition.git
|
|
1002
|
-
cd container-superposition
|
|
1003
|
-
code .
|
|
1004
|
-
|
|
1005
|
-
# When prompted, click "Reopen in Container"
|
|
1006
|
-
# The devcontainer includes:
|
|
1007
|
-
# - Node.js with TypeScript
|
|
1008
|
-
# - Docker access (via host socket)
|
|
1009
|
-
# - Git helpers and modern CLI tools
|
|
1010
|
-
# - Codex for AI assistance
|
|
1011
|
-
```
|
|
1012
|
-
|
|
1013
|
-
**Without Devcontainer:**
|
|
1014
|
-
|
|
1015
|
-
```bash
|
|
1016
|
-
npm install # Install dependencies
|
|
1017
|
-
npm run build # Compile TypeScript
|
|
1018
|
-
npm run init # Run the tool
|
|
1019
|
-
npm test # Run tests
|
|
1020
|
-
```
|
|
1021
|
-
|
|
1022
|
-
**Development Workflow:**
|
|
1023
|
-
|
|
1024
|
-
1. Make changes to TypeScript sources in `scripts/` or `tool/`
|
|
1025
|
-
2. Run `npm run build` to compile
|
|
1026
|
-
3. Test with `npm run init` or `npm test`
|
|
1027
|
-
4. Submit PR following [CONTRIBUTING.md](CONTRIBUTING.md)
|
|
1028
|
-
|
|
1029
|
-
The `.devcontainer/` folder is generated using:
|
|
1030
|
-
|
|
1031
|
-
```bash
|
|
1032
|
-
npm run init -- --stack plain --language nodejs --dev-tools codex,docker-sock,git-helpers,modern-cli-tools
|
|
1033
|
-
```
|
|
81
|
+
- [Docs index](https://github.com/veggerby/container-superposition/blob/main/docs/README.md)
|
|
82
|
+
- [Quick reference](https://github.com/veggerby/container-superposition/blob/main/docs/quick-reference.md)
|
|
83
|
+
- [Adopt command](https://github.com/veggerby/container-superposition/blob/main/docs/adopt.md)
|
|
84
|
+
- [Hash command](https://github.com/veggerby/container-superposition/blob/main/docs/hash.md)
|
|
85
|
+
- [Examples](https://github.com/veggerby/container-superposition/blob/main/docs/examples.md)
|
|
86
|
+
- [Presets](https://github.com/veggerby/container-superposition/blob/main/docs/presets.md)
|
|
87
|
+
- [Architecture](https://github.com/veggerby/container-superposition/blob/main/docs/architecture.md)
|
|
88
|
+
- [Overlays](https://github.com/veggerby/container-superposition/blob/main/docs/overlays.md)
|
|
89
|
+
- [Custom patches](https://github.com/veggerby/container-superposition/blob/main/docs/custom-patches.md)
|
|
90
|
+
- [Workflows and regen](https://github.com/veggerby/container-superposition/blob/main/docs/workflows.md)
|
|
91
|
+
- [Filesystem contract](https://github.com/veggerby/container-superposition/blob/main/docs/filesystem-contract.md)
|
|
92
|
+
- [Security](https://github.com/veggerby/container-superposition/blob/main/docs/security.md)
|
|
93
|
+
- [Publishing](https://github.com/veggerby/container-superposition/blob/main/docs/publishing.md)
|
|
1034
94
|
|
|
1035
|
-
##
|
|
95
|
+
## Examples
|
|
1036
96
|
|
|
1037
|
-
|
|
97
|
+
- [Example projects](https://github.com/veggerby/container-superposition/tree/main/examples)
|
|
98
|
+
- [Examples guide](https://github.com/veggerby/container-superposition/blob/main/docs/examples.md)
|
|
1038
99
|
|
|
1039
|
-
|
|
100
|
+
## Contributing
|
|
1040
101
|
|
|
1041
|
-
-
|
|
1042
|
-
- Well-documented
|
|
1043
|
-
- Fast to build
|
|
1044
|
-
- Easy to understand
|
|
102
|
+
See [CONTRIBUTING.md](https://github.com/veggerby/container-superposition/blob/main/CONTRIBUTING.md)
|
|
1045
103
|
|
|
1046
|
-
##
|
|
104
|
+
## License
|
|
1047
105
|
|
|
1048
|
-
MIT
|
|
106
|
+
MIT. See [LICENSE](https://github.com/veggerby/container-superposition/blob/main/LICENSE)
|