Skip to content

feat(cli): add search context lines#4

Merged
vinnytherobot merged 2 commits into
mainfrom
feat/search-context-lines
Jun 7, 2026
Merged

feat(cli): add search context lines#4
vinnytherobot merged 2 commits into
mainfrom
feat/search-context-lines

Conversation

@vinnytherobot

Copy link
Copy Markdown
Owner

Summary

  • Add grep-style search context for stream output via --context/-C, --before-context/-B, and --after-context/-A.
  • Keep context scoped to --search queries and reject ambiguous context usage without a search term.
  • Bump package version to 0.5.0 and document the release in CHANGELOG.md.
  • Add CLI coverage for context output and validation behavior.
  • Update README/API docs with context usage examples.
  • Fix .gitignore to ignore the actual AGENTS.md file.

Technical Details

The stream renderer now separates non-search filters from search matching. Level, min-level, and time filters are applied first, then iter_search_context() selects matching entries plus before/after neighbors without duplicating overlapping context windows.

--context acts as a symmetric shorthand, while --before-context and --after-context can override each side independently. Context is intentionally limited to standard stream output and is rejected with dashboard mode.

Validation

  • pytest -q
  • ruff check .
  • pytest --cov=logscope --cov-report=term-missing
  • python -m build

@github-actions

github-actions Bot commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

PR Check Summary

  • Conventional title: feat(cli): add search context lines
  • Tests updated when code changes: true
  • Docs updated when code changes: true

@vinnytherobot vinnytherobot merged commit 0437c35 into main Jun 7, 2026
6 checks passed
@vinnytherobot vinnytherobot deleted the feat/search-context-lines branch June 7, 2026 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant