`neurostack search "query"` currently prints results as formatted text. This is useful for humans but hard to pipe into other tools.
Add a `--json` flag that outputs results as a JSON array instead. Each element should include at minimum: `path`, `title`, `score`, and `snippet`.
Example:
```bash
neurostack search "memory consolidation" --json
```
```json
[
{
"path": "neuroscience/memory.md",
"title": "Memory Consolidation",
"score": 0.91,
"snippet": "Consolidation transfers information from hippocampus to neocortex..."
}
]
```
Where to look:
- CLI entry point: `src/neurostack/cli.py`
- Search logic: `src/neurostack/search.py`
- The `search` subcommand is defined in `cli.py` using Click or similar — look for the `@cli.command()` decorator for `search`
Acceptance criteria:
`neurostack search "query"` currently prints results as formatted text. This is useful for humans but hard to pipe into other tools.
Add a `--json` flag that outputs results as a JSON array instead. Each element should include at minimum: `path`, `title`, `score`, and `snippet`.
Example:
```bash
neurostack search "memory consolidation" --json
```
```json
[
{
"path": "neuroscience/memory.md",
"title": "Memory Consolidation",
"score": 0.91,
"snippet": "Consolidation transfers information from hippocampus to neocortex..."
}
]
```
Where to look:
Acceptance criteria: