gh-install icon indicating copy to clipboard operation
gh-install copied to clipboard

Added --auto feature for non-tty

Open 3dyuval opened this issue 1 month ago • 5 comments

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

3dyuval avatar Nov 01 '25 08:11 3dyuval

hey thanks! I'll test first and merge

redraw avatar Nov 01 '25 18:11 redraw

hey thanks! I'll test first and merge

Hey, will you find it helpful if I test were added?

3dyuval avatar Nov 26 '25 20:11 3dyuval

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

redraw avatar Nov 27 '25 03:11 redraw

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

redraw avatar Nov 28 '25 05:11 redraw

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

3dyuval avatar Dec 04 '25 10:12 3dyuval