Mac 开发环境配置Mac development setup
一份可复用的 Mac 初始化清单:先完成 Homebrew、Mise、Node.js 与 Claude Code 四步,其余软件按需挑选。命令都能直接复制,数据可以下载。A reusable Mac setup checklist: finish Homebrew, Mise, Node.js and Claude Code first, then pick the rest as needed. Every command can be copied and the data can be downloaded.
四步起步Four-step bootstrap
- 01
Homebrew
先确认包管理器可用,后续工具才有统一、可检查的安装入口。Verify the package manager first so later tools have one consistent, inspectable install path.
官方文档Docsxcode-select --install /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"xcode-select --install export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git" export HOMEBREW_API_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/api" export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles" git clone --depth=1 https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/install.git brew-install /bin/bash brew-install/install.sh检查Verifybrew --version - 02
Mise
Mise 官方推荐用 mise.run 安装独立版本(装到 ~/.local/bin,可用 mise self-update 更新),装好后在 ~/.zshrc 里启用;中国大陆访问 GitHub 较慢时,可改用 Homebrew 镜像安装。Mise recommends its standalone installer from mise.run (installs to ~/.local/bin and updates with mise self-update); activate it in ~/.zshrc. If GitHub is slow from mainland China, install it from the Homebrew mirror instead.
官方文档Docscurl https://mise.run | sh echo 'eval "$(~/.local/bin/mise activate zsh)"' >> ~/.zshrc exec zshHOMEBREW_API_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/api \ HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles \ brew install mise检查Verifymise --version - 03
Node.js
通过 Mise 安装 Node.js,不要把系统自带环境和 Agent CLI 的运行时混在一起。Install Node.js through Mise instead of mixing agent runtimes with the system environment.
mise use -g node@26检查Verifynode --version npm --version - 04
Claude Code
通过 Mise 管理的 npm 安装 Claude Code;不要使用 sudo,并在首次启动时按官方流程登录。Install Claude Code with Mise-managed npm. Do not use sudo; follow the official sign-in flow on first launch.
npm install -g @anthropic-ai/claude-code检查Verifyclaude doctor claude
brew update
brew doctor
brew search mise
brew info mise交给 AgentHand off to an agent
起步四步完成后,把下面这段发给 Agent,让它按你的用途逐项推荐、确认后再安装。After the four steps, send this to your agent so it recommends items for your use cases and installs only what you approve.
请把本站剩余软件当作候选清单,不要全部直接安装。
先完成以下工作:
1. 询问我的用途和偏好;
2. 列出建议安装的软件、推荐理由、官网、安装命令和所需权限;
3. 标记会修改 Shell、网络、系统扩展或登录项的操作;
4. 等待我逐项确认。
只有在我确认后,才执行对应命令。不要安装未确认的软件,也不要更改与当前任务无关的配置。Treat the remaining software on this site as candidates, not an install-all list.
First:
1. Ask about my use cases and preferences.
2. List the software you recommend, why, its official site, install command, and required permissions.
3. Flag anything that changes the shell, network, system extensions, or login items.
4. Wait for my item-by-item approval.
Run a command only after I approve it. Do not install unapproved software or change configuration unrelated to the current task.运行时Runtimes
用 Mise 统一管理语言版本;下面这条命令按推荐版本一次装好,也可以只取需要的部分。Mise manages every language version. The command below installs the recommended versions in one go; keep only the parts you need.
mise use -g node@26 python@3.14 go@1.27 java@corretto-25 bun@latest pnpm@latest rust@latest镜像源Package mirrors
跟随上方的网络环境切换;写入文件的片段注明了目标路径。Follows the network switch above. Snippets that go into a file name their target path.
Node.js + npm
同时设置 Mise 的 Node.js 下载地址与 npm 包注册表。Sets both Mise's Node.js download mirror and the npm package registry.
官方文档Docsmise settings unset node.mirror_url npm config set registry https://registry.npmjs.org/mise settings node.mirror_url https://npmmirror.com/mirrors/node/ npm config set registry https://registry.npmmirror.com/Python + pip
通过 pip 用户配置切换 Python 包索引。Switches the Python package index through pip's user configuration.
官方文档Docspython -m pip config set global.index-url https://pypi.org/simplepython -m pip config set global.index-url https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simpleGo Modules
使用 go env 持久化模块代理,保留 direct 回退。Persists the module proxy with go env while retaining a direct fallback.
官方文档Docsgo env -w GOPROXY=https://proxy.golang.org,directgo env -w GOPROXY=https://goproxy.cn,directJava + Maven
将片段放入 ~/.m2/settings.xml 的 <mirrors> 节点。Place the snippet inside the <mirrors> node in ~/.m2/settings.xml.
官方文档Docs写入 ~/.m2/settings.xmlAdd to ~/.m2/settings.xml<mirror> <id>central</id> <mirrorOf>central</mirrorOf> <url>https://repo.maven.apache.org/maven2</url> </mirror><mirror> <id>aliyunmaven</id> <mirrorOf>*</mirrorOf> <url>https://maven.aliyun.com/repository/public</url> </mirror>Bun
写入项目 bunfig.toml,或改为全局 ~/.bunfig.toml。Use in a project bunfig.toml or the global ~/.bunfig.toml.
官方文档Docs写入 ~/.bunfig.tomlAdd to ~/.bunfig.toml[install] registry = "https://registry.npmjs.org/"[install] registry = "https://registry.npmmirror.com/"pnpm config set registry https://registry.npmjs.org/pnpm config set registry https://registry.npmmirror.com/Rust + Cargo
将片段放入 ~/.cargo/config.toml;镜像使用 Sparse Index。Place the snippet in ~/.cargo/config.toml; the mirror uses Cargo's sparse index.
官方文档Docs写入 ~/.cargo/config.tomlAdd to ~/.cargo/config.toml[source.crates-io] registry = "sparse+https://index.crates.io/"[source.crates-io] replace-with = "rsproxy-sparse" [source.rsproxy-sparse] registry = "sparse+https://rsproxy.cn/index/"
Agent CLIAgent CLIs
- 直接执行Direct execution
- ama、Codex、Claude Code、OpenCode、Gemini、Copilot 与 Cursor Agent 直接读取、修改和运行项目代码。ama, Codex, Claude Code, OpenCode, Gemini, Copilot, and Cursor Agent read, modify, and run project code directly.
- 会话与界面Sessions and interface
- Herdr 保持 Agent 终端会话,T3 Code 提供统一控制界面。Herdr keeps agent terminals alive; T3 Code provides one control surface.
- 任务协作Task coordination
- ama 既能独立编码,也能作为协调 Agent 工作,可嵌入 Armadra;Multica 负责把任务分配给已安装的 Agent,并跟踪执行进度。ama codes on its own or works as a coordination agent, and can be embedded in Armadra; Multica assigns work to installed agents and tracks progress.
npm install -g @armadra/agentnpm install -g @openai/codexnpm install -g @anthropic-ai/claude-codenpm install -g @github/copilotnpm install -g @google/gemini-climise use -g github:anomalyco/opencodenpm install -g --ignore-scripts @earendil-works/pi-coding-agent软件清单Software
这是候选清单,不建议全部安装。标「常用」的是我在用的,Brewfile 里默认只启用这些。A list of candidates, not an install-all list. Items marked “Daily” are the ones I use; only these are enabled in the Brewfile.
brew install bashbrew install zshbrew install starshipbrew install tmuxbrew install zsh-autosuggestionsbrew install zsh-history-substring-searchbrew install zsh-syntax-highlightingbrew install fzfbrew install zoxidebrew install --cask iterm2open https://otty.sh/brew install --cask font-sauce-code-pro-nerd-fontbrew install cmakebrew install dockerbrew install docker-completionbrew install gitbrew install ghbrew install harfbuzzbrew install mysql-clientbrew install open-mpibrew install protobufbrew install ruffbrew install sccbrew install unixodbcbrew install uvbrew install wgetcurl https://mise.run | shbrew install ripgrepbrew install git-filter-repobrew install --cask android-platform-toolsbrew install herdrbrew install multica-ai/tap/multicabrew install --cask chatgptbrew install --cask claudebrew install --cask opencode-desktopbrew install --cask t3-codebrew install --cask antigravitybrew install --cask cherry-studiobrew install --cask codexbarbrew install --cask intellij-ideabrew install --cask visual-studio-codebrew install --cask zedbrew install --cask sublime-textbrew install --cask apifoxbrew install --cask another-redis-desktop-managerbrew install --cask proxymanbrew install --cask drawiobrew install --cask typorabrew install --cask obsidianbrew install --cask cursorbrew install molebrew install --cask appcleanerbrew install --cask balenaetcherbrew install --cask betterdisplaybrew install --cask monitorcontrolbrew install --cask mosbrew install --cask rectanglebrew install --cask hapigobrew install --cask iinabrew install --cask orbstackbrew install --cask parallelsbrew install --cask pdf-expertbrew install --cask piclistbrew install --cask clash-partybrew install --cask stashbrew install --cask surgebrew install --cask tailscalebrew install --cask google-chromebrew install --cask qqmusicbrew install --cask qqbrew install --cask tencent-meeting命令为页面原样记录,执行前请对照官网确认;软件清单是候选,不建议全部安装。Commands are recorded as published; check each official site before running. The software list is a set of candidates, not an install-all list.