grepai-troubleshooting by yoanbernabeu/grepai-skills
npx skills add https://github.com/yoanbernabeu/grepai-skills --skill grepai-troubleshooting本技能提供常见 GrepAI 问题的解决方案和诊断流程。
运行以下命令以了解您的设置:
# 检查 GrepAI 版本
grepai version
# 检查项目状态
grepai status
# 检查 Ollama(如果使用)
curl http://localhost:11434/api/tags
# 检查配置
cat .grepai/config.yaml
症状:
Error: Index not found. Run 'grepai watch' first.
原因: 该项目尚未创建索引。
解决方案:
# 如果需要,进行初始化
grepai init
# 创建索引
grepai watch
症状:
Error: Cannot connect to Ollama at http://localhost:11434
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
原因:
解决方案:
启动 Ollama:
ollama serve
检查配置中的端点:
embedder:
endpoint: http://localhost:11434 # 验证此项
测试连接:
curl http://localhost:11434/api/tags
症状:
Error: Model 'nomic-embed-text' not found
原因: 嵌入模型尚未下载。
解决方案:
# 下载模型
ollama pull nomic-embed-text
# 验证
ollama list
症状: 搜索返回空结果或结果极少。
原因:
解决方案:
检查索引状态:
grepai status
# 应显示 files > 0 且 chunks > 0
验证文件是否正在被索引:
# 检查配置中的忽略模式
cat .grepai/config.yaml | grep -A 20 "ignore:"
尝试更宽泛的查询:
grepai search "function" # 非常宽泛的测试
症状: 结果与您要查找的内容不匹配。
原因:
解决方案:
改进查询(参见 grepai-search-tips 技能):
# 不佳
grepai search "auth"
# 良好
grepai search "user authentication middleware"
配置权重提升以惩罚测试文件:
search:
boost:
enabled: true
penalties:
- pattern: /tests/
factor: 0.5
检查索引了哪些内容:
grepai status
症状: 最近的文件更改未出现在搜索结果中。
原因:
解决方案:
检查守护进程状态:
grepai watch --status
重启守护进程:
grepai watch --stop
grepai watch --background
强制重新索引:
rm .grepai/index.gob
grepai watch
症状:
Error: Config file not found at .grepai/config.yaml
原因: 在此目录中未初始化 GrepAI。
解决方案:
grepai init
症状: 初始索引耗时非常长。
原因:
解决方案:
添加忽略模式:
ignore:
- node_modules
- vendor
- dist
- build
- "*.min.js"
使用更快的模型:
embedder:
model: nomic-embed-text # 更小、更快
使用 OpenAI 以提高速度(如果隐私允许):
embedder:
provider: openai
model: text-embedding-3-small
parallelism: 8
症状: 搜索查询需要数秒。
原因:
解决方案:
检查索引大小:
ls -lh .grepai/index.gob
对于大型索引,使用 Qdrant:
store:
backend: qdrant
限制结果数量:
grepai search "query" --limit 5
症状: grepai trace callers 未返回结果。
原因:
解决方案:
检查确切的函数名(区分大小写)
在配置中启用语言:
trace:
enabled_languages:
- .go
- .js
- .ts
重新构建符号索引:
rm .grepai/symbols.gob
grepai watch
症状: AI 助手无法使用 GrepAI 工具。
原因:
解决方案:
手动测试 MCP 服务器:
grepai mcp-serve
检查 GrepAI 是否在 PATH 中:
which grepai
验证 MCP 配置:
# Claude Code
cat ~/.claude/mcp.json
# Cursor
cat .cursor/mcp.json
症状: GrepAI 崩溃或系统变慢。
原因:
解决方案:
使用更小的模型:
embedder:
model: nomic-embed-text # 更小
使用 PostgreSQL 或 Qdrant 代替 GOB
减少并行度:
embedder:
parallelism: 2
症状:
Error: 401 Unauthorized - Invalid API key
解决方案:
检查环境变量:
echo $OPENAI_API_KEY
确保变量已导出:
export OPENAI_API_KEY="sk-..."
检查配置中的密钥格式:
embedder:
api_key: ${OPENAI_API_KEY} # 使用环境变量
#!/bin/bash
echo "=== GrepAI 诊断 ==="
echo -e "\n1. 版本:"
grepai version
echo -e "\n2. 状态:"
grepai status
echo -e "\n3. 配置:"
cat .grepai/config.yaml 2>/dev/null || echo "未找到配置"
echo -e "\n4. 索引文件:"
ls -la .grepai/ 2>/dev/null || echo "无 .grepai 目录"
echo -e "\n5. Ollama(如果使用):"
curl -s http://localhost:11434/api/tags | head -5 || echo "Ollama 无响应"
echo -e "\n6. 守护进程:"
grepai watch --status 2>/dev/null || echo "守护进程未运行"
如果其他方法都失败,进行完全重置:
# 移除所有 GrepAI 数据
rm -rf .grepai
# 重新初始化
grepai init
# 启动新索引
grepai watch
如果问题仍然存在:
grepai version)诊断摘要:
🔍 GrepAI 诊断
版本:0.24.0
项目:/path/to/project
✅ 配置:已找到 (.grepai/config.yaml)
✅ 索引:245 个文件,1,234 个块
✅ 嵌入器:Ollama(已连接)
✅ 守护进程:运行中(PID 12345)
❌ 问题:[如有,描述问题]
推荐操作:
1. [操作项]
2. [操作项]
每周安装量
263
仓库
GitHub 星标数
15
首次出现
2026年1月28日
安全审计
安装于
opencode210
codex203
gemini-cli185
github-copilot184
kimi-cli171
amp170
This skill provides solutions for common GrepAI issues and diagnostic procedures.
Run these commands to understand your setup:
# Check GrepAI version
grepai version
# Check project status
grepai status
# Check Ollama (if using)
curl http://localhost:11434/api/tags
# Check config
cat .grepai/config.yaml
Symptom:
Error: Index not found. Run 'grepai watch' first.
Cause: No index has been created for this project.
Solution:
# Initialize if needed
grepai init
# Create the index
grepai watch
Symptom:
Error: Cannot connect to Ollama at http://localhost:11434
Causes:
Solutions:
ollama serve
embedder:
endpoint: http://localhost:11434 # Verify this
3. Test connection:
curl http://localhost:11434/api/tags
Symptom:
Error: Model 'nomic-embed-text' not found
Cause: The embedding model hasn't been downloaded.
Solution:
# Download the model
ollama pull nomic-embed-text
# Verify
ollama list
Symptom: Searches return empty or very few results.
Causes:
Solutions:
grepai status
# Should show files > 0 and chunks > 0
2. Verify files are being indexed:
# Check ignore patterns in config
cat .grepai/config.yaml | grep -A 20 "ignore:"
3. Try broader query:
grepai search "function" # Very broad test
Symptom: Results don't match what you're looking for.
Causes:
Solutions:
grepai-search-tips skill):# Bad
grepai search "auth"
# Good
grepai search "user authentication middleware"
2. Configure boosting to penalize tests:
search:
boost:
enabled: true
penalties:
- pattern: /tests/
factor: 0.5
3. Check what's indexed:
grepai status
Symptom: Recent file changes aren't appearing in search results.
Causes:
Solutions:
grepai watch --status
grepai watch --stop
grepai watch --background
3. Force re-index:
rm .grepai/index.gob
grepai watch
Symptom:
Error: Config file not found at .grepai/config.yaml
Cause: GrepAI not initialized in this directory.
Solution:
grepai init
Symptom: Initial indexing takes very long.
Causes:
Solutions:
ignore:
- node_modules
- vendor
- dist
- build
- "*.min.js"
2. Use faster model:
embedder:
model: nomic-embed-text # Smaller, faster
3. Use OpenAI for speed (if privacy allows):
embedder:
provider: openai
model: text-embedding-3-small
parallelism: 8
Symptom: Search queries take several seconds.
Causes:
Solutions:
ls -lh .grepai/index.gob
store:
backend: qdrant
3. Limit results:
grepai search "query" --limit 5
Symptom: grepai trace callers returns no results.
Causes:
Solutions:
Check exact function name (case-sensitive)
Enable language in config:
trace:
enabled_languages:
- .go
- .js
- .ts
3. Re-build symbol index:
rm .grepai/symbols.gob
grepai watch
Symptom: AI assistant can't use GrepAI tools.
Causes:
Solutions:
grepai mcp-serve
which grepai
# Claude Code
cat ~/.claude/mcp.json
# Cursor
cat .cursor/mcp.json
Symptom: GrepAI crashes or system becomes slow.
Causes:
Solutions:
embedder:
model: nomic-embed-text # Smaller
2. Use PostgreSQL or Qdrant instead of GOB
embedder:
parallelism: 2
Symptom:
Error: 401 Unauthorized - Invalid API key
Solutions:
echo $OPENAI_API_KEY
export OPENAI_API_KEY="sk-..."
embedder:
api_key: ${OPENAI_API_KEY} # Uses env var
#!/bin/bash
echo "=== GrepAI Diagnostics ==="
echo -e "\n1. Version:"
grepai version
echo -e "\n2. Status:"
grepai status
echo -e "\n3. Config:"
cat .grepai/config.yaml 2>/dev/null || echo "No config found"
echo -e "\n4. Index files:"
ls -la .grepai/ 2>/dev/null || echo "No .grepai directory"
echo -e "\n5. Ollama (if using):"
curl -s http://localhost:11434/api/tags | head -5 || echo "Ollama not responding"
echo -e "\n6. Daemon:"
grepai watch --status 2>/dev/null || echo "Daemon not running"
If all else fails, complete reset:
# Remove all GrepAI data
rm -rf .grepai
# Re-initialize
grepai init
# Start fresh index
grepai watch
If issues persist:
grepai version)Diagnostic summary:
🔍 GrepAI Diagnostics
Version: 0.24.0
Project: /path/to/project
✅ Config: Found (.grepai/config.yaml)
✅ Index: 245 files, 1,234 chunks
✅ Embedder: Ollama (connected)
✅ Daemon: Running (PID 12345)
❌ Issue: [Description if any]
Recommended actions:
1. [Action item]
2. [Action item]
Weekly Installs
263
Repository
GitHub Stars
15
First Seen
Jan 28, 2026
Security Audits
Gen Agent Trust HubFailSocketPassSnykPass
Installed on
opencode210
codex203
gemini-cli185
github-copilot184
kimi-cli171
amp170
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
106,200 周安装
Docassemble 表单构建器技能 - 创建智能动态问卷与文档生成工具
257 周安装
Fastify TypeScript 生产级后端框架指南:高性能 Node.js Web 开发与 JSON 模式验证
257 周安装
AI 演示文稿生成器 | 一键创建专业幻灯片,支持 Marp 格式输出
257 周安装
Mapbox搜索模式指南:地理编码、POI搜索与位置发现最佳实践
257 周安装
Zustand适配器:为json-render提供状态管理后端,支持嵌套切片与Zustand v5+
257 周安装
Blender MCP 插件使用指南:3D 场景自动化与 Python 脚本控制教程
257 周安装