Skip to main content

Crate patent

Crate patent 

Source
Expand description

patent — a prior-art search for your code ideas.

Takes a plain-English dev-tool idea and searches the open-source ecosystem — crates.io, npm, PyPI, GitHub, Go, Maven, NuGet, RubyGems, Docker Hub, the VS Code Marketplace, and Hacker News — for prior art, then gives an honest, scoped verdict on whether it’s already been built. The exact set searched is chosen per query; whichever sources actually responded are always surfaced.

Integrity principle: this tool can prove something exists, but never that it doesn’t — it only searched some sources. All output is scoped to “what was found in the sources checked.”

§Install

cargo install patent

§Usage

patent "interactive cli to kill whatever's on a port"   # interactive TUI
patent "react component for infinite scroll" --json      # structured output
patent "kubernetes log viewer" --fast                    # skip the LLM verdict
patent "vector database" --api-base https://api.openai.com/v1 --model gpt-4o-mini

§Using the library

patent is primarily the engine behind the CLI of the same name, but the core is reusable: sources::search_all fans out to the registries, rank orders matches by semantic similarity, and verdict::assess turns them into an integrity-scoped Verdict via any Llm backend (local Ollama or an OpenAI-compatible API).

Re-exports§

pub use llm::Llm;
pub use model::Match;
pub use model::Query;
pub use model::Saturation;
pub use model::Source;
pub use model::Verdict;

Modules§

llm
Text-generation backend used to write the verdict.
model
Core domain types shared across the pipeline.
ollama
Minimal Ollama client (localhost:11434/api/generate).
openai
OpenAI-compatible chat-completions backend.
rank
Semantic ranking.
sources
Source registry: one implementor per ecosystem, fanned out concurrently.
tui
TUI state machine.
verdict
Verdict generation.

Enums§

Error
Library-level error type. The binary maps these to anyhow with context.

Type Aliases§

Result
Crate result alias.