关于 grepai-installation
这是一份面向开发者的 GrepAI 安装指南,介绍多种安装、升级和卸载方式。内容包括 macOS、Linux、Windows 安装步骤,以及从源码构建和验证安装的方法。
主要功能
- 01通过 Homebrew 安装
- 02使用 Shell 脚本安装
- 03通过 PowerShell 安装
- 04从源码构建
- 05检查更新与验证安装
适用场景
- 01在 macOS 或 Linux 安装 GrepAI
- 02在 Windows 上安装 GrepAI
- 03从源码构建自定义版本
- 04升级或移除现有安装
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ yoanbernabeu/ grepai-skills --skill grepai-installation安装后在 Claude Code 中输入/grepai-installation确认已加载。
详细介绍
GrepAI 安装
本技能介绍在任何平台上安装 GrepAI 的所有方法。
何时使用此技能
- 首次安装 GrepAI
- 升级现有的 GrepAI 安装
- 从源代码构建 GrepAI
- 验证安装是否成功
前提条件
- macOS/Linux: 可访问终端
- Windows: PowerShell
- 从源代码构建: 已安装 Go 1.24+
安装方法
方法 1:Homebrew(macOS - 推荐)
在 macOS 上最简单的安装方式:
# Add the tap and install
brew install yoanbernabeu/tap/grepai
# Verify installation
grepai version
优点:
- 使用
brew upgrade grepai自动更新 - 使用
brew uninstall grepai完全卸载 - 自动管理依赖项
方法 2:Shell 脚本(Linux/macOS)
通用安装脚本:
# Download and run the installer
curl -sSL https://raw.githubusercontent.com/yoanbernabeu/grepai/main/install.sh | sh
# Verify installation
grepai version
脚本执行的操作:
- 检测操作系统和架构
- 下载相应的二进制文件
- 安装到
/usr/local/bin/ - 设置可执行权限
方法 3:PowerShell(Windows)
原生 Windows 安装方式:
# Run in PowerShell (Admin recommended)
irm https://raw.githubusercontent.com/yoanbernabeu/grepai/main/install.ps1 | iex
# Verify installation
grepai version
注意: 你可能需要调整执行策略:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
方法 4:从源代码构建
适用于开发者或自定义构建:
# Clone the repository
git clone https://github.com/yoanbernabeu/grepai.git
cd grepai
# Build the binary
make build
# Install globally
sudo mv ./bin/grepai /usr/local/bin/
# Verify installation
grepai version
要求:
- Go 1.24 或更高版本
- Make(可选,也可以直接使用
go build)
验证安装
安装后,验证一切是否正常运行:
# Check version
grepai version
# Output: grepai version 0.24.0
# Check available commands
grepai --help
更新 GrepAI
检查更新
grepai update --check
执行更新
# Auto-update (downloads and installs latest)
grepai update
# Or via Homebrew
brew upgrade grepai
卸载
Homebrew
brew uninstall grepai
手动卸载
# Remove binary
sudo rm /usr/local/bin/grepai
# Optionally remove config directories
rm -rf ~/.grepai
后续步骤
安装完成后:
- 安装 Ollama,用于本地嵌入(参见
grepai-ollama-setup技能) - 使用
grepai init初始化项目 - 使用
grepai watch开始索引
常见安装问题
❌ 问题: command not found: grepai
✅ 解决方案: 确保 PATH 中包含 /usr/local/bin:
export PATH="$PATH:/usr/local/bin"
❌ 问题: 安装过程中权限被拒绝
✅ 解决方案: 在安装命令前使用 sudo,或安装到用户目录
❌ 问题: 找不到 Homebrew tap ✅ 解决方案: 先添加 tap:
brew tap yoanbernabeu/tap
brew install grepai
输出格式
安装成功后:
✅ GrepAI installed successfully
Version: 0.24.0
Location: /usr/local/bin/grepai
Next steps:
1. Install Ollama: brew install ollama
2. Initialize project: grepai init
3. Start indexing: grepai watch
评论
支持 Markdown