surshar / claude-code
Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.
Built by Anthropic · github.com/anthropics
| @@ -1,31 +1,34 @@ | ||
| 1 | -#------------------------------------------------------------------------------ | |
| 2 | -# Script: run_devcontainer_claude_code.ps1 | |
| 3 | -# Author: [Your Name or Project Name] | |
| 4 | -# Description: Automates the setup and connection to a DevContainer environment | |
| 5 | -# using either Docker or Podman on Windows. | |
| 6 | -# | |
| 7 | -# IMPORTANT USAGE REQUIREMENT: | |
| 8 | -# This script MUST be executed from the ROOT directory of your project. | |
| 9 | -# It assumes the script file itself is located in a 'Script' subdirectory. | |
| 10 | -# | |
| 11 | -# Assumed Project Structure: | |
| 12 | -# Project/ | |
| 13 | -# ├── .devcontainer/ | |
| 14 | -# └── Script/ | |
| 15 | -# └── run_devcontainer_claude_code.ps1 <-- This script's location | |
| 16 | -# | |
| 17 | -# How to Run: | |
| 18 | -# 1. Open PowerShell. | |
| 19 | -# 2. Change your current directory to the project root: | |
| 20 | -# cd c:\path\to\your\Project | |
| 21 | -# 3. Execute the script, specifying the container backend: | |
| 22 | -# .\Script\run_devcontainer_claude_code.ps1 -Backend <docker|podman> | |
| 23 | -# | |
| 24 | -# The -Backend parameter is mandatory and accepts 'docker' or 'podman'. | |
| 25 | -#------------------------------------------------------------------------------ | |
| 1 | +<# | |
| 2 | +.SYNOPSIS | |
| 3 | + Automates the setup and connection to a DevContainer environment using either Docker or Podman on Windows. | |
| 4 | + | |
| 5 | +.DESCRIPTION | |
| 6 | + This script automates the process of initializing, starting, and connecting to a DevContainer | |
| 7 | + using either Docker or Podman as the container backend. It must be executed from the root | |
| 8 | + directory of your project and assumes the script is located in a 'Script' subdirectory. | |
| 9 | + | |
| 10 | +.PARAMETER Backend | |
| 11 | + Specifies the container backend to use. Valid values are 'docker' or 'podman'. | |
| 12 | + | |
| 13 | +.EXAMPLE | |
| 14 | + .\Script\run_devcontainer_claude_code.ps1 -Backend docker | |
| 15 | + Uses Docker as the container backend. | |
| 16 | + | |
| 17 | +.EXAMPLE | |
| 18 | + .\Script\run_devcontainer_claude_code.ps1 -Backend podman | |
| 19 | + Uses Podman as the container backend. | |
| 20 | + | |
| 21 | +.NOTES | |
| 22 | + Project Structure: | |
| 23 | + Project/ | |
| 24 | + ├── .devcontainer/ | |
| 25 | + └── Script/ | |
| 26 | + └── run_devcontainer_claude_code.ps1 | |
| 27 | +#> | |
| 26 | 28 | [CmdletBinding()] |
| 27 | 29 | param( |
| 28 | 30 | [Parameter(Mandatory=$true)] |
| 31 | + [ValidateSet('docker','podman')] | |
| 29 | 32 | [string]$Backend |
| 30 | 33 | ) |
| 31 | 34 | |
| @@ -33,13 +36,6 @@ | ||
| 33 | 36 | Write-Host "--- DevContainer Startup & Connection Script ---" |
| 34 | 37 | Write-Host "Using backend: $($Backend)" |
| 35 | 38 | |
| 36 | -# Validate the input backend | |
| 37 | -if ($Backend -notin @('docker', 'podman')) { | |
| 38 | - Write-Error "Invalid backend specified. Please use 'docker' or 'podman'." | |
| 39 | - Write-Host "Usage: ." + $MyInvocation.MyCommand.Definition + " -Backend <docker|podman>" | |
| 40 | - exit 1 | |
| 41 | -} | |
| 42 | - | |
| 43 | 39 | # --- Backend-Specific Initialization --- |
| 44 | 40 | if ($Backend -eq 'podman') { |
| 45 | 41 | Write-Host "--- Podman Backend Initialization ---" |