Repository navigation
feat: default to prod, fix cross-platform config writes, support Windows installs - #54
Merged
Merged
Conversation
…ows installs Addresses issues found while testing the gddy alpha on Windows: - Default environment is now `prod` everywhere (was `ote`). Adds a `DEFAULT_ENV` const and flips the `api_url_for` fallback so prod is the consistent default. - `.gdenv` is resolved via `dirs::home_dir()` (`%USERPROFILE%` on Windows) instead of `$HOME`-with-`/tmp`-fallback, fixing `gddy env set` failing with "os error 3" on Windows. - `env set <ENV>` positional no longer collides with the global `--env` flag (shared arg id `env`), so it correctly honors its argument. Renamed the positional to id `environment`. - install.sh now supports Git Bash / MSYS2 / Cygwin: it fetches the x86_64-pc-windows-msvc .zip and extracts gddy.exe (unzip or PowerShell Expand-Archive). - Adds install.ps1, a native PowerShell installer, published as a release asset and documented in the README. - Ignores Claude Code local runtime state under .claude/. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the Rust-port gddy CLI to default to prod, fixes cross-platform .gdenv handling and env set argument parsing, and adds Windows installation support (Git Bash/MSYS/Cygwin via install.sh plus native PowerShell via new install.ps1), with corresponding release workflow and docs updates.
Changes:
- Default environment switched to
prodvia a sharedDEFAULT_ENVconstant and updated fallbacks. .gdenvpath resolution made cross-platform usingdirs::home_dir(), andenv set <ENV>positional arg no longer collides with global--env.- Windows install support added:
install.shgains Windows ZIP extraction/install logic; newinstall.ps1added; workflow and README updated accordingly.
Reviewed changes
Copilot reviewed 7 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| rust/src/main.rs | Switches global --env default to use DEFAULT_ENV (now prod). |
| rust/src/env/mod.rs | Adds DEFAULT_ENV, uses dirs::home_dir() for .gdenv, fixes env set arg id collision, updates prod/ote URL fallback behavior. |
| rust/Cargo.toml | Adds dirs dependency for cross-platform home directory resolution. |
| rust/Cargo.lock | Locks new dirs dependency and transitive updates. |
| README.md | Documents Windows install via PowerShell and clarifies installer support. |
| install.sh | Adds Windows (Git Bash/MSYS/Cygwin) support: platform detection, ZIP extraction, installs gddy.exe. |
| install.ps1 | New native PowerShell installer that downloads, checksum-verifies, installs, and updates user PATH. |
| .gitignore | Ignores Claude Code per-machine runtime state files. |
| .github/workflows/rust-port-alpha.yaml | Publishes install.ps1 alongside existing release assets. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Addresses Copilot review on PR #54: - get_env() now ignores empty or unrecognized .gdenv values so a corrupted / hand-edited file falls back to DEFAULT_ENV instead of propagating an unknown environment. - install.sh checks for `tar` before extracting the unix archive (the preflight no longer hard-requires tar, since the Windows path uses unzip/PowerShell). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…exit) Addresses the second Copilot review pass on PR #54: - install.sh: escape `'` as `''` before embedding the extraction paths in the PowerShell single-quoted Expand-Archive command, so a path containing an apostrophe can't break out of the string literal. - install.ps1: `Die` now uses `throw` instead of `exit 1`. The documented install is `irm ... | iex`, which runs in the caller's session, where `exit` would close their terminal. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Addresses the third Copilot review pass on PR #54: set_env now wraps the std::fs::write error to prepend the resolved (platform-dependent) path, so a failure surfaces an actionable message instead of a bare "os error N". Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Addresses the fourth Copilot review pass on PR #54: the autogenerated alpha-notes.md now lists the Windows PowerShell one-liner (irm ... | iex) alongside the existing curl|bash one-liner, matching the README and the newly published install.ps1 asset. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Addresses the fifth Copilot review pass on PR #54: under Git Bash/MSYS2/Cygwin, /usr/local/bin is usually not user-writable and there's no sudo, so the default install would fail. When OS=windows and --prefix isn't given, default to %LOCALAPPDATA%\Programs\gddy (matching install.ps1), falling back to $HOME/bin. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Addresses the sixth Copilot review pass on PR #54: - install.ps1: resolve the default prefix in the body (not the param default), falling back LOCALAPPDATA -> USERPROFILE and erroring via Die if both are unset, instead of throwing inside Join-Path before Die is usable. - install.sh: guard the $HOME fallback under `set -u` (LOCALAPPDATA -> HOME -> actionable error) instead of an unbound-variable crash. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Addresses the seventh Copilot review pass on PR #54: the --help text now contrasts the macOS/Linux default (/usr/local/bin) with the Windows default (%LOCALAPPDATA%\Programs\gddy). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Collaborator
Author
|
No approvals 😞. Merging anyway. Hopefully get better participation in the future so we can more quickly. |
This was referenced Aug 12, 2026
This was referenced Aug 19, 2026
This was referenced Sep 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 issues surfaced while testing the
gddyalpha on Windows (WSL build verified locally: Windows Credential Manager token storage works, prod default works).ote→prodeverywhere. Adds aDEFAULT_ENVconst (rust/src/env/mod.rs), updates the global--envflag default (rust/src/main.rs), and flips theapi_url_forfallback so prod is the consistent default. Breaking change from the legacy CLI — intentional..gdenv: resolved viadirs::home_dir()(%USERPROFILE%on Windows) instead of reading$HOMEwith a/tmpfallback. Fixesgddy env setfailing on Windows withfailed to write ~/.gdenv: ... (os error 3).env set <ENV>arg fix: the positional shared arg id"env"with the global--envflag, soenv set otewas ignoring its argument and writing the flag default. Renamed the positional to idenvironment.install.shnow detects Git Bash / MSYS2 / Cygwin and installs thex86_64-pc-windows-msvcgddy.exefrom the.zip(viaunzipor PowerShellExpand-Archive). Addsinstall.ps1, a native PowerShell installer, published as a release asset (rust-port-alpha.yaml) and documented in the README..claude/.Verification
cargo fmt,cargo clippy -- -D warnings,cargo test(114 passing),cargo build— all green on Linux.gddy env get/env inforeportprod;env set prod/env set otewrite.gdenvcorrectly.x86_64-pc-windows-msvclocally (cargo-xwin); the resultinggddy.exeruns on Windows, defaults to prod, writes%USERPROFILE%\.gdenvwithout error, and stores credentials in Windows Credential Manager.🤖 Generated with Claude Code