一键导入
grepai-init
Initialize GrepAI in a project. Use this skill when setting up GrepAI for the first time in a codebase.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Initialize GrepAI in a project. Use this skill when setting up GrepAI for the first time in a codebase.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Reference for all GrepAI MCP tools. Use this skill to understand available MCP tools and their parameters.
Advanced search options in GrepAI. Use this skill for JSON output, compact mode, and AI agent integration.
Find function callees with GrepAI trace. Use this skill to discover what functions a specific function calls.
Find function callers with GrepAI trace. Use this skill to discover what code calls a specific function.
Build complete call graphs with GrepAI trace. Use this skill for recursive dependency analysis.
Supported programming languages in GrepAI. Use this skill to understand which languages can be indexed and traced.
| name | grepai-init |
| description | Initialize GrepAI in a project. Use this skill when setting up GrepAI for the first time in a codebase. |
This skill covers the grepai init command and project initialization.
grepai init createscd /path/to/your/project
grepai init
Running grepai init creates the .grepai/ directory with:
.grepai/
├── config.yaml # Configuration file
├── index.gob # Vector index (created by watch)
└── symbols.gob # Symbol index for trace (created by watch)
The generated config.yaml:
version: 1
embedder:
provider: ollama
model: nomic-embed-text
endpoint: http://localhost:11434
store:
backend: gob
chunking:
size: 512
overlap: 50
watch:
debounce_ms: 500
trace:
mode: fast
enabled_languages:
- .go
- .js
- .ts
- .jsx
- .tsx
- .py
- .php
- .c
- .h
- .cpp
- .hpp
- .cc
- .cxx
- .rs
- .zig
- .cs
- .pas
- .dpr
ignore:
- .git
- .grepai
- node_modules
- vendor
- target
- __pycache__
- dist
- build
| Setting | Default | Purpose |
|---|---|---|
provider | ollama | Local embedding generation |
model | nomic-embed-text | 768-dimension model |
endpoint | http://localhost:11434 | Ollama API URL |
| Setting | Default | Purpose |
|---|---|---|
backend | gob | Local file storage |
| Setting | Default | Purpose |
|---|---|---|
size | 512 | Tokens per chunk |
overlap | 50 | Overlap for context |
| Setting | Default | Purpose |
|---|---|---|
debounce_ms | 500 | Wait time before re-indexing |
Default patterns exclude:
.git.grepainode_modules, vendortarget, dist, build__pycache__Edit .grepai/config.yaml to customize:
embedder:
provider: openai
model: text-embedding-3-small
api_key: ${OPENAI_API_KEY}
store:
backend: postgres
postgres:
dsn: postgres://user:pass@localhost:5432/grepai
ignore:
- .git
- .grepai
- node_modules
- "*.min.js"
- "*.bundle.js"
- coverage/
- .nyc_output/
For monorepos, init at the root:
cd /path/to/monorepo
grepai init
Or use workspaces for separate indices:
grepai workspace create my-workspace
grepai workspace add my-workspace /path/to/project1
grepai workspace add my-workspace /path/to/project2
If you need to reset:
# Remove existing config
rm -rf .grepai
# Re-initialize
grepai init
Warning: This deletes your index. You'll need to re-run grepai watch.
After init, verify with:
# Check config exists
cat .grepai/config.yaml
# Check status (will show no index yet)
grepai status
❌ Problem: .grepai already exists
✅ Solution: Delete it first or edit existing config:
rm -rf .grepai && grepai init
❌ Problem: Config created but Ollama not running
✅ Solution: Start Ollama before running grepai watch:
ollama serve
❌ Problem: Wrong directory initialized
✅ Solution: Remove .grepai and init in correct directory
.grepai/ to .gitignore: Index is machine-specific# GrepAI
.grepai/
After successful initialization:
✅ GrepAI Initialized
Config: .grepai/config.yaml
Default settings:
- Embedder: Ollama (nomic-embed-text)
- Storage: GOB (local file)
- Chunking: 512 tokens, 50 overlap
Next steps:
1. Ensure Ollama is running: ollama serve
2. Start indexing: grepai watch