← 返回 Skills 市场
wuhaorui

macos-terminal-beautify

作者 Haorui Wu · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
44
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install macos-terminal-beautify
功能描述
在 macOS 上对终端进行美化,使用 Ghostty + Starship + Oh My Zsh + Nerd Font 组合,实现彩色胶囊提示符终端效果。
使用说明 (SKILL.md)

macOS Terminal Beautify

在 macOS 上对终端进行美化,核心工具链为 Ghostty(终端模拟器)+ Starship(提示符)+ Oh My Zsh(Shell 框架)+ Nerd Font(图标字体),最终实现 Catppuccin Mocha 主题的彩色胶囊提示符。

适用场景

  • 用户要求美化 macOS 终端外观
  • 用户需要配置 Ghostty 终端模拟器
  • 用户需要安装配置 Starship 提示符工具
  • 用户需要安装 Oh My Zsh 及相关插件

安装步骤

1. 安装核心工具

# 安装 Ghostty 终端模拟器
brew install --cask ghostty

# 安装 Starship 提示符
brew install starship

# 安装 Nerd Font 字体(必须,否则图标显示为方框)
brew install --cask font-meslo-lg-nerd-font font-fira-code-nerd-font

如果 brew 遇到 API 缓存问题(如 cask.jws.json 错误),先清除缓存:

rm -rf ~/Library/Caches/Homebrew/api/*.json
brew update

2. 安装 Oh My Zsh

sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended

注意:--unattended 参数避免交互式提示。

3. 安装 Zsh 插件

ZSH_CUSTOM=${ZSH_CUSTOM:-~/.oh-my-zsh/custom}
git clone --depth=1 https://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
git clone --depth=1 https://github.com/zsh-users/zsh-syntax-highlighting $ZSH_CUSTOM/plugins/zsh-syntax-highlighting
git clone --depth=1 https://github.com/zsh-users/zsh-completions $ZSH_CUSTOM/plugins/zsh-completions

4. 配置 Ghostty

编辑 ~/.config/ghostty/config

font-family = MesloLGS Nerd Font Mono
font-size = 14
theme = Catppuccin Mocha
background = #282c34
foreground = #ffffff
background-opacity = 0.95
background-blur = true
window-padding-x = 12
window-padding-y = 12
macos-titlebar-style = tabs
cursor-style = block
cursor-style-blink = true
shell-integration = zsh

配置重载方式:在 Ghostty 中按 Cmd + Shift + , 或重启应用。

验证主题可用性:

ghostty +list-themes | grep -i catppuccin

5. 配置 Starship

编辑 ~/.config/starship.toml,使用 Catppuccin Mocha 调色板:

  • 格式:os -> username -> directory -> git_branch/git_status -> language -> time -> cmd_duration -> character
  • 每个模块使用不同颜色的背景胶囊(红/橙/黄/绿/蓝/紫)
  • 命令提示符 :成功绿色,失败红色
  • 语言模块统一使用绿色背景
  • 确保 Nerd Font 使用正确字体才能显示图标

6. 更新 .zshrc

合并已有配置和新的 Oh My Zsh + Starship 配置:

export ZSH="$HOME/.oh-my-zsh"
ZSH_THEME=""                         # 清空交给 Starship
plugins=(git zsh-autosuggestions zsh-syntax-highlighting)  # syntax-highlighting 必须放最后
fpath+=${ZSH_CUSTOM:-$ZSH/custom}/plugins/zsh-completions/src
source $ZSH/oh-my-zsh.sh

export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8

# 补全优化
autoload -Uz compinit && compinit
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
zstyle ':completion:*' menu select

# Homebrew + Starship
eval "$(/opt/homebrew/bin/brew shellenv)"
eval "$(starship init zsh)"

# 保留原有配置(API keys、PATH 等)
[ -f ~/.zshrc.local ] && source ~/.zshrc.local

7. 自检验证

运行验证脚本 scripts/check_term.sh,检查包括:

  1. Nerd Font 已安装
  2. 图标渲染测试(圆点 icon = OK,方框 = 字体问题)
  3. 工具版本(Starship、Zsh、Ghostty)
  4. 配置文件存在性
  5. 插件安装状态
  6. 环境变量

常见问题

现象 原因 解决
图标显示 □ 字体不是 Nerd Font 终端字体改为 MesloLGS NF Mono
Ghostty 报 theme not found 主题名拼写错误 ghostty +list-themes 查正确名字
历史灰字建议不出现 插件顺序错 zsh-syntax-highlighting 必须放 plugins 最后
compinit 报 insecure 权限问题 compaudit | xargs chmod g-w,o-w

VS Code 集成终端字体配置

如果需要在 VS Code 的集成终端中也正确显示 Nerd Font 图标:

打开 settings.json

  1. Cmd + Shift + P 打开命令面板
  2. 输入 settings.json,选择 "首选项:打开设置 (JSON)"

添加字体配置

{ } 花括号内添加:

"terminal.integrated.fontFamily": "MesloLGS Nerd Font Mono",

保存后 VS Code 的集成终端即可正确显示所有 Nerd Font 图标。

最终效果

终端美化效果

安全使用建议
This appears safe for its stated purpose if you want to customize a macOS terminal. Before installing, review the remote Oh My Zsh installer, back up your ~/.zshrc, and run the setup commands manually so you can stop if any command does something unexpected.
能力评估
Purpose & Capability
The artifacts consistently describe macOS terminal beautification using Ghostty, Starship, Oh My Zsh, Nerd Fonts, and a local validation script.
Instruction Scope
The setup steps are user-directed and purpose-aligned, but they include shell commands that install software and modify shell startup configuration.
Install Mechanism
There is no automatic install spec; installation is manual, but the instructions include Homebrew installs, GitHub clones, and a curl-piped Oh My Zsh installer.
Credentials
The changes are proportionate for terminal customization, though the skill is macOS-specific while registry metadata does not declare an OS restriction.
Persistence & Privilege
The skill instructs users to update ~/.zshrc so Oh My Zsh and Starship run in future shells; this is expected for the purpose but should be reviewed before applying.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install macos-terminal-beautify
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /macos-terminal-beautify 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
macos-terminal-beautify 1.0.0 — Initial release - 提供在 macOS 上美化终端的完整指南,涵盖 Ghostty、Starship、Oh My Zsh、Nerd Font 配置 - 包含详细安装步骤和配置示例,实现 Catppuccin Mocha 胶囊风格提示符 - 集成常见问题与 VS Code 终端兼容设置 - 附带自检脚本及结果说明,帮助用户排查环境与字体问题
元数据
Slug macos-terminal-beautify
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

macos-terminal-beautify 是什么?

在 macOS 上对终端进行美化,使用 Ghostty + Starship + Oh My Zsh + Nerd Font 组合,实现彩色胶囊提示符终端效果。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 44 次。

如何安装 macos-terminal-beautify?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install macos-terminal-beautify」即可一键安装,无需额外配置。

macos-terminal-beautify 是免费的吗?

是的,macos-terminal-beautify 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

macos-terminal-beautify 支持哪些平台?

macos-terminal-beautify 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 macos-terminal-beautify?

由 Haorui Wu(@wuhaorui)开发并维护,当前版本 v1.0.0。

💬 留言讨论