GrepAI Project Initialization
Initialize grepai config for the current project with the chosen embedding provider, model, and storage backend.
Context
This skill expects context from the grepai:setting-up skill:
- •provider: ollama or openai
- •model: embedding model name
- •backend: postgres, qdrant, or gob
- •workspace_name: workspace name (if workspace mode)
If invoked standalone (via /grepai:init), ask for these values via AskUserQuestion.
Workflow
0. Project Scope Selection
When invoked standalone (not from setting-up skill), ask via AskUserQuestion:
Project scope? ○ Single project — index this project only (Recommended) ○ Workspace — cross-project search (requires PostgreSQL or Qdrant)
If workspace:
- •
Determine which directory to add as the project. Ask via AskUserQuestion:
textWhich directory should be added to the workspace? ○ Current directory ({cwd}) (Recommended) ○ Parent directory ({parent}) — if it contains multiple project subdirectories ○ Custom path - •
Ask for workspace name (suggest based on parent directory name)
- •
Check if workspace exists:
bashgrepai workspace list
- •
If new workspace: invoke the
grepai:workspace-managingskill with operation=create, then return here - •
If existing workspace: add the chosen directory:
bashgrepai workspace add {NAME} {ABSOLUTE_PATH}Note: grepai derives the project name from
filepath.Base(path). - •
Still run steps 1-5 below for per-project config (chunking, ignore patterns, MCP anchor)
- •
In the summary (step 6), note workspace membership and add CLAUDE.md guidance
If single project: continue with step 1.
1. Check Existing Config
Glob: .grepai/config.yaml
If .grepai/ exists, warn:
Existing .grepai/config.yaml found. Reinitializing will overwrite it.
Ask via AskUserQuestion:
Existing grepai config found. What to do? ○ Overwrite — reinitialize with new settings (Recommended) ○ Cancel — keep existing config
If cancel, stop.
2. Run grepai init (non-interactive)
Use --yes flag with provider and backend flags to avoid interactive prompts:
grepai init --yes -p {PROVIDER} -b {BACKEND}
Where:
- •
{PROVIDER}isollamaoropenai - •
{BACKEND}isgob,postgres, orqdrant
This creates .grepai/config.yaml with defaults and auto-adds .grepai/ to .gitignore.
For workspace mode: always use GOB for the local config since the workspace handles the shared store separately:
grepai init --yes -p ollama -b gob
3. Adjust Model if Needed
Read the generated config:
Read: .grepai/config.yaml
If the chosen model differs from the default (nomic-embed-text for Ollama), edit the config to set the correct model and dimensions:
Edit: .grepai/config.yaml
embedder.model: {MODEL}
embedder.dimensions: {DIMS}
Dimension Reference
| Model | Dimensions |
|---|---|
| mxbai-embed-large | 1024 |
| nomic-embed-text | 768 |
| bge-m3 | 1024 |
| nomic-embed-text-v2-moe | 768 |
| text-embedding-3-small | 1536 |
| text-embedding-3-large | 3072 |
4. Verify .gitignore
grepai init auto-adds .grepai/ to .gitignore. Verify it was added:
Read: .gitignore
If .gitignore does not exist or .grepai/ is missing from it, append:
# grepai index .grepai/
5. CLAUDE.md Workspace Guidance (workspace mode only)
When workspace mode is active, append workspace usage instructions to the project's CLAUDE.md (or AGENTS.md) so agents know to use workspace search parameters with the MCP tool:
## grepai Workspace
This project is part of the `{WORKSPACE}` grepai workspace.
When using the `grepai_search` MCP tool, pass `workspace="{WORKSPACE}"` to search across all workspace projects.
Use `projects="{PROJECT_NAME}"` to narrow results to a specific project.
If CLAUDE.md does not exist, create it with just this section. If it exists, append the section (checking it doesn't already have a grepai workspace section).
6. Print Summary
============================================================================
GrepAI Initialized
============================================================================
Config: .grepai/config.yaml
Embedder: {PROVIDER} / {MODEL} ({DIMS} dims)
Storage: {BACKEND}
Chunking: 512 tokens, 50 overlap
.gitignore: .grepai/ excluded
Workspace: {NAME} (only if workspace mode, otherwise omit this line)
CLAUDE.md: workspace guidance added (only if workspace mode)
Next steps:
grepai index # Build initial index
grepai watch --background # Start file watcher (single project)
grepai watch --workspace {NAME} --background # Start workspace watcher
/grepai:status # Verify all components
============================================================================