Repository navigation
Install Git and the GitHub CLI on a brand-new computer (0.0.95) - #288
Conversation
A new user's computer has no Git: macOS has only a stub until Apple's Command Line Tools are installed, Windows has none, and Linux leaves it to the package manager. Agents and GitHub clones need it, and GitHub sign-in needs the GitHub CLI, which stopped with "Could not find gh in your PATH". Installing a harness now first installs Git through each system's own installer (xcode-select, winget, or the package manager through pkexec). GitHub sign-in installs Git and GitHub's release build of gh into ~/.local/bin. Both run through the shared cancellable installer, which replaces the Kimi-only Git step.
|
👋 Hello @glenn-jocher, thank you for submitting a
For more guidance, please refer to our Contributing Guide. Don't hesitate to leave a comment if you have any questions. Thank you for contributing to Ultralytics! 🚀 |
UltralyticsAssistant
left a comment
There was a problem hiding this comment.
🔍 PR Review
Made with ❤️ by Ultralytics Actions
Reviewed Git and GitHub CLI installation, cancellation, and PATH handling. The Windows PATH refresh can introduce a current-directory executable lookup when the User PATH is empty; otherwise, no concrete issue found.
💬 Posted 1 inline comment
- 💡 MEDIUM
src-tauri/src/lib.rs:3509If the Windows User PATH is empty or unset, this concatenation starts with;.user_path()later splits that PATH, andresolve_executable()checks each entry in order; the empty entry resolves against Lite’s current directory, so agit.exeor provider executable there can run ahead of the Machine PATH entry. Build the refreshed PATH from nonempty values and filter empty components before caching it.
📋 Skipped 1 file (lock files, generated, images, etc.)
src-tauri/Cargo.lock
| "-NoProfile", | ||
| "-Command", | ||
| "[Environment]::GetEnvironmentVariable('Path','User')", | ||
| "[Environment]::GetEnvironmentVariable('Path','User') + ';' + [Environment]::GetEnvironmentVariable('Path','Machine')", |
There was a problem hiding this comment.
💡 MEDIUM: If the Windows User PATH is empty or unset, this concatenation starts with ;. user_path() later splits that PATH, and resolve_executable() checks each entry in order; the empty entry resolves against Lite’s current directory, so a git.exe or provider executable there can run ahead of the Machine PATH entry. Build the refreshed PATH from nonempty values and filter empty components before caching it.
There was a problem hiding this comment.
Fixed in 63a8c77: user_path() now drops empty entries, so neither a leading ; nor a ;; inside a PATH can resolve against the current folder.
- macOS asks for Apple's Command Line Tools and goes on without waiting, so a declined prompt no longer holds an install for an hour. - An install turn guards each install and GitHub setup, so two cannot share the cancel slot; ending a turn leaves the slot idle before the next can start. - GitHub sign-in treats Git as best-effort, as harness installs do; Windows also finds Git in its usual folder when Lite's PATH predates it. - Only a first install sets up Git, so updates never ask for a password. - A cancelled root installer is reaped off the main thread, apt refreshes its lists first, and the gh download hides PowerShell's slow progress bar.
…l turn idle - Windows reads its PATH again instead of checking Git's usual folder, so a Git installed while Lite runs is both found and runnable by Lite's own Git calls. - A failed apt-get update no longer stops the Git install. - A turn resets the cancel slot when it starts, so a late Cancel from the last turn cannot stop the next one.
|
🎉 Huge thanks to @glenn-jocher for the merged PR!
This brings Git and GitHub CLI setup together with agent installation and GitHub sign-in, helping Lite handle computers where those tools are missing. |
A new user's computer had no Git, so Lite could not work there. Git and the GitHub CLI are the last things a fresh macOS, Windows, or Linux computer lacks after #287.
Git (agents run it on nearly every task; GitHub clones and worktrees need it)
xcode-select --install(Apple's Command Line Tools), then Lite waits up to an hour forxcode-select -pto succeed.winget install Git.Git.refresh_user_pathnow reads the Machine PATH as well, so Lite finds the newgitwithout restarting.pkexecwith apt-get, dnf, zypper, or pacman, whichever exists.GitHub CLI
prepare_githubfirst, which installs Git and then unpacks GitHub's release build ofgh(latest tag from the releases API, archive for this OS and architecture) into~/.local/bin, with no administrator needed. A toast with Cancel appears if setup takes more than half a second.Shared installer
install_agentintorun_installer, and the PowerShell/sh wrapper with the curl→wget fallback intoinstaller_shell, so Git, gh, and harness installs share one cancellable path.Validation (macOS)
PATH=/usr/bin:/bin, installsgh version 2.103.3.xcode-select,dnf, and no-manager PATHs, behave as intended.cargo clippy,cargo fmt --check,cargo test,bun run check, andbun testpass.🛠️ PR Summary
Made with ❤️ by Ultralytics Actions
🌟 Summary
Lite now prepares Git before installing an agent and sets up the GitHub CLI before GitHub sign-in, supporting computers where those tools are missing.
📊 Key Changes
winget, and Linux viapkexecwith supported package managers; Git setup is best-effort for agent installs.prepare_github, which checks for GitHub CLI and, if missing, downloads the latest release for the current OS and architecture into~/.local/bin.🎯 Purpose & Impact
📋 Skipped 1 file (lock files, generated, images, etc.)
src-tauri/Cargo.lock