container-superposition 0.1.9 → 0.1.10

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.
Files changed (34) hide show
  1. package/README.md +3 -0
  2. package/dist/tool/cli/args.d.ts.map +1 -1
  3. package/dist/tool/cli/args.js +1 -1
  4. package/dist/tool/cli/args.js.map +1 -1
  5. package/dist/tool/commands/adopt.d.ts.map +1 -1
  6. package/dist/tool/commands/adopt.js +14 -20
  7. package/dist/tool/commands/adopt.js.map +1 -1
  8. package/dist/tool/questionnaire/composer.d.ts.map +1 -1
  9. package/dist/tool/questionnaire/composer.js +186 -2
  10. package/dist/tool/questionnaire/composer.js.map +1 -1
  11. package/dist/tool/schema/project-config.d.ts.map +1 -1
  12. package/dist/tool/schema/project-config.js +169 -0
  13. package/dist/tool/schema/project-config.js.map +1 -1
  14. package/dist/tool/schema/types.d.ts +49 -0
  15. package/dist/tool/schema/types.d.ts.map +1 -1
  16. package/docs/README.md +1 -0
  17. package/docs/overlays.md +30 -0
  18. package/docs/specs/019-project-mounts/spec.md +176 -0
  19. package/docs/superposition-yml.md +467 -0
  20. package/overlays/ansible/README.md +163 -0
  21. package/overlays/ansible/devcontainer.patch.json +14 -0
  22. package/overlays/ansible/overlay.yml +18 -0
  23. package/overlays/argocd/README.md +158 -0
  24. package/overlays/argocd/devcontainer.patch.json +9 -0
  25. package/overlays/argocd/overlay.yml +17 -0
  26. package/overlays/argocd/setup.sh +29 -0
  27. package/overlays/argocd/verify.sh +14 -0
  28. package/overlays/task/README.md +47 -0
  29. package/overlays/task/devcontainer.patch.json +9 -0
  30. package/overlays/task/overlay.yml +16 -0
  31. package/overlays/task/setup.sh +29 -0
  32. package/overlays/task/verify.sh +14 -0
  33. package/package.json +1 -1
  34. package/tool/schema/config.schema.json +74 -1
