Skip to content

Comments

Add Windows PowerShell support, .env config, and dependency auto-install#3

Open
adam110th wants to merge 1 commit intos2-streamstore:mainfrom
adam110th:windows-powershell-support
Open

Add Windows PowerShell support, .env config, and dependency auto-install#3
adam110th wants to merge 1 commit intos2-streamstore:mainfrom
adam110th:windows-powershell-support

Conversation

@adam110th
Copy link

Summary

  • Windows PowerShell scripts: Full ports of install.sh, uninstall.sh, and statusline.sh as .ps1 equivalents — no jq dependency on Windows (uses native ConvertFrom-Json/ConvertTo-Json)
  • .env file support: All scripts (bash and PowerShell) now read ANTHROPIC_API_KEY from .env files as an additional key source, with single-quoted value format
  • Interactive dependency auto-install: When missing dependencies are detected, install scripts offer to download and install them (uv via official script, jq/curl via detected package manager)

New Files

File Description
install.ps1 Windows installer — identical behavior to install.sh, native JSON, ANSI colors
uninstall.ps1 Windows uninstaller — manifest, confirm, clean removal
statusline.ps1 Status line + cached background poller via Invoke-RestMethod and Start-Process -WindowStyle Hidden
.gitignore Python, bash, IDE, OS, secrets patterns
.env.example Commented template: ANTHROPIC_API_KEY='sk-ant-your-key-here'

Modified Files

File Changes
install.sh .env reading, SCRIPT_DIR moved before key resolution, interactive dep auto-install
statusline.sh .env fallback in background poller
README.md Windows install/uninstall sections, updated options table, file tree, Windows troubleshooting

Design Decisions

  • Native PowerShell JSON — eliminates jq dependency on Windows
  • Same export ANTHROPIC_API_KEY="..." env file format — cross-platform compatibility
  • ANSI via [char]27 — works in Windows Terminal and modern PowerShell
  • Start-Process -WindowStyle Hidden with -Poll self-invocation — replaces & disown for background polling
  • Atomic writes — temp file + Move-Item -Force (same pattern as bash)

Test plan

  • .\install.ps1 -Help — verified help output
  • .\install.ps1 -ApiKey test-key -Unattended — full install flow completes
  • .\uninstall.ps1 -PurgeData -Unattended — full uninstall flow completes
  • echo '{"model":"claude-opus","contextPercent":42,"cost":"1.23"}' | powershell -File statusline.ps1 — outputs [Opus] | 42% | $1.23
  • End-to-end: install, submit a batch job, verify statusline polling

🤖 Generated with Claude Code

New files:
- install.ps1: Windows installer (full port of install.sh)
- uninstall.ps1: Windows uninstaller (full port of uninstall.sh)
- statusline.ps1: Windows status line + cached poller
- .gitignore: Python, bash, IDE, OS, and secrets patterns
- .env.example: Template with single-quoted API key format

Key design decisions:
- Native PowerShell JSON (ConvertFrom-Json/ConvertTo-Json) eliminates
  jq dependency on Windows
- Same export ANTHROPIC_API_KEY="..." env file format for cross-platform
  compatibility; PS scripts parse it with regex
- ANSI escape codes via [char]27 for modern Windows Terminal
- Background polling via Start-Process -WindowStyle Hidden with
  self-invocation (-Poll switch), replacing bash's fork+disown
- Atomic file writes via temp file + Move-Item -Force

Enhancements to existing scripts:
- install.sh/install.ps1: Read API key from .env files (script dir and
  cwd), offer interactive dependency auto-install (uv via official
  script, jq/curl via detected package manager)
- statusline.sh/statusline.ps1: Read API key from .env as fallback
- README.md: Windows install/uninstall sections, updated options table,
  file locations tree, and Windows troubleshooting

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant