Skip to content

Added --auto feature for non-tty#11

Open
3dyuval wants to merge 7 commits into
redraw:mainfrom
3dyuval:main
Open

Added --auto feature for non-tty#11
3dyuval wants to merge 7 commits into
redraw:mainfrom
3dyuval:main

Conversation

@3dyuval
Copy link
Copy Markdown

@3dyuval 3dyuval commented Nov 1, 2025

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

@redraw
Copy link
Copy Markdown
Owner

redraw commented Nov 1, 2025

hey thanks! I'll test first and merge

@3dyuval
Copy link
Copy Markdown
Author

3dyuval commented Nov 26, 2025

hey thanks! I'll test first and merge

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

@redraw
Copy link
Copy Markdown
Owner

redraw commented Nov 27, 2025

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
Copy link
Copy Markdown
Owner

redraw commented Nov 28, 2025

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

@3dyuval
Copy link
Copy Markdown
Author

3dyuval commented Dec 4, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Non-interactive version?

2 participants