GitHub Codespaces Dev Environment
Git-Ape includes a ready-to-use dev container configuration so you can start contributing or using the project instantly in GitHub Codespaces (or any dev container-compatible tool like VS Code Dev Containers).
Quick Startโ
Option 1: GitHub Codespaces (recommended)โ
- Navigate to the Git-Ape repository.
- Click Code โ Codespaces โ Create codespace on main.
- Wait for the container to build and the post-create setup to finish.
- Sign in to Azure with
az loginwhen prompted.
Option 2: VS Code Dev Containers (local)โ
- Install Docker Desktop and the Dev Containers extension.
- Clone the repository and open it in VS Code.
- When prompted, click Reopen in Container (or run the command
Dev Containers: Reopen in Container). - Sign in to Azure with
az login.
What's Includedโ
Base Imageโ
mcr.microsoft.com/devcontainers/base:ubuntu โ a lightweight Ubuntu image maintained by Microsoft.
Dev Container Featuresโ
| Feature | Version | Purpose |
|---|---|---|
| Azure CLI | latest | Azure resource management and deployments |
| GitHub CLI | latest | PR creation, issue management, workflow dispatch |
| Python | 3.12 | Checkov IaC scanner and scripting |
| Node.js | 20 | Tooling and automation scripts |
| PowerShell | latest | PSRule, ARM-TTK, and Azure PowerShell modules |
| Common utilities | โ | Zsh with Oh My Zsh as default shell |
Post-Create Setupโ
The post-create.sh script runs automatically after the container is built and installs:
- Checkov โ IaC security scanner supporting ARM, Bicep, and Terraform templates.
- PSRule for Azure โ WAF-aligned validation rules for ARM and Bicep templates.
- ARM-TTK โ Microsoft's ARM Template Test Toolkit for template validation.
- Website dependencies โ
npm installin thewebsite/directory for Docusaurus docs.
VS Code Tasksโ
Pre-configured tasks are available via Terminal โ Run Task (or โงโB):
| Task | What it does |
|---|---|
| Docs: Dev Server | Starts Docusaurus in hot-reload mode on port 3333 |
| Docs: Build (local) | Generates docs and builds with baseUrl=/ for local preview |
| Docs: Build (production) | Generates docs and builds with baseUrl=/git-ape/ for GitHub Pages |
| Docs: Serve | Builds locally and serves the static output on port 3333 |
| Docs: Generate | Runs generate-docs.js to regenerate auto-generated pages |
| Docs: Install | Installs website npm dependencies |
VS Code Extensionsโ
The following extensions are automatically installed in the container:
| Extension | Purpose |
|---|---|
| GitHub Copilot | AI coding assistant |
| GitHub Copilot Chat | Chat-based AI assistance |
| Azure Resource Groups | Browse and manage Azure resource groups |
| Azure Functions | Develop and deploy Azure Functions |
| Azure MCP Server | Azure MCP integration for Copilot agents |
| PSRule | Run PSRule validation from VS Code |
VS Code Settingsโ
The Azure MCP server is preconfigured with:
azureMcp.serverMode:namespaceโ organizes tools by Azure service.azureMcp.readOnly:falseโ allows read and write operations.
After Setupโ
Once the environment is ready:
- Sign in to Azure: Run
az loginto authenticate. For Codespaces,az login --use-device-codeworks best. - Verify the setup: Run
az account showto confirm your subscription. - Start using Git-Ape: Open Copilot Chat and try
@git-ape deploy a Python function app.
Customizationโ
To add features or tools to the dev container:
- Dev container features: Add entries to the
featuresobject in.devcontainer/devcontainer.json. - Post-create tools: Add installation commands to
.devcontainer/post-create.sh. - VS Code extensions: Add extension IDs to
customizations.vscode.extensionsin.devcontainer/devcontainer.json.
Troubleshootingโ
| Issue | Solution |
|---|---|
| Codespace build fails | Check the creation log for errors. Common cause: feature version conflicts. |
az login fails in Codespaces | Use az login --use-device-code for browser-based auth. |
| ARM-TTK not found | Run pwsh and verify the profile loaded: Get-Module arm-ttk -ListAvailable. |
| Checkov not found | Run pip install --user checkov manually. |
| Extensions missing | Reload the window (Ctrl+Shift+P โ Developer: Reload Window). |
| Docs site broken locally | Make sure you use the Docs: Build (local) task or set DOCUSAURUS_BASE_URL=/ before building. The production build uses /git-ape/ as the base path. |
| Port 3333 already in use | Run lsof -ti:3333 | xargs kill -9 to free the port. |