Skip to content

Commit b1b80a2

Browse files
authored
Merge pull request #8 from cloudengine-labs/copilot/implement-cli-commands-dev-container
Add CLI scaffold command for dev container config and update docs
2 parents 8512dd4 + bd2f302 commit b1b80a2

7 files changed

Lines changed: 576 additions & 13 deletions

File tree

.devcontainer/README.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,26 @@ This development container provides a consistent environment for Java, JavaScrip
1818

1919
### Configuration
2020

21+
#### Option A — Use the CLI (recommended)
22+
23+
Generate `devcontainer.json` and `devcontainer.env.json` with a single command:
24+
25+
```bash
26+
# From the repository root
27+
python -m cli.scaffold_devcontainer \
28+
--languages python,java,go \
29+
--cicd-tools docker,terraform,kubectl,helm \
30+
--kubernetes-tools k9s,kustomize,argocd_cli,flux \
31+
--devops-tools prometheus,grafana
32+
33+
# Or via the unified CLI
34+
python -m cli.devopsos scaffold devcontainer
35+
```
36+
37+
Run `python -m cli.scaffold_devcontainer --help` to see all available options including version overrides (`--python-version`, `--go-version`, etc.).
38+
39+
#### Option B — Edit JSON manually
40+
2141
1. Customize the environment by editing `.devcontainer/devcontainer.env.json`:
2242

2343
```json
@@ -66,7 +86,9 @@ cd .devcontainer
6686
python3 configure.py
6787
```
6888

69-
3. Open the project in VS Code and click "Reopen in Container" when prompted
89+
#### Open in VS Code
90+
91+
After configuring (via either option), open the project in VS Code and click "Reopen in Container" when prompted.
7092

7193
## What's Included
7294

README.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@ python -m cli.scaffold_argocd --name my-app --method flux --repo https://github.
116116
# SRE configs (Prometheus, Grafana, SLO)
117117
python -m cli.scaffold_sre --name my-app --team platform --slo-target 99.9
118118

119+
# Dev container configuration
120+
python -m cli.scaffold_devcontainer --languages python,go --cicd-tools docker,terraform --kubernetes-tools k9s,flux
121+
119122
# Kubernetes manifests
120123
python kubernetes/k8s-config-generator.py --name my-app --image ghcr.io/myorg/my-app:v1
121124
```
@@ -127,8 +130,9 @@ python -m cli.devopsos init # interactive project configurator
127130
python -m cli.devopsos scaffold gha # scaffold GitHub Actions
128131
python -m cli.devopsos scaffold gitlab # scaffold GitLab CI
129132
python -m cli.devopsos scaffold jenkins # scaffold Jenkins
130-
python -m cli.devopsos scaffold argocd # scaffold ArgoCD / Flux
131-
python -m cli.devopsos scaffold sre # scaffold SRE configs
133+
python -m cli.devopsos scaffold argocd # scaffold ArgoCD / Flux
134+
python -m cli.devopsos scaffold sre # scaffold SRE configs
135+
python -m cli.devopsos scaffold devcontainer # scaffold dev container config
132136
```
133137

134138
### 5 — Use with AI (MCP Server)
@@ -207,7 +211,21 @@ The pre-configured dev container gives you a consistent multi-language environme
207211
</details>
208212

209213

210-
Customize `.devcontainer/devcontainer.env.json` to enable or disable any language or tool, then reopen in VS Code.
214+
Generate a dev container configuration from the CLI instead of editing JSON by hand:
215+
216+
```bash
217+
# Generate devcontainer.json and devcontainer.env.json for a Python + Go project
218+
python -m cli.scaffold_devcontainer \
219+
--languages python,go \
220+
--cicd-tools docker,terraform,kubectl \
221+
--kubernetes-tools k9s,flux \
222+
--devops-tools prometheus,grafana
223+
224+
# Or use the unified CLI
225+
python -m cli.devopsos scaffold devcontainer
226+
```
227+
228+
You can also customize `.devcontainer/devcontainer.env.json` directly to enable or disable any language or tool, then reopen in VS Code.
211229

212230
---
213231

cli/devopsos.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import cli.scaffold_gitlab as scaffold_gitlab
1212
import cli.scaffold_argocd as scaffold_argocd
1313
import cli.scaffold_sre as scaffold_sre
14+
import cli.scaffold_devcontainer as scaffold_devcontainer
1415

1516
app = typer.Typer(help="Unified DevOps-OS CLI tool")
1617

@@ -129,7 +130,7 @@ def init():
129130

130131
@app.command()
131132
def scaffold(
132-
target: str = typer.Argument(..., help="What to scaffold: cicd | gha | gitlab | jenkins | argocd | sre"),
133+
target: str = typer.Argument(..., help="What to scaffold: cicd | gha | gitlab | jenkins | argocd | sre | devcontainer"),
133134
tool: str = typer.Option(None, help="Tool type (e.g., github, jenkins, argo, flux)"),
134135
):
135136
"""Scaffold CI/CD or K8s resources."""
@@ -145,6 +146,8 @@ def scaffold(
145146
scaffold_argocd.main()
146147
elif target == "sre":
147148
scaffold_sre.main()
149+
elif target == "devcontainer":
150+
scaffold_devcontainer.main()
148151
else:
149152
typer.echo("Unknown scaffold target.")
150153

0 commit comments

Comments
 (0)