grepai-storage-gob by yoanbernabeu/grepai-skills
npx skills add https://github.com/yoanbernabeu/grepai-skills --skill grepai-storage-gob本技能涵盖使用 GOB(Go 二进制)作为 GrepAI 的存储后端,这是默认且最简单的选项。
GOB 是 Go 的原生二进制序列化格式。GrepAI 使用它来存储:
所有内容都存储在单个本地文件中。
| 优势 | 描述 |
|---|---|
| 🚀 简单 | 无需外部服务 |
| ⚡ 快速设置 | 立即生效 |
| 📁 便携 | 单个文件,易于备份 |
| 💰 免费 | 无基础设施成本 |
| 🔒 私有 | 数据保留在本地 |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 限制 | 描述 |
|---|
| 📏 可扩展性 | 不适合非常大的代码库 |
| 👤 单用户 | 不支持并发访问 |
| 🔄 无法共享 | 无法跨机器共享索引 |
| 💾 内存 | 搜索时需将索引加载到 RAM |
GOB 是默认后端。最小配置如下:
# .grepai/config.yaml
store:
backend: gob
store:
backend: gob
# 索引存储在 .grepai/index.gob(自动)
GOB 存储会在项目的 .grepai/ 目录中创建文件:
.grepai/
├── config.yaml # 配置文件
├── index.gob # 向量嵌入索引
└── symbols.gob # 用于追溯的符号索引
.grepai/index.gob 的大致大小:
| 代码库规模 | 文件数 | 代码块数 | 索引大小 |
|---|---|---|---|
| 小型 | 100 | 500 | ~5 MB |
| 中型 | 1,000 | 5,000 | ~50 MB |
| 大型 | 10,000 | 50,000 | ~500 MB |
# 初始化项目
grepai init
# 开始索引(创建 index.gob)
grepai watch
grepai status
# 输出示例:
# Index: .grepai/index.gob
# Files: 245
# Chunks: 1,234
# Size: 12.5 MB
# Last updated: 2025-01-28 10:30:00
# 简单的文件复制
cp .grepai/index.gob .grepai/index.gob.backup
# 删除并重新索引
rm .grepai/index.gob
grepai watch
# 复制整个 .grepai 目录
cp -r .grepai /path/to/new/location/
# 注意:仅在使用相同嵌入模型时有效
GOB 在搜索时需要将整个索引加载到 RAM 中:
| 索引大小 | RAM 使用量 |
|---|---|
| 10 MB | ~20 MB |
| 50 MB | ~100 MB |
| 500 MB | ~1 GB |
GOB 为典型代码库提供快速搜索:
| 代码库规模 | 搜索时间 |
|---|---|
| 小型(100 个文件) | <50ms |
| 中型(1K 个文件) | <200ms |
| 大型(10K 个文件) | <1s |
在以下情况考虑升级到 PostgreSQL 或 Qdrant:
将 .grepai/ 添加到你的 .gitignore 文件中:
# GrepAI(机器特定的索引)
.grepai/
原因: 索引是机器特定的,因为:
虽然你可以复制索引文件,但不推荐这样做,因为:
更好的方法: 每位开发者运行自己的 grepai watch。
store:
backend: postgres
postgres:
dsn: postgres://user:pass@localhost:5432/grepai
2. 重新索引:
rm .grepai/index.gob
grepai watch
store:
backend: qdrant
qdrant:
endpoint: localhost
port: 6334
2. 重新索引:
rm .grepai/index.gob
grepai watch
❌ 问题: 索引文件过大 ✅ 解决方案: 添加更多忽略模式或迁移到 PostgreSQL/Qdrant
❌ 问题: 大型代码库上搜索缓慢 ✅ 解决方案: 迁移到 Qdrant 以获得更好的性能
❌ 问题: 索引损坏 ✅ 解决方案: 删除并重新索引:
rm .grepai/index.gob .grepai/symbols.gob
grepai watch
❌ 问题: "Index not found" 错误
✅ 解决方案: 运行 grepai watch 以创建索引
GOB 存储状态:
✅ GOB Storage Configured
Backend: GOB (local file)
Index: .grepai/index.gob
Size: 12.5 MB
Contents:
- Files: 245
- Chunks: 1,234
- Vectors: 1,234 × 768 dimensions
Performance:
- Search latency: <100ms
- Memory usage: ~25 MB
每周安装量
244
仓库
GitHub Stars
15
首次出现
Jan 28, 2026
安全审计
安装于
opencode195
codex188
gemini-cli170
github-copilot169
claude-code162
kimi-cli158
This skill covers using GOB (Go Binary) as the storage backend for GrepAI, the default and simplest option.
GOB is Go's native binary serialization format. GrepAI uses it to store:
Everything is stored in a single local file.
| Benefit | Description |
|---|---|
| 🚀 Simple | No external services needed |
| ⚡ Fast setup | Works immediately |
| 📁 Portable | Single file, easy to backup |
| 💰 Free | No infrastructure costs |
| 🔒 Private | Data stays local |
| Limitation | Description |
|---|---|
| 📏 Scalability | Not ideal for very large codebases |
| 👤 Single user | No concurrent access |
| 🔄 No sharing | Can't share index across machines |
| 💾 Memory | Loads into RAM for searches |
GOB is the default backend. Minimal config:
# .grepai/config.yaml
store:
backend: gob
store:
backend: gob
# Index stored in .grepai/index.gob (automatic)
GOB storage creates files in your project's .grepai/ directory:
.grepai/
├── config.yaml # Configuration
├── index.gob # Vector embeddings
└── symbols.gob # Symbol index for trace
Approximate .grepai/index.gob sizes:
| Codebase | Files | Chunks | Index Size |
|---|---|---|---|
| Small | 100 | 500 | ~5 MB |
| Medium | 1,000 | 5,000 | ~50 MB |
| Large | 10,000 | 50,000 | ~500 MB |
# Initialize project
grepai init
# Start indexing (creates index.gob)
grepai watch
grepai status
# Output:
# Index: .grepai/index.gob
# Files: 245
# Chunks: 1,234
# Size: 12.5 MB
# Last updated: 2025-01-28 10:30:00
# Simple file copy
cp .grepai/index.gob .grepai/index.gob.backup
# Delete and re-index
rm .grepai/index.gob
grepai watch
# Copy entire .grepai directory
cp -r .grepai /path/to/new/location/
# Note: Only works if using same embedding model
GOB loads the entire index into RAM for searches:
| Index Size | RAM Usage |
|---|---|
| 10 MB | ~20 MB |
| 50 MB | ~100 MB |
| 500 MB | ~1 GB |
GOB provides fast searches for typical codebases:
| Codebase Size | Search Time |
|---|---|
| Small (100 files) | <50ms |
| Medium (1K files) | <200ms |
| Large (10K files) | <1s |
Consider PostgreSQL or Qdrant when:
Add .grepai/ to your .gitignore:
# GrepAI (machine-specific index)
.grepai/
Why: The index is machine-specific because:
While you can copy the index file, it's not recommended because:
Better approach: Each developer runs their own grepai watch.
store:
backend: postgres
postgres:
dsn: postgres://user:pass@localhost:5432/grepai
2. Re-index:
rm .grepai/index.gob
grepai watch
store:
backend: qdrant
qdrant:
endpoint: localhost
port: 6334
2. Re-index:
rm .grepai/index.gob
grepai watch
❌ Problem: Index file too large ✅ Solution: Add more ignore patterns or migrate to PostgreSQL/Qdrant
❌ Problem: Slow searches on large codebase ✅ Solution: Migrate to Qdrant for better performance
❌ Problem: Corrupted index ✅ Solution: Delete and re-index:
rm .grepai/index.gob .grepai/symbols.gob
grepai watch
❌ Problem: "Index not found" error ✅ Solution: Run grepai watch to create the index
GOB storage status:
✅ GOB Storage Configured
Backend: GOB (local file)
Index: .grepai/index.gob
Size: 12.5 MB
Contents:
- Files: 245
- Chunks: 1,234
- Vectors: 1,234 × 768 dimensions
Performance:
- Search latency: <100ms
- Memory usage: ~25 MB
Weekly Installs
244
Repository
GitHub Stars
15
First Seen
Jan 28, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode195
codex188
gemini-cli170
github-copilot169
claude-code162
kimi-cli158
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
106,200 周安装