Skip to content

Commit df34a01

Browse files
authored
Merge pull request #29 from alex-feel/alex-feel-dev
Add Git Bash support for claude-python command on Windows
2 parents 6043084 + 4720a8f commit df34a01

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

scripts/README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ Complete Python development environment that installs:
126126
- /test (test generation)
127127
- **Python developer system prompt** with SOLID, DRY, KISS, YAGNI principles
128128
- **Context7 MCP server** for up-to-date library documentation
129-
- **Global `claude-python` command** for quick Python-focused sessions
129+
- **Global `claude-python` command** that works in all terminals (PowerShell, CMD, Git Bash)
130130

131131
## 🔧 Script Options
132132

@@ -193,6 +193,8 @@ chmod +x setup-python-environment.sh
193193
- **Python Version**: Requires Python 3.12+ (automatically handled by uv)
194194
- **Package Manager**: Uses uv for fast, reliable Python management
195195
- **Windows**: PowerShell 5.1+ for bootstrap, full Windows 10/11 support
196+
- `claude-python` command works in PowerShell, CMD, and Git Bash
197+
- Automatic creation of both .cmd and bash wrappers
196198
- **Linux**: Bash 4.0+ for bootstrap, tested on Ubuntu, Debian, Fedora, Arch
197199
- **macOS**: Compatible with macOS 10.15+ (Catalina and later)
198200

@@ -203,6 +205,10 @@ chmod +x setup-python-environment.sh
203205
- **Intelligent Path Management**: Automatic PATH configuration
204206
- **Git Bash Detection**: Multiple detection strategies on Windows
205207
- **Node.js Management**: Automatic LTS installation if needed
208+
- **Cross-Terminal Support**: Windows commands work in all terminal types
209+
- Creates both .cmd files for PowerShell/CMD
210+
- Creates bash wrappers for Git Bash compatibility
211+
- Single `claude-python` command works everywhere
206212

207213
### Error Handling
208214

scripts/setup-python-environment.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,18 @@ def register_global_command(launcher_path: Path) -> bool:
407407
batch_content = f'@echo off\npowershell -NoProfile -ExecutionPolicy Bypass -File "{launcher_path}" %*'
408408
batch_path.write_text(batch_content)
409409

410+
# Also create a bash wrapper for Git Bash compatibility
411+
bash_wrapper_path = local_bin / 'claude-python'
412+
bash_content = '''#!/bin/bash
413+
# Bash wrapper for claude-python to work in Git Bash
414+
exec ~/.local/bin/claude-python.cmd "$@"
415+
'''
416+
bash_wrapper_path.write_text(bash_content, newline='\n') # Use Unix line endings
417+
# Make it executable (Git Bash respects this even on Windows)
418+
bash_wrapper_path.chmod(0o755)
419+
420+
info('Created both .cmd (for PowerShell/CMD) and bash wrapper (for Git Bash)')
421+
410422
# Add .local/bin to PATH if not already there
411423
user_path = os.environ.get('PATH', '')
412424
local_bin_str = str(local_bin)
@@ -434,7 +446,10 @@ def register_global_command(launcher_path: Path) -> bool:
434446
info('Add this to your ~/.bashrc or ~/.zshrc if needed:')
435447
info(' export PATH="$HOME/.local/bin:$PATH"')
436448

437-
success('Created global command: claude-python')
449+
if system == 'Windows':
450+
success('Created global command: claude-python (works in PowerShell, CMD, and Git Bash)')
451+
else:
452+
success('Created global command: claude-python')
438453
return True
439454

440455
except Exception as e:

0 commit comments

Comments
 (0)