/adr:search
Search ADRs
Section titled “Search ADRs”Search Architectural Decision Records by content, status, tags, or date range.
Process
Section titled “Process”- Parse search arguments
- Build search criteria
- Search ADR files
- Rank and filter results
- Display matches with context
Argument Parsing
Section titled “Argument Parsing”Supported arguments:
<query>: Text to search for in ADR content--status=<status>: Filter by status--since=<date>: ADRs created/modified since date--until=<date>: ADRs created/modified until date--tag=<tag>: Filter by tag (if tags are used)--format=<format>: Output format (default, verbose, json)
Search Modes
Section titled “Search Modes”Full-Text Search
Section titled “Full-Text Search”Search across all ADR content:
- Title
- Context
- Decision
- Consequences
- Options (if present)
Use Grep to find matches, then parse files for context.
Status Filter
Section titled “Status Filter”Filter by decision status:
/adr-search --status=accepted/adr-search --status=proposedDate Range
Section titled “Date Range”Filter by date:
/adr-search --since=2024-01-01 # Or relative: --since=30d/adr-search --since=30d # Last 30 daysCombined Search
Section titled “Combined Search”Combine criteria:
/adr-search "postgresql" --status=accepted --since=90dSearch Output
Section titled “Search Output”Default Format
Section titled “Default Format”Show matches with context:
Found 3 ADRs matching "database":
ADR-0001: Use PostgreSQL for Primary Storage [accepted] ...we chose PostgreSQL as our primary **database**... File: docs/adr/0001-use-postgresql.md
ADR-0007: Database Connection Pooling [accepted] ...the **database** connection pooling strategy... File: docs/adr/0007-database-connection-pooling.md
ADR-0012: Database Migration Strategy [proposed] ...approach for **database** schema migrations... File: docs/adr/0012-database-migration-strategy.mdVerbose Format
Section titled “Verbose Format”Include more context per match:
- Full title
- Status and date
- All matching excerpts
- Related ADRs
JSON Format
Section titled “JSON Format”Structured output for tooling:
{ "query": "database", "filters": {"status": "accepted"}, "results": [ { "id": "0001", "title": "Use PostgreSQL for Primary Storage", "status": "accepted", "file": "docs/adr/0001-use-postgresql.md", "matches": [ {"section": "Context", "excerpt": "...primary database..."} ] } ], "total": 3}Ranking
Section titled “Ranking”Order results by relevance:
- Title matches (highest)
- Decision section matches
- Context matches
- Other section matches
Within same relevance, order by:
- Accepted > Proposed > Deprecated > Superseded
- More recent first
Search Tips
Section titled “Search Tips”Display helpful search tips:
- Use quotes for exact phrases
- Combine with status for focused results
- Use date filters to find recent decisions
Error Handling
Section titled “Error Handling”- If no results found, suggest broader search
- If query too short, require minimum length
- If date format invalid, show expected format