patent
patent takes a plain-English dev-tool idea and searches 12 open-source registries — crates.io, npm, PyPI, GitHub, Homebrew, and more. Results are ranked by semantic similarity and summarised as Open, Crowded, or Saturated.
Like a patent search, but for code. It finds prior art, yet, never certifies absence.
Install
Pre-built binaries are on the releases page.
Ollama (optional) powers the LLM verdict — install from ollama.com, then ollama pull qwen2.5. Use --fast to skip it entirely.
GitHub token (optional) — set GITHUB_TOKEN to raise the search rate limit from 10 to 30 requests/minute.
Linux build deps — needed before cargo install:
- Fedora / RHEL:
sudo dnf install openssl-devel gcc-c++ - Ubuntu / Debian:
sudo apt install libssl-dev g++
Usage
# interactive mode — launches a search prompt inside the TUI
# no model warmup, no wait
# pipe to jq
|
# use a cloud LLM instead of local Ollama
Options
| Flag | Description | Default |
|---|---|---|
--fast |
no LLM, no wait — verdict derived from similarity scores | — |
--json |
stdout JSON instead of the TUI | — |
--model <MODEL> |
model name for the verdict; or PATENT_MODEL |
qwen2.5 |
--api-base <URL> |
OpenAI-compatible base URL (must end in /v1); or PATENT_API_BASE |
— |
--api-key <KEY> |
API key for --api-base; or PATENT_API_KEY / OPENAI_API_KEY |
— |
--limit <N> |
max matches to keep after ranking | 50 |
--completions <SHELL> |
print shell completions and exit | — |
Settings can also be stored in ~/.config/patent/config.toml:
= "gpt-4o-mini"
= "https://api.openai.com/v1"
= "sk-..."
Precedence: CLI flag > environment variable > config file > built-in default.
TUI keybindings
| Key | Action |
|---|---|
↑ / k |
Scroll up |
↓ / j |
Scroll down |
g / Home |
Jump to top |
G / End |
Jump to bottom |
/ |
Filter matches |
s |
Cycle sort (similarity / popularity / name) |
m |
Show more / show less |
Enter |
Show match details (description, popularity, URL) |
o |
Open selected URL in browser |
y |
Copy selected URL to clipboard |
n |
New search (interactive mode) |
? |
Help overlay |
q |
Quit |
Mouse works too — scroll with the wheel, click to select.
Shell completions
Contributing
Contributions are welcome! See CONTRIBUTING.md for setup and workflow. The good first issue and help wanted labels are a good starting point.
Development
The demo GIF is generated with vhs: vhs demo.tape.
License
Licensed under either of MIT or Apache-2.0 at your option.