A Homebrew formula to install GitHub Copilot CLI on macOS. This repository provides an easy way to manage GitHub Copilot's command-line tool via Homebrew.
# Install
brew tap thesmokinator/copilot-cli
brew install copilot-cli
# Use it
copilot --helpThe copilot-cli.rb script is a Homebrew formula that automates the installation of GitHub Copilot CLI. Homebrew is a package manager for macOS that simplifies installation and management of command-line applications.
- Defines metadata: specifies the package name, description, NPM package URL, and SHA256 checksum for integrity verification
- Declares dependencies: requires Node.js as a prerequisite
- Installs the package: downloads and installs the
@github/copilotpackage from NPM - Creates executable link: copies the executable to Homebrew's
bindirectory, making it available system-wide - Verifies installation: runs automated tests to confirm the tool works correctly
Before installing, ensure you have:
- macOS (Intel or Apple Silicon)
- Homebrew installed (get it here)
- Node.js (v14 or higher; will be installed automatically if missing)
# Add the tap (one-time setup)
brew tap thesmokinator/copilot-cli
# Install Copilot CLI
brew install copilot-cli
# Verify installation
copilot --version# Clone the repository
git clone https://github.com/thesmokinator/homebrew-copilot-cli.git
cd homebrew-copilot-cli
# Install from local formula
brew install ./copilot-cli.rb
# Verify installation
copilot --versionAfter installation, confirm everything works:
copilot --version
copilot --help# Display general help
copilot --help
# Show version
copilot --version# Explain code or concepts
copilot explain "your question here"
# Generate code suggestions
copilot suggest "describe what you need"
# Ask Copilot questions
copilot ask "how do I use X in JavaScript?"To update the Homebrew formula to a new version of the Copilot CLI:
- Find the new version number from the NPM package
- Update the
urlincopilot-cli.rbto point to the new tarball - Calculate the new SHA256 hash:
curl -sL https://registry.npmjs.org/@github/copilot/-/copilot-<version>.tgz | shasum -a 256Replace <version> with the actual version number (e.g., 0.0.395).
- Update the
sha256incopilot-cli.rbwith the calculated hash - Test the formula locally:
brew install --build-from-source ./copilot-cli.rb
copilot --version- Commit and push the changes
To update Copilot CLI to the latest version:
brew upgrade copilot-cliTo remove Copilot CLI:
brew uninstall copilot-cli
# Optional: Remove the tap if you don't need other packages from it
brew untap thesmokinator/copilot-cli# Verify Homebrew installation path
which brew
# Check your shell PATH
echo $PATH
# Add Homebrew to PATH (if needed)
# For Intel Mac:
export PATH="/usr/local/bin:$PATH"
# For Apple Silicon:
export PATH="/opt/homebrew/bin:$PATH"
# Make it permanent by adding to ~/.zshrc or ~/.bash_profile# Install Node.js via Homebrew
brew install node
# Verify installation
node --version
npm --version# Run with proper permissions
brew install copilot-cli --verbose
# If issues persist, try:
brew doctor# Get more detailed information
copilot --help
# Check your version
copilot --version
# Diagnose Homebrew issues
brew doctor| Aspect | Details |
|---|---|
| Package | @github/copilot |
| Current Version | 0.0.358 |
| Source | NPM Registry |
| License | MIT |
| Dependencies | Node.js ≥ v14 |
| Platforms | macOS (Intel & Apple Silicon) |
To report issues or suggest improvements, visit the GitHub repository.
MIT License - see the LICENSE file for details.