fix: add cross-platform commit helper to resolve heredoc issues #277
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #274 - Git commit fails on Windows PowerShell due to heredoc syntax issues and improper shell detection.
This PR provides a comprehensive two-part solution to resolve cross-platform terminal execution issues:
Root Cause Analysis
The issue had two components:
cmd.exe, ignoring the actual shell (PowerShell)<<'EOF') doesn't work in any Windows shell (cmd.exe or PowerShell)Part 1: Cross-Platform Commit Helper
scripts/commit-helper.ts: Cross-platform commit script using temporary files instead of heredocs"commit": "bun scripts/commit-helper.ts"for easy access vianpm run commit "message"backend/src/system-prompt/prompts.tsto instruct AI agents to use the commit helperPart 2: PowerShell Detection Fix
npm-app/src/terminal/background.ts: Add proper shell detection usingdetectShell()sdk/src/tools/run-terminal-command.ts: Apply same detection logic to SDK-Commandfor PowerShell and/cfor cmd.exedetectShell()functionHow it works
Commit Helper:
git commit -F tempfileto read the messageShell Detection:
Usage
Benefits
This comprehensive solution ensures AI agents can create proper multi-line commits regardless of the operating system or shell environment.
🤖 Generated with Claude Code