Skip to main content

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โ€‹

  1. Navigate to the Git-Ape repository.
  2. Click Code โ†’ Codespaces โ†’ Create codespace on main.
  3. Wait for the container to build and the post-create setup to finish.
  4. Sign in to Azure with az login when prompted.

Option 2: VS Code Dev Containers (local)โ€‹

  1. Install Docker Desktop and the Dev Containers extension.
  2. Clone the repository and open it in VS Code.
  3. When prompted, click Reopen in Container (or run the command Dev Containers: Reopen in Container).
  4. 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โ€‹

FeatureVersionPurpose
Azure CLIlatestAzure resource management and deployments
GitHub CLIlatestPR creation, issue management, workflow dispatch
Python3.12Checkov IaC scanner and scripting
Node.js20Tooling and automation scripts
PowerShelllatestPSRule, 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 install in the website/ directory for Docusaurus docs.

VS Code Tasksโ€‹

Pre-configured tasks are available via Terminal โ†’ Run Task (or โ‡งโŒ˜B):

TaskWhat it does
Docs: Dev ServerStarts 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: ServeBuilds locally and serves the static output on port 3333
Docs: GenerateRuns generate-docs.js to regenerate auto-generated pages
Docs: InstallInstalls website npm dependencies

VS Code Extensionsโ€‹

The following extensions are automatically installed in the container:

ExtensionPurpose
GitHub CopilotAI coding assistant
GitHub Copilot ChatChat-based AI assistance
Azure Resource GroupsBrowse and manage Azure resource groups
Azure FunctionsDevelop and deploy Azure Functions
Azure MCP ServerAzure MCP integration for Copilot agents
PSRuleRun 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:

  1. Sign in to Azure: Run az login to authenticate. For Codespaces, az login --use-device-code works best.
  2. Verify the setup: Run az account show to confirm your subscription.
  3. 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 features object in .devcontainer/devcontainer.json.
  • Post-create tools: Add installation commands to .devcontainer/post-create.sh.
  • VS Code extensions: Add extension IDs to customizations.vscode.extensions in .devcontainer/devcontainer.json.

Troubleshootingโ€‹

IssueSolution
Codespace build failsCheck the creation log for errors. Common cause: feature version conflicts.
az login fails in CodespacesUse az login --use-device-code for browser-based auth.
ARM-TTK not foundRun pwsh and verify the profile loaded: Get-Module arm-ttk -ListAvailable.
Checkov not foundRun pip install --user checkov manually.
Extensions missingReload the window (Ctrl+Shift+P โ†’ Developer: Reload Window).
Docs site broken locallyMake 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 useRun lsof -ti:3333 | xargs kill -9 to free the port.