Problem
The search-content command currently requires an interactive terminal because it uses a fuzzy finder UI (go-fuzzyfinder) for result selection. When run non-interactively (in scripts, CI/CD, or piped commands), it fails with:
Cannot find note in vault
This makes it impossible to use search-content in automation workflows or to simply list matching results without user interaction.
Proposed Solution
Add a --list or --no-interactive flag that outputs matching results to stdout instead of launching the fuzzy finder:
# Current behavior (interactive only)
obsidian-cli search-content "query"
# Proposed: List mode
obsidian-cli search-content "query" --list
# Output:
# Documentation/Architecture/Backend Development Guidelines.md:8: ## Purpose
# Projects/Notes/meeting.md:15: The purpose of this meeting...
# Could also support different output formats
obsidian-cli search-content "query" --list --format json
Use Cases
- Scripting: Find notes matching criteria for batch processing
- Integration: Pipe results to other tools (grep, fzf, rofi, dmenu)
- Automation: Use in CI/CD or cron jobs
- Accessibility: Users who prefer their own fuzzy finder or selection method
Current Workaround
Users must fall back to raw grep:
grep -rn "query" "/path/to/vault" --include="*.md"
This bypasses the CLI entirely and loses integration with vault configuration.
Additional Context
- The underlying
SearchNotesWithSnippets() function already returns structured results
- Only the presentation layer (fuzzy finder) requires interactivity
- Similar CLIs like
ripgrep and fzf support both interactive and non-interactive modes
Problem
The
search-contentcommand currently requires an interactive terminal because it uses a fuzzy finder UI (go-fuzzyfinder) for result selection. When run non-interactively (in scripts, CI/CD, or piped commands), it fails with:This makes it impossible to use
search-contentin automation workflows or to simply list matching results without user interaction.Proposed Solution
Add a
--listor--no-interactiveflag that outputs matching results to stdout instead of launching the fuzzy finder:Use Cases
Current Workaround
Users must fall back to raw grep:
This bypasses the CLI entirely and loses integration with vault configuration.
Additional Context
SearchNotesWithSnippets()function already returns structured resultsripgrepandfzfsupport both interactive and non-interactive modes