-
Notifications
You must be signed in to change notification settings - Fork 3.6k
chore: add devcontainer support to ease developer workstation setup
#487
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+240
−0
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
900bc2e
chore: add `devcontainer` support to ease developer workstation setup
tinesoft ecec4bc
chore: add `specify`'s github copilot chat settings to `devcontainer`
tinesoft f3c77e2
fix: correct `run_command` exit behavior and improve installation ins…
tinesoft 9d4e8e9
chore: fix path to powershell script in vscode settings
tinesoft a8514da
chore: add installation of `codebuddy` CLI in the `devcontainer`
tinesoft b009773
chore: add Claude Code extension to devcontainer configuration
tinesoft 71c2c63
chore: replace `bun` by `node/npm` in the `devcontainer` (as many CLI…
tinesoft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| // For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||
| // README at: https://github.com/devcontainers/templates/tree/main/src/python | ||
| { | ||
| "name": "SpecKitDevContainer", | ||
| // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile | ||
| "image": "mcr.microsoft.com/devcontainers/python:3.13-trixie", // based on Debian "Trixie" (13) | ||
| "features": { | ||
| "ghcr.io/devcontainers/features/common-utils:2": { | ||
| "installZsh": true, | ||
| "installOhMyZsh": true, | ||
| "installOhMyZshConfig": true, | ||
| "upgradePackages": true, | ||
| "username": "devcontainer", | ||
| "userUid": "automatic", | ||
| "userGid": "automatic" | ||
| }, | ||
| "ghcr.io/devcontainers/features/dotnet:2": { | ||
| "version": "lts" | ||
| }, | ||
| "ghcr.io/devcontainers/features/git:1": { | ||
| "ppa": true, | ||
| "version": "latest" | ||
| }, | ||
| "ghcr.io/devcontainers/features/node": { | ||
| "version": "lts" | ||
| } | ||
| }, | ||
|
|
||
| // Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
| "forwardPorts": [ | ||
| 8080 // for Spec-Kit documentation site | ||
| ], | ||
| "containerUser": "devcontainer", | ||
| "updateRemoteUserUID": true, | ||
| "postCreateCommand": "chmod +x ./.devcontainer/post-create.sh && ./.devcontainer/post-create.sh", | ||
| "postStartCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}", | ||
| "customizations": { | ||
| "vscode": { | ||
| "extensions": [ | ||
| "mhutchie.git-graph", | ||
| "eamodio.gitlens", | ||
| "anweber.reveal-button", | ||
| "chrisdias.promptboost", | ||
| // Github Copilot | ||
| "GitHub.copilot", | ||
| "GitHub.copilot-chat", | ||
| // Codex | ||
| "openai.chatgpt", | ||
| // Kilo Code | ||
| "kilocode.Kilo-Code", | ||
| // Roo Code | ||
| "RooVeterinaryInc.roo-cline", | ||
| // Amazon Developer Q | ||
| "AmazonWebServices.amazon-q-vscode", | ||
| // Claude Code | ||
| "anthropic.claude-code" | ||
| ], | ||
| "settings": { | ||
| "debug.javascript.autoAttachFilter": "disabled", // fix running commands in integrated terminal | ||
|
|
||
| // Specify settings for Github Copilot | ||
| "git.autofetch": true, | ||
| "chat.promptFilesRecommendations": { | ||
| "speckit.constitution": true, | ||
| "speckit.specify": true, | ||
| "speckit.plan": true, | ||
| "speckit.tasks": true, | ||
| "speckit.implement": true | ||
| }, | ||
| "chat.tools.terminal.autoApprove": { | ||
| ".specify/scripts/bash/": true, | ||
| ".specify/scripts/powershell/": true | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,100 @@ | ||
| #!/bin/bash | ||
|
|
||
| # Exit immediately on error, treat unset variables as an error, and fail if any command in a pipeline fails. | ||
| set -euo pipefail | ||
|
|
||
| # Function to run a command and show logs only on error | ||
| run_command() { | ||
| local command_to_run="$*" | ||
| local output | ||
| local exit_code | ||
|
|
||
| # Capture all output (stdout and stderr) | ||
| output=$(eval "$command_to_run" 2>&1) || exit_code=$? | ||
|
||
| exit_code=${exit_code:-0} | ||
|
|
||
| if [ $exit_code -ne 0 ]; then | ||
| echo -e "\033[0;31m[ERROR] Command failed (Exit Code $exit_code): $command_to_run\033[0m" >&2 | ||
| echo -e "\033[0;31m$output\033[0m" >&2 | ||
|
|
||
| exit $exit_code | ||
| fi | ||
| } | ||
|
|
||
| # Installing CLI-based AI Agents | ||
|
|
||
| echo -e "\n🤖 Installing Copilot CLI..." | ||
| run_command "npm install -g @github/copilot@latest" | ||
| echo "✅ Done" | ||
|
|
||
| echo -e "\n🤖 Installing Claude CLI..." | ||
| run_command "npm install -g @anthropic-ai/claude-code@latest" | ||
| echo "✅ Done" | ||
|
|
||
| echo -e "\n🤖 Installing Codex CLI..." | ||
| run_command "npm install -g @openai/codex@latest" | ||
| echo "✅ Done" | ||
|
|
||
| echo -e "\n🤖 Installing Gemini CLI..." | ||
| run_command "npm install -g @google/gemini-cli@latest" | ||
| echo "✅ Done" | ||
|
|
||
| echo -e "\n🤖 Installing Augie CLI..." | ||
| run_command "npm install -g @augmentcode/auggie@latest" | ||
| echo "✅ Done" | ||
|
|
||
| echo -e "\n🤖 Installing Qwen Code CLI..." | ||
| run_command "npm install -g @qwen-code/qwen-code@latest" | ||
| echo "✅ Done" | ||
|
|
||
| echo -e "\n🤖 Installing OpenCode CLI..." | ||
| run_command "npm install -g opencode-ai@latest" | ||
| echo "✅ Done" | ||
|
|
||
| echo -e "\n🤖 Installing Amazon Q CLI..." | ||
| # 👉🏾 https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/command-line-verify-download.html | ||
|
|
||
| run_command "curl --proto '=https' --tlsv1.2 -sSf 'https://desktop-release.q.us-east-1.amazonaws.com/latest/q-x86_64-linux.zip' -o 'q.zip'" | ||
| run_command "curl --proto '=https' --tlsv1.2 -sSf 'https://desktop-release.q.us-east-1.amazonaws.com/latest/q-x86_64-linux.zip.sig' -o 'q.zip.sig'" | ||
| cat > amazonq-public-key.asc << 'EOF' | ||
| -----BEGIN PGP PUBLIC KEY BLOCK----- | ||
|
|
||
| mDMEZig60RYJKwYBBAHaRw8BAQdAy/+G05U5/EOA72WlcD4WkYn5SInri8pc4Z6D | ||
| BKNNGOm0JEFtYXpvbiBRIENMSSBUZWFtIDxxLWNsaUBhbWF6b24uY29tPoiZBBMW | ||
| CgBBFiEEmvYEF+gnQskUPgPsUNx6jcJMVmcFAmYoOtECGwMFCQPCZwAFCwkIBwIC | ||
| IgIGFQoJCAsCBBYCAwECHgcCF4AACgkQUNx6jcJMVmef5QD/QWWEGG/cOnbDnp68 | ||
| SJXuFkwiNwlH2rPw9ZRIQMnfAS0A/0V6ZsGB4kOylBfc7CNfzRFGtovdBBgHqA6P | ||
| zQ/PNscGuDgEZig60RIKKwYBBAGXVQEFAQEHQC4qleONMBCq3+wJwbZSr0vbuRba | ||
| D1xr4wUPn4Avn4AnAwEIB4h+BBgWCgAmFiEEmvYEF+gnQskUPgPsUNx6jcJMVmcF | ||
| AmYoOtECGwwFCQPCZwAACgkQUNx6jcJMVmchMgEA6l3RveCM0YHAGQaSFMkguoAo | ||
| vK6FgOkDawgP0NPIP2oA/jIAO4gsAntuQgMOsPunEdDeji2t+AhV02+DQIsXZpoB | ||
| =f8yY | ||
| -----END PGP PUBLIC KEY BLOCK----- | ||
| EOF | ||
| run_command "gpg --batch --import amazonq-public-key.asc" | ||
| run_command "gpg --verify q.zip.sig q.zip" | ||
| run_command "unzip -q q.zip" | ||
| run_command "chmod +x ./q/install.sh" | ||
| run_command "./q/install.sh --no-confirm" | ||
| run_command "rm -rf ./q q.zip q.zip.sig amazonq-public-key.asc" | ||
| echo "✅ Done" | ||
|
|
||
| echo -e "\n🤖 Installing CodeBuddy CLI..." | ||
| run_command "npm install -g @tencent-ai/codebuddy-code@latest" | ||
| echo "✅ Done" | ||
|
|
||
| # Installing UV (Python package manager) | ||
| echo -e "\n🐍 Installing UV - Python Package Manager..." | ||
| run_command "pipx install uv" | ||
| echo "✅ Done" | ||
|
|
||
| # Installing DocFx (for documentation site) | ||
| echo -e "\n📚 Installing DocFx..." | ||
| run_command "dotnet tool update -g docfx" | ||
| echo "✅ Done" | ||
|
|
||
| echo -e "\n🧹 Cleaning cache..." | ||
| run_command "sudo apt-get autoclean" | ||
| run_command "sudo apt-get clean" | ||
|
|
||
| echo "✅ Setup completed. Happy coding! 🚀" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.