LLM 结论默认依赖本地 Ollama,需先安装并执行 ollama pull qwen3.5,否则用 --fast 跳过;不设 GITHUB_TOKEN 时 GitHub 搜索限流为每分钟 10 次;使用 --api-base 会把搜索词发送到远端服务器,且该 URL 必须以 /v1 结尾。
patent
r14ddApache-2.0活跃维护在写轮子前先查查有没有人做过:用向量检索和本地 LLM 在 npm、PyPI 上搜索相似包,判断你的开发点子是否已被实现。
A prior-art search for your code ideas — has this dev tool already been shipped?
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/r14dd/patent/releases/latest/download/patent-installer.sh | sh
brew install r14dd/patent/patentREADME 未说明显存要求;本地语义检索依赖随包附带的 ONNX Runtime,预编译二进制和源码编译均要求 glibc 2.38 或更高(Ubuntu 22.10+、Debian 13+、Fedora 38+),Ubuntu 22.04 需在更新的容器内构建。
用自然语言描述你的开发工具点子,一次搜索 19 个包仓库和社区,判断是否已有人做过
在写轮子前先查查有没有人做过:用向量检索和本地 LLM 在 npm、PyPI 上搜索相似包,判断你的开发点子是否已被实现。
核心能力
- 一次查询并发搜索 19 个来源,含 crates.io、npm、PyPI 等包仓库与 GitHub、Hacker News
- 用 fastembed 在本地做向量嵌入,按余弦相似度而非关键词排序匹配结果
- 按最后更新时间标记 2 年以上未维护的项目,只标记不降权
- 由 LLM 给出 Open、Crowded、Saturated 三档结论,并以相似度数据作为下限
- 提供 --json 输出与 0、1、2 退出码,便于脚本和 CI 按结论判断是否继续
容易踩的坑
- v0.14.30.14.3最新正式版2026-11-03 · 2026-11-03 16:26 UTC
Release Notes
Security
- rustls-webpki bumped to 0.103.16 for RUSTSEC-2026-0382 (certificate
verification may accept distrusted intermediates). It sits under
reqwestviarustls, so every source adapter's HTTPS goes through it - webpki-roots and webpki-root-certs bumped to 1.0.11 for RUSTSEC-2026-0381 and
RUSTSEC-2026-0383 (bundled roots still trusted distrusted emSign
intermediates). They come in under
fastembed→hf-hub→ureq, which downloads the embedding model
Install patent 0.14.3
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/r14dd/patent/releases/download/v0.14.3/patent-installer.sh | shInstall prebuilt binaries via Homebrew
brew install r14dd/patent/patentDownload patent 0.14.3
File Platform Checksum patent-aarch64-apple-darwin.tar.xz Apple Silicon macOS checksum patent-x86_64-pc-windows-msvc.zip x64 Windows checksum patent-aarch64-unknown-linux-gnu.tar.xz ARM64 Linux checksum patent-x86_64-unknown-linux-gnu.tar.xz x64 Linux checksum - rustls-webpki bumped to 0.103.16 for RUSTSEC-2026-0382 (certificate
verification may accept distrusted intermediates). It sits under
- v0.14.20.14.22026-11-03 · 2026-11-03 16:08 UTC
查看更新说明
Release Notes
All five found by Martin Czygan (@miku) while porting patent to Go as silt — thanks.
Fixed
- A timestamp near year 9999 crashed the whole run.
9999-12-31T23:00:00-02:00is valid, but converting it to UTC lands past year 9999 and panicked. It now reads as "no date" - One long description made ranking take 19 s instead of about 1 s. Embeddings ran in batches of 256 padded to the longest text, so a single 720-word description made every text in its batch cost as much. Texts are now embedded in length order in batches of 32 (0.3 s); scores match to within float rounding
- Which duplicate survived dedup changed from run to run. Sources were
queried in
HashSetorder and dedup keeps the first copy. They now run in a fixed order, sosources_checkedin--jsonis stable too - A gap could be dropped for naming a match it didn't name. The whole-word
check lost the character before each repeat occurrence, so
"atat"counted as containing the word"at" - The model download is ~90 MB, not ~80 MB
Install patent 0.14.2
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/r14dd/patent/releases/download/v0.14.2/patent-installer.sh | shInstall prebuilt binaries via Homebrew
brew install r14dd/patent/patentDownload patent 0.14.2
File Platform Checksum patent-aarch64-apple-darwin.tar.xz Apple Silicon macOS checksum patent-x86_64-pc-windows-msvc.zip x64 Windows checksum patent-aarch64-unknown-linux-gnu.tar.xz ARM64 Linux checksum patent-x86_64-unknown-linux-gnu.tar.xz x64 Linux checksum - A timestamp near year 9999 crashed the whole run.
- v0.14.10.14.12026-10-10 · 2026-10-10 20:29 UTC
查看更新说明
Release Notes
Security
- rustls bumped to 0.23.45 for RUSTSEC-2026-0285 (TLS 1.3 handshake messages
accepted across encryption levels). It sits under
reqwest, so every source adapter's HTTPS goes through it - lru bumped to 0.18.5 for RUSTSEC-2026-0253 (use-after-free in
LruCache::pop()). It comes in underratatui
Changed
- fastembed 6 → 7. The ranking model stays pinned to
AllMiniLML6V2 - Dependency refresh: clap 4.6.7, clap_complete 4.6.11, thiserror 2.0.21, tokio-test 0.4.6
Fixed
- npm was skipped for any idea longer than 64 characters. The registry
rejects a longer
textwith400 ERR_TEXT_LENGTH, so a sentence-length idea reported npm as "not reached". The adapter now sends the idea verbatim when it fits and otherwise the longest keywords that do - A source that failed printed a warning over the TUI.
search_sourceswrote⚠ <source> not reachedto stderr while the interface was on screen, garbling the search view. Failed sources are already listed as "Not reached" (and in--jsonassources_failed), so the print is gone
Install patent 0.14.1
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/r14dd/patent/releases/download/v0.14.1/patent-installer.sh | shInstall prebuilt binaries via Homebrew
brew install r14dd/patent/patentDownload patent 0.14.1
File Platform Checksum patent-aarch64-apple-darwin.tar.xz Apple Silicon macOS checksum patent-x86_64-pc-windows-msvc.zip x64 Windows checksum patent-aarch64-unknown-linux-gnu.tar.xz ARM64 Linux checksum patent-x86_64-unknown-linux-gnu.tar.xz x64 Linux checksum - rustls bumped to 0.23.45 for RUSTSEC-2026-0285 (TLS 1.3 handshake messages
accepted across encryption levels). It sits under
- v0.14.00.14.02026-09-08 · 2026-09-08 05:49 UTC
查看更新说明
Release Notes
Added
- Windows x86_64 prebuilt. The release workflow now builds
patent-x86_64-pc-windows-msvc.zip(#36). The binary links the dynamic CRT, so it needs the Visual C++ Redistributable, which current Windows installs already have. The Homebrew formula and shell installer are unchanged
Install patent 0.14.0
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/r14dd/patent/releases/download/v0.14.0/patent-installer.sh | shInstall prebuilt binaries via Homebrew
brew install r14dd/patent/patentDownload patent 0.14.0
File Platform Checksum patent-aarch64-apple-darwin.tar.xz Apple Silicon macOS checksum patent-x86_64-pc-windows-msvc.zip x64 Windows checksum patent-aarch64-unknown-linux-gnu.tar.xz ARM64 Linux checksum patent-x86_64-unknown-linux-gnu.tar.xz x64 Linux checksum - Windows x86_64 prebuilt. The release workflow now builds
- v0.13.10.13.12026-09-05 · 2026-09-05 14:28 UTC
查看更新说明
Release Notes
Added
- Homebrew tap.
brew install r14dd/patent/patentinstalls the prebuilt binary from ther14dd/homebrew-patenttap, which the release workflow now publishes to (#35). Covers Apple Silicon macOS and x86_64/aarch64 Linux; Intel macOS is not built
Fixed
- Hex was returning the same hundred packages for every idea. Its search
grammar honours a single bare term only: a space-joined multi-word query
returns the unfiltered catalogue (100 packages, alphabetical, identical
whatever the idea), and with
description:prefixes only the last term filters. Progressive narrowing cannot see that, because the flood is never empty, so the adapter now searches each of the three longest keywords on its own and merges the results. Live, "file watcher" now returnsfile_watch,ex_watcherandfsnotifywhere it returnedaba_validatorandabsinthe_genbefore. This was the worst shape of thin evidence: not an empty source but a populated, irrelevant one - crates.io ANDs every term — measured live, a seven-keyword idea returns three unrelated crates and a five-keyword one 121, while two of its longest keywords return tens of thousands. It now narrows progressively like the other ANDing registries. The multi-term audit (#95) is complete: Docker Hub, GitHub, Hackage, Nixpkgs, npm and the VS Code Marketplace were probed with the same seven-keyword idea and OR their terms, so they are unchanged; PyPI stays blocked by #94
Install patent 0.13.1
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/r14dd/patent/releases/download/v0.13.1/patent-installer.sh | shInstall prebuilt binaries via Homebrew
brew install r14dd/patent/patentDownload patent 0.13.1
File Platform Checksum patent-aarch64-apple-darwin.tar.xz Apple Silicon macOS checksum patent-aarch64-unknown-linux-gnu.tar.xz ARM64 Linux checksum patent-x86_64-unknown-linux-gnu.tar.xz x64 Linux checksum - Homebrew tap.
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
patent
patent takes a plain-English dev-tool idea and searches 19 sources — package registries (crates.io, npm, PyPI, Homebrew, Packagist, Hex, and more) plus GitHub and Hacker News. 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.
Why patent?
Before you build a dev tool, patent checks whether it already exists. One query fans out across 19 sources at once — package registries plus GitHub and Hacker News — instead of you searching each by hand. Matches are ranked locally by semantic similarity (not keyword match), so close-but-differently-worded prior art still surfaces, and the verdict is scoped to what was actually found — an honest "keep looking" rather than a hallucinated "this is novel."
How it works
- Source selection —
patentpicks the registries relevant to your idea; GitHub and Hacker News are always searched. - Semantic ranking — every match is embedded locally with
fastembedand ranked by cosine similarity to your idea. - Maintenance signal — where a source publishes one, a match shows when it was last updated, and anything untouched for 2+ years is flagged
⚑. Stale matches are flagged, never demoted: an abandoned tool is still proof the idea has been built. A match with no date is one no source published a date for — not a stale one. (If two sources return the same URL, the surviving row borrows whichever date was found.) - Verdict — an LLM summarises the landscape into one of three levels, floored against the similarity data so it can never under-rate a populated space:
- 🟢 Open — nothing close found in the sources checked.
- 🟡 Crowded — a few adjacent tools exist.
- 🔴 Saturated — the space is densely populated.
What a clean result means
patent can prove something exists; it can never prove something doesn't — it only searched some sources. Every verdict is scoped to "found in the sources checked," the list of sources checked is always shown, and any selected source that failed is surfaced as "not reached." A clean Open result means keep looking before you commit, not a green light.
Install
macOS / Linux — one command, no Rust needed:
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/r14dd/patent/releases/latest/download/patent-installer.sh | sh
Homebrew:
brew install r14dd/patent/patent
Windows — grab patent-x86_64-pc-windows-msvc.zip from the releases page and unzip it.
From source (requires Rust):
cargo install patent
Linux build deps — needed before cargo install:
- Fedora / RHEL:
sudo dnf install openssl-devel gcc-c++ - Ubuntu / Debian:
sudo apt install libssl-dev g++
glibc 2.38+ — both the prebuilt binaries and a from-source cargo install require glibc 2.38 or newer (Ubuntu 22.10+, Debian 13+, Fedora 38+). The bundled ONNX Runtime that powers local semantic search depends on it. On older distributions such as Ubuntu 22.04 (glibc 2.35), build inside a newer toolchain — e.g. a debian:13 / ubuntu:24.04 container — rather than on the host (#37).
Ollama (optional) powers the LLM verdict — install from ollama.com, then ollama pull qwen3.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.
Usage
patent "interactive cli to kill whatever's on a port"
# interactive mode — launches a search prompt inside the TUI
patent
# no model warmup, no wait
patent "kubernetes log viewer" --fast
# pipe to jq
patent "react component for infinite scroll" --json | jq .
# use a cloud LLM instead of local Ollama
patent "kubernetes log viewer" --api-base https://api.openai.com/v1 --model gpt-4o-mini
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 | qwen3.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 a config.toml in your platform's config directory:
- Linux:
~/.config/patent/config.toml - macOS:
~/Library/Application Support/patent/config.toml - Windows:
%APPDATA%\patent\config.toml
model = "gpt-4o-mini"
api_base = "https://api.openai.com/v1"
api_key = "sk-..."
Precedence: CLI flag > environment variable > config file > built-in default.
Privacy: with
--api-base, your search query is sent to that remote server to generate the verdict. The default local Ollama backend — and--fast, which skips the LLM entirely — keep everything on your machine.
Exit codes
patent exits with a status derived from the verdict, so you can gate scripts and CI on it:
| Code | Meaning |
|---|---|
0 | Open |
1 | Crowded |
2 | Saturated |
(Usage errors and unreachable backends exit non-zero as well.)
Use as a library
patent is also a published library crate — the engine is reusable. See docs.rs/patent: sources::search_all fans out to the registries, rank::rank_async ranks matches by semantic similarity, and verdict::assess produces the integrity-scoped verdict over any LLM backend.
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, last updated, URL) |
o | Open selected URL in browser |
y | Copy selected URL to clipboard |
n | New search (interactive mode) |
? | Help overlay |
q | Quit |
Markers
| Marker | Meaning |
|---|---|
⚑ | No update in 2+ years — only ever shown where a date is actually known, so its absence is not a claim of freshness |
Mouse works too — scroll with the wheel, click to select.
Shell completions
patent --completions bash >> ~/.bashrc # Bash
patent --completions zsh >> ~/.zshrc # Zsh
patent --completions fish > ~/.config/fish/completions/patent.fish
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
cargo test
cargo fmt --all --check
cargo clippy --all-targets -- -D warnings
The demo GIF embedded above is generated with vhs: vhs showcase.tape.
License
Licensed under either of MIT or Apache-2.0 at your option.