feat: add PowerShell support to wt init#60
Conversation
There was a problem hiding this comment.
확인했습니다. 이번 PR은 Windows/PowerShell 지원에 초점을 맞추는 방향이 더 좋겠습니다. 방향 자체는 좋지만, 현재 상태로는 Windows installer와 release asset 계약이 조금 섞여 있어서 수정 후 다시 보는 게 안전해 보입니다.
-
workflow_dispatch에서 입력받은 tag로 source checkout이 고정되지 않습니다.
Windows installer가 받을 binary를 release asset으로 올리는 구조라면, 수동 재실행 시에도vX.Y.Zrelease에 정확히 해당 tag의 source로 빌드한wt-windows-*.exe가 올라가야 합니다. release event/manual dispatch 양쪽 모두 실제 build source가 release tag와 일치하도록actions/checkout의ref를 명시해 주세요. -
이번 PR의 목적이 Windows installer라면
release-binaries도 Windows asset 생성에만 집중하는 편이 좋아 보입니다.
linux/darwin binary까지 함께 추가하면 “Windows PowerShell 지원”을 넘어 전체 플랫폼 release 배포 정책 변경이 됩니다. Windows용wt-windows-amd64.exe/wt-windows-arm64.exe만 유지하거나, 전체 플랫폼 binary release는 별도 PR로 분리해 주세요. -
install.ps1은 latest release asset을 전제로 하는데, 이 PR이 merge된 직후부터 다음 release가 publish되고 asset upload가 끝나기 전까지 README의 one-line install은 실패할 수 있습니다.
README에 “Windows binary asset이 포함된 다음 release부터 사용 가능”을 명확히 쓰거나, asset missing 상황에서 installer가 더 구체적인 안내를 하도록 해 주세요. -
PowerShell 문서/출력에서
wt init powershell을 그대로 안내하고 있는데, 이 PR의 핵심 문제가 Windows Terminal의wtalias 충돌이라면 같은 문제를 다시 밟을 수 있습니다.
설치 후 흐름은wtp init powershell ...또는& "$env:LOCALAPPDATA\Programs\wt\wt.exe" init powershell ...처럼 충돌을 피하는 예시로 맞추는 게 안전해 보입니다. -
사용자-facing 명령/출력 계약이 바뀌었는데
docs/spec/cli.md가 갱신되지 않았습니다.
wt init <shell>지원 목록에powershell을 추가하고, Windows에서는wtpalias를 쓰는 계약도 spec에 반영해 주세요.
요약하면, 이 PR은 “Windows PowerShell init + Windows installer + Windows release asset” 범위로 좁히는 게 가장 명확해 보입니다. 전체 플랫폼 release binary 자동화는 별도 PR에서 release process 문서와 같이 다루는 편이 리뷰하기 좋겠습니다.
d3557e4 to
b61bd3e
Compare
|
리뷰 감사합니다. 지적해주신 5개 항목 반영해서 PR 범위를 좁히고 force-push 했습니다. 범위 축소: 이번 PR을 개별 응답:
브랜치는 단일 commit ( |
|
반영 감사합니다. 범위 축소와 spec 반영은 좋아 보입니다. 다만 아직 하나 남은 흐름 문제가 있습니다. README는 첫 설정을 절대경로 bootstrap을 지원하려면 init 출력에 현재 실행 중인 그리고 문서에 아직 |
Extends `wt init` with a `powershell` case so Windows users can use the same wtr/wtg/wcd cd helpers as zsh/bash/fish, plus a `wtp` alias to invoke the CLI without colliding with Windows Terminal's `wt` App Execution Alias. The snippet: - Resolves the real wt.exe via `where.exe wt`, skipping any entry inside `\WindowsApps\` (which is where the Windows Terminal alias lives), and caches the result in $Global:WtBin. - Exposes the CLI as `wtp` via `Set-Alias -Scope Global`. Windows users call `wtp list`, `wtp create`, etc. instead of `wt`. - Defines wtr/wtg as `function global:` and `wcd` as a global alias so the helpers survive Invoke-Expression from any scope (e.g. when the snippet is sourced via $PROFILE). The header comment explains that the very first invocation must use the absolute path (e.g. & "$env:USERPROFILE\go\bin\wt.exe" init powershell) because `wt` is still shadowed at that moment; once the snippet has loaded, `wtp init powershell` is safe. Docs: - README adds a Windows section walking through `go install` + the absolute-path bootstrap; adds a `wt` -> `wtp` callout above Quick Start; shows a PowerShell shell-helper block next to the zsh one; enumerates supported shells in the Core Commands table; notes that on Windows `wtp upgrade` is the alias-safe form. - docs/ux/shell.md describes the `where.exe` filter, the wtp alias, and the absolute-path bootstrap step. - docs/ux/agents.md adds a one-line note that Windows PowerShell agents call the CLI as wtp. - docs/spec/cli.md adds powershell to the supported shell list and documents the wtp alias contract. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
b61bd3e to
3b1d6c6
Compare
|
추가 지적 3개 모두 반영해서 force-push 했습니다. 1. PATH 의존성 갭 → fallback embed로 해소
$wtBinFallback = '<os.Executable() 결과>'
$Global:WtBin = $null
foreach ($candidate in (& where.exe wt 2>$null)) {
if ($candidate -notlike '*\WindowsApps\*') { $Global:WtBin = $candidate; break }
}
if (-not $Global:WtBin -and $wtBinFallback -and (Test-Path -LiteralPath $wtBinFallback)) {
$Global:WtBin = $wtBinFallback
}이렇게 하면 2. 남은 raw
3.
브랜치는 여전히 단일 commit( |
es5h
left a comment
There was a problem hiding this comment.
반영 확인했습니다. 범위가 wt init powershell 중심으로 정리됐고, 절대경로 bootstrap 이후 PATH에 Go bin이 없어도 $wtBinFallback으로 동작하는 흐름까지 들어와서 주요 우려는 해소됐습니다.
CI premerge 성공도 확인했습니다.
Summary
wt init에powershell케이스 추가. Windows 사용자가 zsh/bash/fish와 동일한wtr/wtg/wcdcd helper를 쓸 수 있게 하고, Windows Terminal의wtApp Execution Alias 충돌을 피하는wtpalias를 노출.where.exe wt로\WindowsApps\경로를 제외한 첫wt.exe를 찾아$Global:WtBin에 캐시하고,Set-Alias -Scope Global/function global:로 caller scope에 등록.Invoke-Expression어떤 scope에서 호출돼도 동일 동작.docs/ux/shell.md,docs/ux/agents.md,docs/spec/cli.md)에 Windows 흐름과wtp계약 반영.User impact
wt init zsh|bash|fish그대로.go install github.com/crevissepartners/wt/cmd/wt@latest후& "$env:USERPROFILE\go\bin\wt.exe" init powershell >> $PROFILE한 번 →wtp/wtr/wtg/wcd사용 가능.Behavior (examples)
Safety
wt init powershell은 다른 init과 동일하게 output-only. 사용자가 명시적으로Invoke-Expression/>> $PROFILE해야 적용.wt로 안내하지 않고 절대경로 / 부트스트랩 후wtp사용을 명시 (alias 충돌 회피 일관).Tests
go test ./cmd/wt/ -run TestInit(zsh/bash/fish/powershell): PASS.& "$env:USERPROFILE\go\bin\wt.exe" init powershell | Out-String | Invoke-Expression후 같은 셸에서wtp --version,wtp list,wtr,wtg, 에러 경로 모두 정상 동작.\repovs/repo)는 이번 PR과 무관.E2E guide
macOS/Linux:
Docs
wt upgradeWindows 주의, Core Commandswt init <shell>표.where.exealias 회피, 부트스트랩 절대경로.wtp.powershell추가,wtp/$Global:WtBin/function global:계약 명시.Release
feat: ...).CHANGELOG.md/internal/buildinfo/buildinfo.go직접 수정 없음 (release-please 처리 대상).🤖 Generated with Claude Code