Obsidian CLI Inspector
A local-first, read-only CLI/TUI tool for vault hygiene and querying Obsidian vaults. Built with Rust for speed and reliability.
Features
- Fast full-text search using SQLite FTS5
- Link analysis - Find backlinks, forward links, and unresolved references
- Tag management - Query notes by tags with AND/OR operations
- Graph navigation - Explore connections between notes
- Smart suggestions - Find related notes without explicit links
- Vault hygiene - Detect bloated notes and suggest refactoring
- Incremental indexing - Fast re-indexing by tracking changes
- CLI + TUI - Scriptable commands and interactive interface
Status
Phase 0 (Foundations) - Complete
- Project builds as a single Rust binary
- SQLite database with FTS5 support
- Configuration via
config.toml - CLI command structure defined
Upcoming Phases:
- Phase 1: Vault scanning and change detection
- Phase 2: Obsidian markdown parsing (wikilinks, frontmatter, tags)
- Phase 3: Document chunking for retrieval
- Phase 4: Full database schema implementation
- Phase 5: Incremental indexing
- Phase 6: Query layer (search, links, tags)
- Phase 7: Relevance suggestions
- Phase 8: Bloat detection and refactoring
Installation
Prerequisites
- Rust 1.70+ (install via rustup)
Build from source
The binary will be at target/release/obsidian-cli.
Quick Start
1. Create configuration
Copy the example config and customize it:
Edit ~/.config/obsidian-cli/config.toml and set your vault path:
= "/path/to/your/obsidian/vault"
2. Initialize database
3. Index your vault
4. Start exploring
# Search notes
# Find backlinks
# List notes by tag
# Show vault statistics
Usage
# Initialize or reinitialize database
# Index vault (scan and parse all files)
# Full-text search
# Find backlinks to a note
# Find forward links from a note
# List unresolved links
# List notes by tag
# Suggest related notes
# Detect bloated notes
# Show statistics
# Launch interactive TUI
# Explore graph
Configuration
The configuration file (config.toml) supports:
- vault_path: Path to your Obsidian vault (required)
- database_path: Where to store the index (default:
~/.local/share/obsidian-cli/index.db) - exclude.patterns: Directories/patterns to skip (default:
.obsidian/,.git/,.trash/) - search.default_limit: Default search result limit
- graph.max_depth: Maximum graph traversal depth
- llm: Optional LLM configuration for Q&A features
See config.toml.example for details.
Architecture
Tech Stack
- Rust - Performance and reliability
- SQLite - Local storage with FTS5 for full-text search
- rusqlite - SQLite bindings
- clap - CLI argument parsing
- toml - Configuration
Data Model
- Notes - File metadata, content hash, frontmatter
- Links - Wikilinks, embeds, markdown links with resolution status
- Tags - Inline and frontmatter tags
- Chunks - Text segments for retrieval and search
- FTS Index - Full-text search over chunks
Development
Build and test
# Build
# Run tests
# Check formatting (CI parity)
# Lint (CI parity)
# Convenience aliases (same as CI)
Git hooks (format/lint/tests)
Enable the repo hooks (pre-commit: format + lint, pre-push: tests):
If you clone to a new machine, re-run the command above.
Project Structure
src/
├── main.rs # Entry point
├── cli.rs # Command definitions
├── config.rs # Configuration loading
└── db.rs # Database schema and operations
Roadmap
See TODOs.md for detailed roadmap and implementation checklist.
License
MIT OR Apache-2.0
Contributing
Contributions welcome! Please open an issue first to discuss major changes.