
Initializes GrepAI's semantic code search in your project by creating a .grepai directory with config.yaml and setting up sensible defaults. You get Ollama with nomic-embed-text for local embeddings, 512-token chunks with 50-token overlap, and ignore patterns that skip node_modules, .git, and other usual suspects. The config supports multiple embedding providers (OpenAI, Ollama) and storage backends (local gob files or Postgres). One nice touch is the trace mode configuration that enables symbol indexing across 20+ languages out of the box. Just run it once at your project root, tweak the YAML if needed, then start the watch command to build your index.
$ npx -y skills add yoanbernabeu/grepai-skills --skill grepai-init --agent claude-codeInstalls into .claude/skills of the current project.
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:
enabled_languages:
- .go
- .js
- .ts
- .jsx
- .tsx
- .vue
- .py
- .php
- .lua
- .gd
- .rb
- .c
- .h
- .cpp
- .hpp
- .cc
- .cxx
- .hxx
- .rs
- .zig
- .cs
- .java
- .fs
- .fsx
- .fsi
- .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
# no api_key: read from OPENAI_API_KEY (official endpoint only)
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
Sponsors