@@ -0,0 +1,158 @@
1
+ # Argo CD CLI Overlay
2
+
3
+ Adds the [`argocd`](https://argo-cd.readthedocs.io/) CLI for managing GitOps workflows with an Argo CD server — log in, inspect apps, trigger syncs, and manage rollouts without leaving your devcontainer.
4
+
5
+ ## Features
6
+
7
+ - **Argo CD CLI** — `argocd` client for login, app sync, rollback, and lifecycle operations
8
+ - **Release install** — binary downloaded from official Argo CD GitHub releases
9
+ - **Architecture-aware** — installs `amd64` or `arm64` automatically
10
+
11
+ ## How It Works
12
+
13
+ The `argocd` binary is downloaded from the official Argo CD GitHub releases page (`github.com/argoproj/argo-cd`) during devcontainer creation via `setup.sh`.
14
+
15
+ - Detects host architecture (`amd64` / `arm64`) automatically
16
+ - Downloads the matching pre-built binary and places it in `/usr/local/bin/argocd`
17
+ - No Argo CD server is run inside the devcontainer — the CLI connects to an external (or locally port-forwarded) Argo CD server
18
+
19
+ **Dependencies:** None required. Pair with `kubectl-helm` for full cluster access, and `k3d` or `kind` for local Kubernetes clusters where you can deploy Argo CD for testing.
20
+
21
+ ## Common Commands
22
+
23
+ ### Authentication
24
+
25
+ ```bash
26
+ # Login to an Argo CD server
27
+ argocd login argocd.example.com
28
+
29
+ # Login with TLS disabled (for local/dev servers)
30
+ argocd login localhost:8080 --insecure
31
+
32
+ # Login and save context (avoids re-entering credentials)
33
+ argocd login argocd.example.com --grpc-web
34
+
35
+ # Check current logged-in context
36
+ argocd context
37
+
38
+ # Switch context
39
+ argocd context my-cluster
40
+
41
+ # Logout
42
+ argocd logout argocd.example.com
43
+ ```
44
+
45
+ ### Application Management
46
+
47
+ ```bash
48
+ # List all applications
49
+ argocd app list
50
+
51
+ # Get detailed status of an app
52
+ argocd app get my-app
53
+
54
+ # Create an app (GitOps source)
55
+ argocd app create my-app \
56
+ --repo https://github.com/myorg/my-manifests.git \
57
+ --path k8s/overlays/dev \
58
+ --dest-server https://kubernetes.default.svc \
59
+ --dest-namespace my-app
60
+
61
+ # Sync (deploy) an app
62
+ argocd app sync my-app
63
+
64
+ # Wait for sync to complete
65
+ argocd app wait my-app --sync
66
+
67
+ # Delete an app (without deleting cluster resources)
68
+ argocd app delete my-app
69
+
70
+ # Delete an app and all managed cluster resources
71
+ argocd app delete my-app --cascade
72
+ ```
73
+
74
+ ### Sync Operations
75
+
76
+ ```bash
77
+ # Sync only specific resources
78
+ argocd app sync my-app --resource apps:Deployment:my-app
79
+
80
+ # Force sync (ignores resource health)
81
+ argocd app sync my-app --force
82
+
83
+ # Dry-run sync (show diff without applying)
84
+ argocd app diff my-app
85
+
86
+ # Rollback to a previous revision
87
+ argocd app rollback my-app 3
88
+
89
+ # View app history
90
+ argocd app history my-app
91
+ ```
92
+
93
+ ### Projects & RBAC
94
+
95
+ ```bash
96
+ # List projects
97
+ argocd proj list
98
+
99
+ # Create a project
100
+ argocd proj create my-project \
101
+ --description "My project" \
102
+ --src https://github.com/myorg/my-manifests.git \
103
+ --dest https://kubernetes.default.svc,my-namespace
104
+
105
+ # List project roles
106
+ argocd proj role list my-project
107
+ ```
108
+
109
+ ## Local Port-Forward Workflow
110
+
111
+ When testing Argo CD in a local cluster (k3d / kind):
112
+
113
+ ```bash
114
+ # Install Argo CD in the cluster
115
+ kubectl create namespace argocd
116
+ kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
117
+
118
+ # Wait for pods to be ready
119
+ kubectl -n argocd wait --for=condition=ready pod -l app.kubernetes.io/name=argocd-server --timeout=120s
120
+
121
+ # Port-forward the API server
122
+ kubectl -n argocd port-forward svc/argocd-server 8080:443 &
123
+
124
+ # Get the initial admin password
125
+ argocd admin initial-password -n argocd
126
+
127
+ # Login
128
+ argocd login localhost:8080 --insecure
129
+ ```
130
+
131
+ ## Use Cases
132
+
133
+ - **GitOps deployments** — Sync Kubernetes manifests from Git to a cluster via Argo CD
134
+ - **Multi-environment promotion** — Manage dev/staging/production app variants with app-of-apps patterns
135
+ - **Rollback workflows** — Inspect history and revert to a previous known-good revision
136
+ - **Local GitOps testing** — Deploy Argo CD to a local `k3d` or `kind` cluster to test GitOps pipelines without a cloud environment
137
+ - **Drift detection** — Use `argocd app diff` to detect config drift before syncing
138
+
139
+ **Integrates well with:**
140
+
141
+ - `kubectl-helm` — Kubernetes CLI and Helm for inspecting or patching resources managed by Argo CD
142
+ - `k3d` — Lightweight local clusters for GitOps development and testing
143
+ - `kind` — Full-conformance local clusters for Argo CD testing
144
+ - `terraform` — Provision the cluster and bootstrap Argo CD with Terraform, then manage apps with the CLI
145
+
146
+ ## References
147
+
148
+ - [Argo CD Documentation](https://argo-cd.readthedocs.io/)
149
+ - [Argo CD CLI Reference](https://argo-cd.readthedocs.io/en/stable/user-guide/commands/argocd/)
150
+ - [Argo CD GitHub Releases](https://github.com/argoproj/argo-cd/releases)
151
+ - [Argo CD Getting Started](https://argo-cd.readthedocs.io/en/stable/getting_started/)
152
+ - [App of Apps Pattern](https://argo-cd.readthedocs.io/en/stable/operator-manual/cluster-bootstrapping/)
153
+
154
+ **Related Overlays:**
155
+
156
+ - [`kubectl-helm`](../kubectl-helm/README.md) — Kubernetes CLI and Helm package manager
157
+ - [`k3d`](../k3d/README.md) — Lightweight local Kubernetes clusters
158
+ - [`kind`](../kind/README.md) — Full-conformance local Kubernetes clusters
@@ -0,0 +1,9 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainer.base.schema.json",
3
+ "postCreateCommand": {
4
+ "setup-argocd": "bash .devcontainer/scripts/setup-argocd.sh"
5
+ },
6
+ "postStartCommand": {
7
+ "verify-argocd": "bash .devcontainer/scripts/verify-argocd.sh"
8
+ }
9
+ }
@@ -0,0 +1,17 @@
1
+ id: argocd
2
+ name: Argo CD CLI
3
+ description: GitOps CLI for managing Argo CD applications and sync workflows
4
+ category: cloud
5
+ supports: []
6
+ requires: []
7
+ suggests:
8
+ - kubectl-helm
9
+ - k3d
10
+ - kind
11
+ conflicts: []
12
+ tags:
13
+ - cloud
14
+ - kubernetes
15
+ - gitops
16
+ - argocd
17
+ ports: []
@@ -0,0 +1,29 @@
1
+ #!/bin/bash
2
+ # Setup script for Argo CD CLI
3
+
4
+ set -e
5
+
6
+ echo "🔧 Setting up Argo CD CLI..."
7
+
8
+ # Source shared setup utilities
9
+ # shellcheck source=setup-utils.sh
10
+ source "$(dirname "${BASH_SOURCE[0]}")/setup-utils.sh"
11
+
12
+ detect_arch
13
+
14
+ ARGOCD_VERSION="${ARGOCD_VERSION:-v2.14.12}"
15
+ echo "📦 Installing argocd ${ARGOCD_VERSION}..."
16
+
17
+ install_binary \
18
+ "https://github.com/argoproj/argo-cd/releases/download/${ARGOCD_VERSION}/argocd-linux-${CS_ARCH}" \
19
+ "argocd"
20
+
21
+ if command -v argocd >/dev/null 2>&1; then
22
+ echo "✅ Argo CD CLI installed successfully"
23
+ argocd version --client --short || argocd version --client
24
+ else
25
+ echo "❌ Argo CD CLI installation failed"
26
+ exit 1
27
+ fi
28
+
29
+ echo "✅ Argo CD CLI setup complete"
@@ -0,0 +1,14 @@
1
+ #!/bin/bash
2
+ # Verification script for Argo CD CLI overlay
3
+
4
+ set -e
5
+
6
+ echo "🔍 Verifying Argo CD CLI overlay..."
7
+
8
+ if command -v argocd >/dev/null 2>&1; then
9
+ argocd version --client --short || argocd version --client
10
+ echo "✅ Argo CD CLI is installed"
11
+ else
12
+ echo "❌ Argo CD CLI is not installed"
13
+ exit 1
14
+ fi
@@ -0,0 +1,47 @@
1
+ # Taskfile (task) Overlay
2
+
3
+ Adds [Task](https://taskfile.dev/) (`task`) to run project automation via `Taskfile.yml`.
4
+
5
+ ## Features
6
+
7
+ - **Task CLI** — fast, modern task runner (`task`)
8
+ - **Taskfile workflows** — declarative task definitions with dependencies and variables
9
+ - **Architecture-aware install** — installs amd64 or arm64 binary automatically
10
+
11
+ ## Quick Start
12
+
13
+ ```bash
14
+ task --version
15
+ task --list
16
+ ```
17
+
18
+ Create a basic `Taskfile.yml`:
19
+
20
+ ```yaml
21
+ version: '3'
22
+
23
+ tasks:
24
+ default:
25
+ cmds:
26
+ - task --list
27
+
28
+ lint:
29
+ cmds:
30
+ - npm run lint
31
+
32
+ test:
33
+ cmds:
34
+ - npm test
35
+ ```
36
+
37
+ Run tasks:
38
+
39
+ ```bash
40
+ task lint
41
+ task test
42
+ ```
43
+
44
+ ## Suggested Pairings
45
+
46
+ - `modern-cli-tools` — useful companion CLIs for day-to-day development
47
+ - `kubectl-helm` — pair task automation with Kubernetes workflows
@@ -0,0 +1,9 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainer.base.schema.json",
3
+ "postCreateCommand": {
4
+ "setup-task": "bash .devcontainer/scripts/setup-task.sh"
5
+ },
6
+ "postStartCommand": {
7
+ "verify-task": "bash .devcontainer/scripts/verify-task.sh"
8
+ }
9
+ }
@@ -0,0 +1,16 @@
1
+ id: task
2
+ name: Taskfile (task)
3
+ description: Modern task runner and build tool using Taskfiles
4
+ category: dev
5
+ supports: []
6
+ requires: []
7
+ suggests:
8
+ - modern-cli-tools
9
+ - kubectl-helm
10
+ conflicts: []
11
+ tags:
12
+ - dev
13
+ - automation
14
+ - taskfile
15
+ - build
16
+ ports: []
@@ -0,0 +1,29 @@
1
+ #!/bin/bash
2
+ # Setup script for Taskfile (task)
3
+
4
+ set -e
5
+
6
+ echo "🔧 Setting up Taskfile (task)..."
7
+
8
+ # Source shared setup utilities
9
+ # shellcheck source=setup-utils.sh
10
+ source "$(dirname "${BASH_SOURCE[0]}")/setup-utils.sh"
11
+
12
+ detect_arch
13
+
14
+ TASK_VERSION="${TASK_VERSION:-v3.45.4}"
15
+ echo "📦 Installing task ${TASK_VERSION}..."
16
+
17
+ install_binary_from_tar \
18
+ "https://github.com/go-task/task/releases/download/${TASK_VERSION}/task_linux_${CS_ARCH}.tar.gz" \
19
+ "task"
20
+
21
+ if command -v task >/dev/null 2>&1; then
22
+ echo "✅ task installed successfully"
23
+ task --version
24
+ else
25
+ echo "❌ task installation failed"
26
+ exit 1
27
+ fi
28
+
29
+ echo "✅ Taskfile setup complete"
@@ -0,0 +1,14 @@
1
+ #!/bin/bash
2
+ # Verification script for Taskfile (task) overlay
3
+
4
+ set -e
5
+
6
+ echo "🔍 Verifying Taskfile overlay..."
7
+
8
+ if command -v task >/dev/null 2>&1; then
9
+ task --version
10
+ echo "✅ task is installed"
11
+ else
12
+ echo "❌ task is not installed"
13
+ exit 1
14
+ fi
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "container-superposition",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "description": "Solution-ready devcontainer templates and features with guided initialization",
5
5
  "type": "module",
6
6
  "main": "dist/scripts/init.js",
@@ -272,6 +272,41 @@
272
272
  ]
273
273
  }
274
274
  },
275
+ "mounts": {
276
+ "description": "Project-level mount specs routed to devcontainer.json mounts or docker-compose volumes based on stack/target",
277
+ "oneOf": [
278
+ {
279
+ "type": "array",
280
+ "items": {
281
+ "$ref": "#/$defs/projectMountEntry"
282
+ }
283
+ },
284
+ {
285
+ "type": "object",
286
+ "description": "Named mount map form",
287
+ "additionalProperties": {
288
+ "$ref": "#/$defs/projectMountObject"
289
+ }
290
+ }
291
+ ]
292
+ },
293
+ "shell": {
294
+ "type": "object",
295
+ "description": "Shell profile customizations written via a managed shell-init hook",
296
+ "properties": {
297
+ "aliases": {
298
+ "type": "object",
299
+ "additionalProperties": { "type": "string" },
300
+ "description": "Alias name -> command map (e.g. k: kubectl)"
301
+ },
302
+ "snippets": {
303
+ "type": "array",
304
+ "items": { "type": "string" },
305
+ "description": "Raw shell snippets appended to generated shell-init"
306
+ }
307
+ },
308
+ "additionalProperties": false
309
+ },
275
310
  "customizations": {
276
311
  "type": "object",
277
312
  "properties": {
@@ -328,5 +363,43 @@
328
363
  }
329
364
  },
330
365
  "required": [],
331
- "additionalProperties": false
366
+ "additionalProperties": false,
367
+ "$defs": {
368
+ "projectMountTarget": {
369
+ "type": "string",
370
+ "enum": ["auto", "devcontainerMount", "composeVolume"]
371
+ },
372
+ "projectMountObject": {
373
+ "type": "object",
374
+ "properties": {
375
+ "value": {
376
+ "type": "string",
377
+ "description": "Raw mount spec string (escape hatch)"
378
+ },
379
+ "source": { "type": "string", "description": "Mount source path or volume name" },
380
+ "destination": { "type": "string", "description": "Container destination path" },
381
+ "type": { "type": "string", "enum": ["bind", "volume", "tmpfs"] },
382
+ "consistency": { "type": "string", "enum": ["consistent", "cached", "delegated"] },
383
+ "cached": {
384
+ "type": "boolean",
385
+ "description": "Convenience alias for consistency: cached"
386
+ },
387
+ "readOnly": { "type": "boolean" },
388
+ "target": { "$ref": "#/$defs/projectMountTarget" }
389
+ },
390
+ "additionalProperties": false,
391
+ "oneOf": [{ "required": ["value"] }, { "required": ["source", "destination"] }]
392
+ },
393
+ "projectMountEntry": {
394
+ "oneOf": [
395
+ {
396
+ "type": "string",
397
+ "description": "Raw mount spec string"
398
+ },
399
+ {
400
+ "$ref": "#/$defs/projectMountObject"
401
+ }
402
+ ]
403
+ }
404
+ }
332
405
  }