Skip to content

philippnormann/sec-grep

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

14 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

sec-grep

Fast, local search across computer science research literature.

sec-grep TUI

sec-grep builds a local SQLite/FTS5 index from DBLP and gives you a clean CLI and TUI for searching papers with an expressive query language across title, authors, abstract, venue, year, rank, tag, and DOI.

Why

  • Search across configurable computer science venue catalogs.
  • Keep the corpus local and query it quickly with SQLite/FTS5.
  • Search in the CLI or TUI, and export CSV, JSON, or BibTeX for scripts.

Install

Requires Rust 1.95 or newer.

cargo install --git https://github.com/philippnormann/sec-grep sec-grep

Or from a local checkout:

cargo install --path crates/sec-grep

Cargo installs to ~/.cargo/bin on macOS/Linux and %USERPROFILE%\.cargo\bin on Windows. Make sure that directory is on PATH.

Or use nix:

nix run "github:philippnormann/sec-grep" -- <arguments> # run once
nix shell "github:philippnormann/sec-grep"              # add to PATH

Use

sec-grep init
sec-grep update --since 2018
sec-grep --tui

In the TUI, use Tab to cycle sort modes, arrow keys to move, and Enter to open the selected paper URL.

Sort CLI results with --sort relevance, --sort year, --sort venue, or --sort rank.

Search from the shell:

sec-grep 'title:fuzzing venue:ndss year:2020-'
sec-grep '"side channel" OR cache' --venue CCS,SP
sec-grep 'doi:10.1145' --fields venue,year,title,doi

More examples:

# Recent malware-detection papers in A/A* venues
sec-grep 'malware detection' --year 2022- --rank A --rank 'A*' --sort year

# Export matching papers as BibTeX
sec-grep 'kernel fuzz*' --venue USENIX-SEC --format bibtex > papers.bib

# Script-friendly JSON output
sec-grep 'large language model' --year 2023- --format json

# Limit output for quick triage
sec-grep 'ransomware OR botnet' --year 2020- --limit 20

# Search a custom database path
sec-grep --db ./papers.db 'symbolic execution' --venue ccs

Query Language

  • Boolean search: AND, OR, NOT, parentheses, and quoted phrases.
  • Text fields: title:, author:, abstract:.
  • Metadata filters: venue:, year:, rank:, tag:, doi:.
  • Prefix search: fuzz*.

Year filters accept 2020, 2018-2024, 2020-, and -2019.

Metadata filters can be written inline:

sec-grep 'malware detection year:2022- rank:A'

or as CLI flags:

sec-grep 'malware detection' --year 2022- --rank A

Boolean operators apply only to full-text terms. Metadata filters are ORed within one field and ANDed across fields.

sec-grep 'malware OR botnet' --rank A --rank 'A*'
sec-grep 'malware OR botnet' --year 2018 --year 2029
sec-grep 'malware OR botnet' --rank A --tag systems

Bundles select venue sets for subfields such as security, ML, and software engineering. Tags filter papers within the indexed corpus.

sec-grep update --bundle security,ml
sec-grep enrich --bundle ml
# ML venue papers
sec-grep 'mechanistic interpretability' --tag ml --year 2023-

# AI-security crossover papers
sec-grep 'prompt injection OR jailbreak' --tag ai-security

Venues

Bundled venue catalogs live in crates/sec-grep-core/venues/.

After sec-grep init, you can extend or override the catalog with a user config.yaml:

  • macOS: ~/Library/Application Support/sec-grep/config.yaml
  • Linux: ~/.config/sec-grep/config.yaml
  • Windows: %APPDATA%\sec-grep\config.yaml

You can also pass a specific file with --config path/to/config.yaml.

bundles selects bundled venue sets for subfields. User venues are always merged after selected bundles by id: reuse an existing id to override a bundled venue, or add a new id to extend the catalog.

bundles: [security, ml, se]

defaults:
  min_year: 2018

venues:
  - id: DIMVA
    name: Conference on Detection of Intrusions and Malware & Vulnerability Assessment
    dblp_stream: conf/dimva
    aliases: [dimva]
    rank: B
    tags: [systems, network, malware]

Then ingest and search it:

sec-grep update --venue DIMVA
sec-grep 'malware' --venue DIMVA

dblp_stream is the DBLP stream id used by the RDF endpoint, such as conf/dimva.

Abstracts

Abstract enrichment is optional, cached, and best-effort. sec-grep uses paper DOIs and DBLP paper URLs to find abstracts.

sec-grep update --abstracts
sec-grep enrich --jobs 8

No API keys are required, but keys can improve rate limits and coverage.

Variable Used for Get a key
OPENALEX_API_KEY OpenAlex lookups openalex.org/settings/api
SEMANTIC_SCHOLAR_S2_KEY Semantic Scholar lookups semanticscholar.org/product/api
OPENREVIEW_USERNAME / OPENREVIEW_PASSWORD OpenReview lookups OpenReview API docs

Set them in the shell:

export OPENALEX_API_KEY=...
export SEMANTIC_SCHOLAR_S2_KEY=...
export OPENREVIEW_USERNAME=...
export OPENREVIEW_PASSWORD=...

Or place them in a local .env file:

OPENALEX_API_KEY=
SEMANTIC_SCHOLAR_S2_KEY=
OPENREVIEW_USERNAME=
OPENREVIEW_PASSWORD=

.env is loaded automatically when present.

Acknowledgements

Inspired by top4grep.

License

Released under the MIT License.

About

πŸ”Ž Fast, local search across the security & privacy literature, with an expressive query language, an interactive TUI, and scriptable output.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors