Skip to content

Commit 6e3428a

Browse files
committed
chore: add devcontainer support to ease developer workstation setup
Fixes #466
1 parent bc101a4 commit 6e3428a

File tree

4 files changed

+186
-0
lines changed

4 files changed

+186
-0
lines changed

.devcontainer/devcontainer.json

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/python
3+
{
4+
"name": "SpecKitDevContainer",
5+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6+
"image": "mcr.microsoft.com/devcontainers/python:1-3.12-bullseye",
7+
"features": {
8+
"ghcr.io/devcontainers/features/common-utils:2": {
9+
"installZsh": true,
10+
"installOhMyZsh": true,
11+
"installOhMyZshConfig": true,
12+
"upgradePackages": true,
13+
"username": "devcontainer",
14+
"userUid": "automatic",
15+
"userGid": "automatic"
16+
},
17+
"ghcr.io/devcontainers/features/dotnet:2": {
18+
"version": "lts"
19+
},
20+
"ghcr.io/devcontainers/features/git:1": {
21+
"ppa": true,
22+
"version": "latest"
23+
},
24+
"ghcr.io/devcontainers/features/node:1": {
25+
"nodeGypDependencies": true,
26+
"installYarnUsingApt": true,
27+
"version": "lts",
28+
"pnpmVersion": "latest",
29+
"nvmVersion": "latest"
30+
}
31+
},
32+
33+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
34+
"forwardPorts": [
35+
8080 // for Spec-Kit documentation site
36+
],
37+
"containerUser": "devcontainer",
38+
"updateRemoteUserUID": true,
39+
"postCreateCommand": "chmod +x ./.devcontainer/post-create.sh && ./.devcontainer/post-create.sh",
40+
"postStartCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}",
41+
"customizations": {
42+
"vscode": {
43+
"extensions": [
44+
"mhutchie.git-graph",
45+
"eamodio.gitlens",
46+
"anweber.reveal-button",
47+
"chrisdias.promptboost",
48+
// Github Copilot
49+
"GitHub.copilot",
50+
"GitHub.copilot-chat",
51+
// Codex
52+
"openai.chatgpt",
53+
// Kilo Code
54+
"kilocode.Kilo-Code",
55+
// Roo Code
56+
"RooVeterinaryInc.roo-cline"
57+
],
58+
"settings": {
59+
"chat.agent.maxRequests": 50,
60+
"github.copilot.chat.codesearch.enabled": true,
61+
"github.copilot.chat.agent.thinkingTool": true,
62+
"debug.javascript.autoAttachFilter": "disabled" // fix running commands in integrated terminal
63+
}
64+
}
65+
}
66+
}

.devcontainer/post-create.sh

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
#!/bin/bash
2+
3+
set -e
4+
set -o pipefail
5+
6+
# Function to run a command and show logs only on error
7+
run_command() {
8+
output=$(eval "$*" 2>&1)
9+
exit_code=$?
10+
if [ $exit_code -ne 0 ]; then
11+
echo "[ERROR] Command failed: $*"
12+
echo "$output"
13+
exit $exit_code
14+
fi
15+
}
16+
17+
18+
# Installing CLI-based AI Agents
19+
echo "🤖 Installing Claude CLI..."
20+
run_command "npm install -g @anthropic-ai/claude-code@latest"
21+
echo "✅ Done"
22+
23+
echo "🤖 Installing Codex CLI..."
24+
run_command "npm install -g @openai/codex@latest"
25+
echo "✅ Done"
26+
27+
echo "🤖 Installing Gemini CLI..."
28+
run_command "npm install -g @google/gemini-cli@latest"
29+
echo "✅ Done"
30+
31+
echo "🤖 Installing Augie CLI..."
32+
run_command "npm install -g @augmentcode/auggie@latest"
33+
echo "✅ Done"
34+
35+
echo "🤖 Installing Qwen Code CLI..."
36+
run_command "npm install -g @qwen-code/qwen-code@latest"
37+
echo "✅ Done"
38+
39+
echo "🤖 Installing OpenCode CLI..."
40+
run_command "npm install -g opencode-ai@latest"
41+
echo "✅ Done"
42+
43+
# Installing DocFx (for documenttion site)
44+
echo "📚 Installing DocFx..."
45+
run_command "dotnet tool update -g docfx"
46+
echo "✅ Done"
47+
48+
# Installing UV (Python package manager)
49+
echo "🐍 Installing UV..."
50+
run_command "pip install uv"
51+
echo "✅ Done"
52+
53+
echo "🧹 Cleaning cache..."
54+
run_command "sudo apt-get autoclean"
55+
run_command "sudo apt-get clean"
56+
57+
58+
echo "✅ Setup completed. Happy coding! 🚀"

AGENTS.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,51 @@ elif selected_ai == "windsurf":
188188

189189
**Note**: Skip CLI checks for IDE-based agents (Copilot, Windsurf).
190190

191+
#### 7. Update Devcontainer files (Optional)
192+
193+
For agents that have VS Code extensions or require CLI installation, update the devcontainer configuration files:
194+
195+
##### VS Code Extension-based Agents
196+
197+
For agents available as VS Code extensions, add them to `.devcontainer/devcontainer.json`:
198+
199+
```json
200+
{
201+
"customizations": {
202+
"vscode": {
203+
"extensions": [
204+
"GitHub.copilot",
205+
"GitHub.copilot-chat",
206+
// [New Agent Name]
207+
"[Agent Extension ID]"
208+
]
209+
}
210+
}
211+
}
212+
```
213+
214+
##### CLI-based Agents
215+
216+
For agents that require CLI tools, add installation commands to `.devcontainer/post-create.sh`:
217+
218+
```bash
219+
#!/bin/bash
220+
221+
# Existing installations...
222+
223+
echo "🤖 Installing [New Agent Name] CLI..."
224+
# npm install -g [agent-cli-package]@latest # Example for npm-based CLI
225+
# or other installation command...
226+
227+
```
228+
229+
**Quick Tips:**
230+
231+
- **Extension-based agents**: Add to the `extensions` array in `devcontainer.json`
232+
- **CLI-based agents**: Add installation scripts to `post-create.sh`
233+
- **Hybrid agents**: May require both extension and CLI installation
234+
- **Test thoroughly**: Ensure installations work in the devcontainer environment
235+
191236
## Agent Categories
192237

193238
### CLI-Based Agents

CONTRIBUTING.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,23 @@ These are one time installations required to be able to test your changes locall
1313
1. Install [Git](https://git-scm.com/downloads)
1414
1. Have an [AI coding agent available](README.md#-supported-ai-agents)
1515

16+
<details>
17+
<summary><b>💡 Hint if you are using <code>VSCode</code> or <code>Github Codespaces</code> as your IDE</b></summary>
18+
19+
<br>
20+
21+
Provided you have [Docker](https://docker.com) installed on your machine, you can leverage [Dev Containers](https://containers.dev) through this [VSCode extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers), to easily setup your development environment, with aforementioned tools already installed and configured, thanks to the `.devcoontainer/devcontainer.json` file (located at the root of the project).
22+
23+
To do so, simply:
24+
25+
- Checkout the repo
26+
- Open it with VSCode
27+
- Open the [Command Palette](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette) and select "Dev Containers: Open Folder in Container..."
28+
29+
On [Github Codespace](https://github.com/features/codespaces) it's even simpler, as it leverages the `.devcoontainer/devcontainer.json` automatically upon opening the codespace.
30+
31+
</details>
32+
1633
## Submitting a pull request
1734

1835
>[!NOTE]

0 commit comments

Comments
 (0)