Added --auto feature for non-tty
Adds non-interactive mode with automatic platform detection for use in
scripts and CI/CD pipelines.
Examples
# Auto-detect everything (version, OS, architecture, binary name)
gh install cli/cli --auto
# Auto-detect with specific version
gh install cli/cli --auto --version v2.40.0
# Auto-detect with pattern to choose variant
gh install BurntSushi/ripgrep --auto --pattern '*.tar.gz$'
# Auto-detect with custom binary name
gh install sharkdp/fd --auto --name fdfind
Original interactive usage (unchanged)
# Interactive mode still works as before
gh install cli/cli
Closes #5
hey thanks! I'll test first and merge
hey thanks! I'll test first and merge
Hey, will you find it helpful if I test were added?
sorry for the delay, let's test and merge. we might also include a simple integration test and a github action to test in a matrix all archs if possible
just tested on a Apple M1, I guess the issue is because GNU's find is different from the one shipped with MacOS
gh-install on 3dyuval/main:main
❯ gh install cli/cli --auto
[platform] darwin arm64
[version] v2.83.1 (latest)
[filename] gh_2.83.1_macOS_arm64.zip (auto-detected)
[*] Downloading... gh_2.83.1_macOS_arm64.zip
[*] Extracting...
find: -executable: unknown primary or operator
[binary] ./gh_2.83.1_macOS_arm64/LICENSE (auto-detected)
[name] LICENSE (auto-detected)
Success!
Saved in: /Users/agustin/.local/bin/LICENSE
hi! just added a simple test workflow, had to add one in main branch, and rebased with master to let it run here. you'll need to reset --hard your branch
we can the test-matrix locally now, or create a new pull request to run the actions
gh ext install act
echo "-P ubuntu-latest=catthehacker/ubuntu:act-latest \
echo "-P macos-latest=-self-hosted" >> .actrc
gh act --job test