Files
opencode-commands/index.md
T

26 lines
1.1 KiB
Markdown

---
description: Bulk-index code or docs into the active EEMS
---
The user invoked `/index` with arguments: `$ARGUMENTS`
Expected forms:
- `/index status [project]` → call `index_status` (with optional project
filter). Paste the returned string verbatim.
- `/index clear <code|docs|all> [project]` → call `index_clear` with the given
kind + optional project. Report one line: `cleared: code=<N>, docs=<N>`.
- `/index code <root_path> [project] [extensions]` → call `index_code`. If
`project` is omitted, derive it from the basename of `root_path`. If `extensions` is
omitted, leave it unset (sane defaults kick in). Report two lines:
```
indexed <files_indexed>/<files_seen> files (skipped <files_skipped>)
chunks: <chunks_inserted> inserted, <chunks_embedded> embedded, <embed_failures> embed failures
```
- `/index docs <root_path> [project]` → call `index_docs`. Project derivation
same as above. Same two-line report shape.
Rules:
- If you derived `project` from the path, echo it as `(project=<name>)` on its own line.
- No narration. No "I will...".
- If `$ARGUMENTS` is empty or starts with `help`, list the four forms above and stop.