我的终端四件套:Ghostty + Sheldon + Starship + Kiro CLI
原文来源:来源:
折腾终端不是为了好看——好看只是副作用。这篇分享我目前稳定使用的四个工具,每个管一层,互不干涉。
整体思路
不用 oh-my-zsh 一把梭了。拆开来,每层用最合适的:
- Ghostty — 终端模拟器,负责渲染
- Sheldon — Zsh 插件管理
- Starship — Prompt(命令行前面那行)
- Kiro CLI inline — AI 命令补全
三个 Rust,一个 Zig。启动都在毫秒级。
Ghostty
HashiCorp 创始人 Mitchell Hashimoto 做的终端模拟器,2024 年底开源。Zig 写的,GPU 渲染(macOS 用 Metal,Linux 用 OpenGL)。
跟 Alacritty 的核心区别:Ghostty 在每个平台都用原生 UI 框架。macOS 是 SwiftUI,Linux 是 GTK4。所以标签页、分屏这些操作跟系统行为完全一致,不用重新学快捷键。
几个亮点:
- Kitty 图片协议。 终端里直接渲染图片,配合 Yazi 之类的 TUI 工具能预览图片。
- 性能。 跟 Alacritty 在同一个量级。功能比 Alacritty 丰富很多,但界面行为跟原生 App 一致。
安装:brew install --cask ghostty
官网:https://ghostty.org GitHub:https://github.com/ghostty-org/ghostty(46k+ star) Mitchell Hashimoto 的架构介绍文:https://mitchellh.com/writing/ghostty-and-useful-zig-patterns
Sheldon
Rust 写的 shell 插件管理器,只做一件事:从 GitHub 下载插件,生成 source 脚本。配置是 TOML,声明式。
跟 oh-my-zsh / zinit 的区别:Sheldon 不接管你的 shell 环境,只管下载和加载。.zshrc 里只需要一行 eval "$(sheldon source)"。
安装:brew install sheldon
~/.config/sheldon/plugins.toml:
shell = "zsh"
[plugins.zsh-autosuggestions]
github = "zsh-users/zsh-autosuggestions"
use = ["{{ name }}.zsh"]
[plugins.zsh-syntax-highlighting]
github = "zsh-users/zsh-syntax-highlighting"
[plugins.zsh-completions]
github = "zsh-users/zsh-completions"三个插件分别提供:历史命令灰色建议、输入时实时语法高亮、更多命令的补全规则。并行下载,lock 文件缓存,加载很快。
官网:https://sheldon.cli.rs GitHub:https://github.com/rossmacarthur/sheldon
Starship
Rust 写的跨 shell prompt,替换掉默认的命令行提示符。核心思路:只在需要时显示信息。 进 Git 仓库才显示分支,进 Python 项目才显示版本,进 K8s 上下文才显示集群名。不在对应环境就是一个干净的箭头。
50+ 内置模块,渲染速度 10ms 以内。一个 ~/.config/starship.toml 文件管所有配置,跨 Bash/Zsh/Fish/PowerShell 通用。
安装:brew install starship
.zshrc 加一行:eval "$(starship init zsh)"
官网:https://starship.rs GitHub:https://github.com/starship/starship(46k+ star) 预设主题列表(每个都有截图):https://starship.rs/presets/
Kiro CLI inline
AWS 出品的命令行 AI 补全工具(前身是Fig)。我只用它的一个功能:inline suggestions。
开启后,AI 根据当前输入和上下文推测你接下来要打的内容。可快速选择。
跟 zsh-autosuggestions 的区别:autosuggestions 是本地历史匹配,Kiro inline 是云端 AI 推理。
安装:
curl -fsSL https://cli.kiro.dev/install | bash
kiro-cli login
kiro-cli inline enable官网:https://kiro.dev/cli inline 功能文档:https://kiro.dev/docs/cli/autocomplete/
串起来:完整的 .zshrc
# Sheldon 加载插件
eval "$(sheldon source)"
# Starship prompt
eval "$(starship init zsh)"三行。Ghostty 是终端本身,装好不用配置。Kiro inline 装完 enable 一次就行。
这套方案适合谁
如果你用 oh-my-zsh 用得好好的,没问题,不用折腾。但如果你:
- 嫌 oh-my-zsh 启动慢
- 想要一个干净的、可版本控制的配置
- 在 macOS 和 Linux 之间切换,想要一致的体验
- 想试 AI 补全但不想换终端
可以挨个试。先换 Ghostty 感受原生 UI,再加 Starship 看一眼提示符,然后 Sheldon 管插件,最后 Kiro inline 锦上添花。