Files
searchi/crates/searchi-cli/README.md
T

36 lines
2.0 KiB
Markdown
Raw Normal View History

# Searchi CLI
The CLI is a thin adapter over `searchi-core`; it performs no network requests or
GPU setup. Index only folders you explicitly choose.
```powershell
cargo run -p searchi-cli -- index --db ./searchi.db --root ./documents
cargo run -p searchi-cli -- search --db ./searchi.db "termination clause" --limit 10
cargo run -p searchi-cli -- search --db ./searchi.db "invoice" --json
cargo run -p searchi-cli -- search --db ./searchi.db "invoice" --extension pdf --min-size 1024 --json
cargo run -p searchi-cli -- index --db ./searchi.db --root ./documents --exclude private
cargo run -p searchi-cli -- stats --db ./searchi.db --json
```
The same arguments work on Linux and macOS. After building, invoke the `searchi`
binary directly instead of `cargo run -p searchi-cli --`.
`index` creates the database if needed; its parent directory must already exist.
`search` and `stats` require an existing database so a mistyped path does not
silently create an empty index. Failures exit with a nonzero status and include
the affected folder or database path. Result limits must be between 1 and 1000.
`search --json` emits an array of engine results, including the path, filename,
snippet, ranking score, and match kind. An empty search emits `[]`. `stats --json`
emits an object with `files` and `content_files`. JSON is the scripting interface;
the human-readable output may change as preview support develops.
The CLI searches filenames, bounded text, PDF text and DOCX paragraphs. Results
include actual matching source locations when available and extraction errors
for documents that could not be read. Semantic inference and media formats
remain tracked in the roadmap; this interface does not fabricate embeddings.
Filters apply before result limits: `--folder`, `--extension`, `--min-size`,
`--max-size`, `--modified-after-ms`, and `--modified-before-ms`. Dates are Unix
milliseconds and inclusive. Repeated `index --exclude NAME` flags add directory
names to the defaults (`.git`, `node_modules`, `target`).