Installation & Deployment ✅ Beginner

Essential Dev CLI Tools on Mac: Homebrew, GitHub CLI, Firebase CLI, Antigravity CLI

Install the developer command-line tools you actually use on Mac in one go. Lay the foundation with Homebrew, then add GitHub CLI, Firebase CLI, and Google's Antigravity CLI — with login and troubleshooting.

📝 建立:2026年6月25日 ✅ 最後驗證:2026年6月25日
鴨編 卡住很正常——點段落旁的 😵 卡關 讓我們知道,或直接往下滾到問答區發問。 也可以用 👍 看懂 / 😢 看不懂 告訴我們哪裡寫得好、哪裡要改。

Duck Editor Install once, hit fewer snags: On Mac, almost every developer CLI tool installs with a single Homebrew command. This guide lays the foundation first, then walks you through GitHub CLI, Firebase CLI, and Google’s Antigravity CLI. About 12 minutes and your terminal will be fully equipped.

📌 New to the terminal? Start with the CLI Starter Guide to understand what “operating your computer by typing” means — it’ll make this guide go much smoother.


🤔 Why use CLI tools?

Plenty of services have nice web dashboards, but when you’re building, you’ll notice that commands are often faster, repeatable, and easier to automate.

  • gh (GitHub CLI): open PRs, browse issues, clone repos — all in the terminal, no constant browser switching.
  • firebase (Firebase CLI): deploy sites, manage databases, run local emulators in one command.
  • agy (Antigravity CLI): bring Google Antigravity’s AI agent straight into your terminal.

On Mac, the common installer for all of these is Homebrew. Get that set up first and the rest is easy.


🍺 Step 0: Install Homebrew (the foundation)

Homebrew is the de-facto package manager for macOS — think of it as “the App Store for your Mac, but all via commands.”

Open Terminal (search terminal in Spotlight) and paste the official install command:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

💡 On first run it’ll ask for your Mac login password (characters won’t show as you type — that’s normal) and may also install the Xcode Command Line Tools. Just wait for it to finish.

After installing, Apple Silicon (M1/M2/M3/M4) users need to add brew to their PATH, otherwise you’ll hit “command not found”:

echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"

Verify the install:

brew --version

If you see a version number, your foundation is set.


🐙 Step 1: GitHub CLI (gh)

GitHub’s official command-line tool, letting you work with repos, PRs, and issues right from the terminal.

Install

brew install gh

Log in

gh auth login

Follow the prompts: GitHub.comHTTPS → authenticate Git with your credentials → Login with a web browser. The terminal gives you a one-time code and opens your browser — paste the code to authorize.

Verify and common commands

# Check who you're logged in as
gh auth status

# Clone a repo (no full URL needed)
gh repo clone 589411/launchdock

# Open a PR from the current repo
gh pr create

# List issues in the current repo
gh issue list

🔥 Step 2: Firebase CLI (firebase)

Google Firebase’s command-line tool for deploying sites, managing Firestore, and running local emulators.

Install

brew install firebase-cli

💡 Prefer npm? If you already have Node.js, you can use npm install -g firebase-tools. Pick one method — don’t install both or versions will clash.

Log in

firebase login

This opens your browser; choose your Google account and authorize, and the terminal will confirm a successful login.

Verify and common commands

# Check the version
firebase --version

# List projects you can access
firebase projects:list

# Initialize Firebase in your project folder
cd ~/your-project
firebase init

# Deploy
firebase deploy

🚀 Step 3: Antigravity CLI (agy)

The terminal version of Google Antigravity’s AI coding agent, bringing the agent’s reasoning and execution right into your command line.

Install

brew install --cask antigravity-cli

💡 Don’t want Homebrew? There’s also an official install script:

curl -fsSL https://antigravity.google/cli/install.sh | bash

This installs agy to ~/.local/bin/agy by default — make sure that path is on your PATH.

First run and login

Just run:

agy

On first launch it guides you through signing in with your Google account, opening the browser for Google Sign-In (free, AI Pro, and Ultra accounts all work).

Once authorized, return to the terminal and you can start chatting with the agent and assigning tasks from the command line.


🚨 Quick troubleshooting

Issue 1: command not found: brew (or gh / firebase / agy)

Symptom: You installed it, but the shell says the command isn’t found.

Cause: The tool’s executable path isn’t on your PATH — most common with Homebrew on Apple Silicon (installed under /opt/homebrew).

Fix: Run the PATH setup from Step 0, then close and reopen a new Terminal window. If you installed Antigravity via the script, make sure ~/.local/bin is on your PATH too:

echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zprofile
source ~/.zprofile

Issue 2: The browser didn’t open during login

Copy the URL the terminal printed and open it in your browser manually. After authorizing, return to the terminal — it usually detects it within a few seconds.

Issue 3: brew install is stuck or very slow

Usually a network issue. Try brew update first, then retry. On a corporate network with a proxy, check the outbound allowlist with your IT team.


💡 Maintenance: update everything at once

The best part of Homebrew is that all your tools upgrade together:

# Refresh Homebrew's package list
brew update

# Upgrade every installed tool (including gh, firebase, antigravity)
brew upgrade

# Clean up old versions to free space
brew cleanup
# Upgrade a single tool
brew upgrade gh

# Remove a tool
brew uninstall firebase-cli

💡 Make brew update && brew upgrade an occasional habit and your tools stay current — fewer old-version snags.


🔗 Further reading

這篇文章對你有幫助嗎?

💬 問答區

卡關了?直接在這裡問,其他讀者和作者都能幫忙解答。

載入中...