grepai-init — Claude Code skill: what it does, how to install
Sets up GrepAI code search in a repository. Generates the .grepai/ directory with baseline configuration for local embeddings and ignore rules.
npx skills add yoanbernabeu/grepai-skills --skill grepai-init -a claude-codeWhat grepai-init does
This skill guides the assistant through executing grepai init to initialize GrepAI in a codebase. The command creates a .grepai/ directory with a default config.yaml. By default, it targets Ollama at http://localhost:11434 using the nomic-embed-text model, stores vectors in gob files, and chunks code into 512-token segments with 50-token overlap. Vector and symbol index files are not created at this stage; grepai watch builds them later.
The skill explains how to adjust the generated configuration for alternative backends, such as OpenAI's text-embedding-3-small or PostgreSQL storage. It also details workspace management via grepai workspace for monorepos, along with reset steps when initialization encounters conflicts.
Without an active Ollama instance launched via ollama serve, subsequent indexing fails immediately. The .grepai/ path should be added to .gitignore right away because the resulting index is machine-specific.
What it helps with
- generate initial
.grepai/config.yamlfile in project root - switch embedding model from local Ollama to OpenAI
- migrate vector index storage to PostgreSQL
- configure workspace boundaries for monorepo subprojects
Example prompts for the agent
- Initialize GrepAI in this project with default settings
- Help me update
.grepai/config.yamlto use OpenAI and PostgreSQL - Configure GrepAI workspaces for this monorepo
How to install grepai-init
1Skills CLI (Vercel)
npx skills add yoanbernabeu/grepai-skills --skill grepai-init -a claude-code2Manually: put the files in place
~/.claude/skills/grepai-init/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/grepai-init/
1Skills CLI (Vercel)
npx skills add yoanbernabeu/grepai-skills --skill grepai-init -a codex2Manually: put the files in place
.agents/skills/grepai-init/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add yoanbernabeu/grepai-skills --skill grepai-init -a cursor2Manually: put the files in place
.cursor/skills/grepai-init/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install yoanbernabeu/grepai-skills grepai-init2Manually: put the files in place
.github/skills/grepai-init/SKILL.md1Skills CLI (Vercel)
npx skills add yoanbernabeu/grepai-skills --skill grepai-init -a gemini-cli2Platform CLI
gemini skills install https://github.com/yoanbernabeu/grepai-skills --path skills/configuration/grepai-initManually: put the files in place
.devin/skills/grepai-init/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add yoanbernabeu/grepai-skills --skill grepai-init -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about grepai-init
How to install grepai-init in Claude Code?
Run npx skills add yoanbernabeu/grepai-skills --skill grepai-init -a claude-code. You can also save the file directly to ~/.claude/skills/grepai-init/SKILL.md.
What files does grepai init create?
It creates the .grepai/ directory containing config.yaml with embedder, storage, and ignore settings. Vector index files index.gob and symbols.gob are generated later by running grepai watch.
What should you do if the .grepai directory already exists?
Remove the old folder with rm -rf .grepai before running grepai init again. Note that wiping this directory permanently deletes your local vector index.
Source text
SKILL.md · MIT
---
name: grepai-init
description: Initialize GrepAI in a project. Use this skill when setting up GrepAI for the first time in a codebase.
---
# GrepAI Init
This skill covers the `grepai init` command and project initialization.
## When to Use This Skill
- Setting up GrepAI in a new project
- Understanding what `grepai init` creates
- Customizing initial configuration
- Troubleshooting initialization issues
## Basic Usage
```bash
cd /path/to/your/project
grepai init
```
## What Init Creates
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)
```
## Default Configuration
The generated `config.yaml`:
```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
```
## Understanding Default Settings
### Embedder Settings
| Setting | Default | Purpose |
|---------|---------|---------|
| `provider` | `ollama` | Local embedding generation |
| `model` | `nomic-embed-text` | 768-dimension model |
| `endpoint` | `http://localhost:11434` | Ollama API URL |
### Store Settings
| Setting | Default | Purpose |
|---------|---------|---------|
| `backend` | `gob` | Local file storage |
### Chunking Settings
| Setting | Default | Purpose |
|---------|---------|---------|
| `size` | `512` | Tokens per chunk |
| `overlap` | `50` | Overlap for context |
### Watch Settings
| Setting | Default | Purpose |
|---------|---------|---------|
| `debounce_ms` | `500` | Wait time before re-indexing |
### Ignore Patterns
Default patterns exclude:
- Version control: `.git`
- GrepAI data: `.grepai`
- Dependencies: `node_modules`, `vendor`
- Build outputs: `target`, `dist`, `build`
- Cache: `__pycache__`
## Customizing After Init
Edit `.grepai/config.yaml` to customize:
### Change Embedding Provider
```yaml
embedder:
provider: openai
model: text-embedding-3-small
api_key: ${OPENAI_API_KEY}
```
### Change Storage Backend
```yaml
store:
backend: postgres
postgres:
dsn: postgres://user:pass@localhost:5432/grepai
```
### Add Custom Ignore Patterns
```yaml
ignore:
- .git
- .grepai
- node_modules
- "*.min.js"
- "*.bundle.js"
- coverage/
- .nyc_output/
```
## Init in Monorepos
For monorepos, init at the root:
```bash
cd /path/to/monorepo
grepai init
```
Or use workspaces for separate indices:
```bash
grepai workspace create my-workspace
grepai workspace add my-workspace /path/to/project1
grepai workspace add my-workspace /path/to/project2
```
## Re-Initialization
If you need to reset:
```bash
# Remove existing config
rm -rf .grepai
# Re-initialize
grepai init
```
**Warning:** This deletes your index. You'll need to re-run `grepai watch`.
## Verifying Initialization
After init, verify with:
```bash
# Check config exists
cat .grepai/config.yaml
# Check status (will show no index yet)
grepai status
```
## Common Issues
❌ **Problem:** `.grepai` already exists
✅ **Solution:** Delete it first or edit existing config:
```bash
rm -rf .grepai && grepai init
```
❌ **Problem:** Config created but Ollama not running
✅ **Solution:** Start Ollama before running `grepai watch`:
```bash
ollama serve
```
❌ **Problem:** Wrong directory initialized
✅ **Solution:** Remove `.grepai` and init in correct directory
## Best Practices
1. **Init at project root:** Where your main code lives
2. **Add `.grepai/` to `.gitignore`:** Index is machine-specific
3. **Customize ignore patterns:** Exclude generated/vendored code
4. **Review config after init:** Adjust for your stack
## Example .gitignore Addition
```gitignore
# GrepAI
.grepai/
```
## Output Format
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
```
© yoanbernabeu · MIT · yoanbernabeu/grepai-skills