[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-82889":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":23,"hasPages":23,"topics":25,"createdAt":10,"pushedAt":10,"updatedAt":32,"readmeContent":33,"aiSummary":34,"trendingCount":16,"starSnapshotCount":16,"syncStatus":35,"lastSyncTime":36,"discoverSource":37},82889,"patent","r14dd\u002Fpatent","r14dd","A prior-art search for your code ideas. Stop building what already exists.","",null,"Rust",373,10,1,4,0,6,133,260,32,85.12,"Apache License 2.0",false,"main",[26,27,28,29,30,31],"cli","developer-tools","ollama","rust","search","tui","2026-06-12 04:01:39","# patent\n\n**A prior-art search for your code ideas.** Stop building what already exists —\nfind the state of the art in seconds, without leaving the terminal.\n\n[![downloads](https:\u002F\u002Fimg.shields.io\u002Fcrates\u002Fd\u002Fpatent.svg)](https:\u002F\u002Fcrates.io\u002Fcrates\u002Fpatent)\n[![docs.rs](https:\u002F\u002Fdocs.rs\u002Fpatent\u002Fbadge.svg)](https:\u002F\u002Fdocs.rs\u002Fpatent)\n[![CI](https:\u002F\u002Fgithub.com\u002Fr14dd\u002Fpatent\u002Factions\u002Fworkflows\u002Fci.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Fr14dd\u002Fpatent\u002Factions\u002Fworkflows\u002Fci.yml)\n[![GitHub stars](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fstars\u002Fr14dd\u002Fpatent?style=flat&logo=github)](https:\u002F\u002Fgithub.com\u002Fr14dd\u002Fpatent\u002Fstargazers)\n[![license: MIT OR Apache-2.0](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-MIT%20OR%20Apache--2.0-blue.svg)](#license)\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Fraw.githubusercontent.com\u002Fr14dd\u002Fpatent\u002Fmain\u002Fdemo.gif\" alt=\"patent in action\" width=\"720\">\n\u003C\u002Fp>\n\nGive `patent` a plain-English dev-tool idea and it searches 11 open-source\nregistries — crates.io, npm, PyPI, GitHub, Docker Hub, and more — ranks the\nmatches with local semantic search, and writes an honest verdict on whether the\nspace is **Open**, **Crowded**, or **Saturated**. Everything runs on your\nmachine.\n\n```bash\ncargo install patent\n```\n\n```bash\npatent \"interactive cli to kill whatever's on a port\"\n```\n\n> Like a patent search, but for code. A patent search *finds prior art* — it\n> never certifies absence. Neither does this.\n\n## Why\n\n- **Prevent wasted effort** — find out something already exists *before* you\n  spend a month rebuilding it.\n- **Find inspiration & benchmarks** — see the closest prior art, ranked, so you\n  know exactly what you'd have to beat.\n- **Competitive analysis** — survey an entire ecosystem in one command instead\n  of tab-hopping across a dozen registries.\n\n## Quick demo\n\n```bash\n# A crowded space — lots of prior art, ranked by relevance\npatent \"distributed key-value store in rust\"\n\n# Pipe structured output into your own tooling\npatent \"react component for infinite scroll\" --json | jq .\n\n# Skip the AI verdict for an instant, search-only result\npatent \"kubernetes log viewer\" --fast\n```\n\n## Features\n\n- **Search the entire developer ecosystem at once** — 11 registries (crates.io,\n  npm, PyPI, GitHub, Go, Maven, NuGet, RubyGems, Docker Hub, VS Code\n  Marketplace, Hacker News) in a single command.\n- **It searches the right places automatically** — mention \"rust\" and it hits\n  crates.io; mention \"docker\" and it hits Docker Hub. GitHub and Hacker News\n  (both language-agnostic) are always searched; with no language signal it falls\n  back to a broad sweep across the largest registries.\n- **Relevance you can trust** — local embeddings (AllMiniLM-L6-V2 via\n  [fastembed](https:\u002F\u002Fcrates.io\u002Fcrates\u002Ffastembed)) rank every match by cosine\n  similarity to your idea, so the closest prior art floats to the top.\n- **An honest verdict, not hype** — a local [Ollama](https:\u002F\u002Follama.com) model\n  (or any OpenAI-compatible API via `--api-base`) classifies the space as Open \u002F\n  Crowded \u002F Saturated and names the gaps you could fill. It can prove something\n  *exists*; it never claims something *doesn't*.\n- **Instant mode** — `--fast` skips the LLM and gives you the ranked list\n  immediately, with a saturation level derived straight from the similarity\n  data.\n- **See it, don't parse it** — an interactive TUI with scrollable, filterable,\n  sortable matches, a detail popup for any result, mouse support, and one-key\n  URL opening. Need machine output? `--json`.\n- **Local-first & private** — embeddings always run on your machine, and the\n  verdict uses a local LLM by default; point `--api-base` at a cloud API only if\n  you want to.\n- **Never fails loud** — LLM down, model not pulled, or a cloud API rejecting\n  the request? Results still render, ranked by similarity, without an AI verdict.\n  A source fails? It's skipped (and shown as \"not reached\"), never fatal.\n\n## Install\n\n### From crates.io\n\n```bash\ncargo install patent\n```\n\n### From source\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fr14dd\u002Fpatent.git\ncd patent\ncargo install --path .\n```\n\n### Prerequisites\n\n**Rust** (stable 1.80+) via [rustup](https:\u002F\u002Frustup.rs).\n\n**Ollama** (optional, recommended) — powers the AI verdict. Skip it and use\n`--fast`, or just let `patent` fall back to a similarity-only verdict:\n\n```bash\n# macOS\nbrew install ollama\n\n# Linux\ncurl -fsSL https:\u002F\u002Follama.com\u002Finstall.sh | sh\n\n# Windows (or download the installer from https:\u002F\u002Follama.com\u002Fdownload)\nwinget install Ollama.Ollama\n\n# Then (any platform):\nollama pull qwen2.5\nollama serve\n```\n\n**Cloud or OpenAI-compatible API** (alternative to Ollama) — point `patent` at\nany server that speaks the OpenAI chat API with `--api-base`, plus `--api-key`\n(or the `OPENAI_API_KEY` env var):\n\n```bash\n# OpenAI\npatent \"vector database\" --api-base https:\u002F\u002Fapi.openai.com\u002Fv1 --model gpt-4o-mini --api-key sk-...\n\n# OpenRouter\npatent \"vector database\" --api-base https:\u002F\u002Fopenrouter.ai\u002Fapi\u002Fv1 --model openai\u002Fgpt-4o-mini --api-key sk-or-...\n\n# Local LM Studio \u002F llama.cpp \u002F vLLM (usually no key needed)\npatent \"vector database\" --api-base http:\u002F\u002Flocalhost:1234\u002Fv1 --model your-model\n```\n\n**GitHub token** (optional) — the unauthenticated GitHub search API is limited\nto 10 requests\u002Fminute. Set a token to raise that to 30 requests\u002Fminute (3×):\n\n```bash\n# macOS \u002F Linux\nexport GITHUB_TOKEN=ghp_your_token_here\n```\n\n```powershell\n# Windows (PowerShell)\n$env:GITHUB_TOKEN = \"ghp_your_token_here\"\n```\n\n**First run** — `patent` downloads a small (~80 MB) embedding model the first\ntime it ranks results. You'll see a one-time `downloading the embedding model…`\nnotice. It's cached under your OS cache directory (e.g. `~\u002FLibrary\u002FCaches\u002Fpatent`\non macOS, `~\u002F.cache\u002Fpatent` on Linux, `%LOCALAPPDATA%\\patent` on Windows), so\nit's a one-time download shared across every directory you run from.\n\n## Usage\n\n```bash\n# Basic search — opens the interactive TUI\npatent \"CLI tool that kills whatever's on a port\"\n\n# Instant, search-only result — no model warm-up, no inference wait\npatent \"CLI tool that kills whatever's on a port\" --fast\n\n# Structured JSON output for scripting\npatent \"react component for infinite scroll\" --json | jq .\n\n# Use a smaller\u002Ffaster Ollama model\npatent \"kubernetes log viewer\" --model qwen2.5:3b\n\n# Use a cloud LLM instead of local Ollama\npatent \"kubernetes log viewer\" --api-base https:\u002F\u002Fapi.openai.com\u002Fv1 --model gpt-4o-mini\n\n# Keep more matches after ranking\npatent \"async runtime for rust\" --limit 100\n```\n\n### Options\n\n| Flag | Description | Default |\n|---|---|---|\n| `--fast` | Skip the LLM verdict for an instant, search-only result | — |\n| `--json` | Print JSON to stdout instead of the TUI | — |\n| `--model \u003CMODEL>` | LLM model for the verdict | `qwen2.5` (Ollama) |\n| `--api-base \u003CURL>` | Use an OpenAI-compatible API (base URL ending in `\u002Fv1`) instead of Ollama | — |\n| `--api-key \u003CKEY>` | API key for `--api-base` (or set `OPENAI_API_KEY`) | — |\n| `--limit \u003CN>` | Max matches to keep after ranking | `50` |\n| `--completions \u003CSHELL>` | Generate shell completions and exit | — |\n\n### Shell completions\n\n```bash\n# Bash\npatent --completions bash >> ~\u002F.bashrc\n\n# Zsh\npatent --completions zsh >> ~\u002F.zshrc\n\n# Fish\npatent --completions fish > ~\u002F.config\u002Ffish\u002Fcompletions\u002Fpatent.fish\n\n# PowerShell\npatent --completions powershell >> $PROFILE\n```\n\n## TUI keybindings\n\n| Key | Action |\n|---|---|\n| `↑` \u002F `k` | Scroll up |\n| `↓` \u002F `j` | Scroll down |\n| `g` \u002F `Home` | Jump to top |\n| `G` \u002F `End` | Jump to bottom |\n| `\u002F` | Filter matches |\n| `s` | Cycle sort (similarity \u002F popularity \u002F name) |\n| `m` | Show more \u002F show less |\n| `Enter` | Show match details (full description, popularity, URL) |\n| `o` | Open selected match in browser |\n| `?` | Help overlay |\n| `q` | Quit |\n\nThe mouse works too — scroll with the wheel, click a row to select it. Press\n`?` inside the TUI for the full keybinding reference.\n\n## How it works\n\n```\nidea ──► parse keywords\n              │\n              ├──► fan out to sources (concurrent, with retry)\n              │         │\n              │         ▼\n              │    dedup matches\n              │         │\n              ▼         ▼\n         load model ──► rank by cosine similarity\n                              │\n                              ▼\n                        verdict via LLM\n                              │\n                              ▼\n                        TUI or JSON\n```\n\n1. **Parse** — extracts keywords, selects relevant sources based on the idea\n2. **Search** — fans out to selected sources concurrently; a failing source is\n   skipped and retried once, never fatal\n3. **Rank** — embeds the idea and each match description with AllMiniLM-L6-V2,\n   sorts by cosine similarity, keeps the top N\n4. **Verdict** — sends the ranked matches to an LLM (local Ollama by default, or\n   an OpenAI-compatible API via `--api-base`) that classifies the space and\n   identifies gaps (or, with `--fast`, derives the level straight from the\n   similarity data)\n5. **Output** — interactive TUI (default) or structured JSON (`--json`)\n\nThe embedding model loads concurrently with source searches, so the model-load\nlatency is hidden behind network I\u002FO.\n\n## The integrity rule\n\n`patent` can prove something **exists**. It can **never** prove something\n*doesn't* — it only searched some sources. Every verdict is scoped to \"what was\nfound in the sources checked,\" and a clean result means *keep looking*, not\n*start building*.\n\nThe sources-checked list is always displayed for transparency, and sources that\nwere selected but failed to respond are surfaced as \"not reached\" — so a thin\nresult is never mistaken for \"nothing out there.\"\n\n## Architecture\n\n```\nsrc\u002F\n├── lib.rs              # library root\n├── model.rs            # Query, Match, Source, Verdict, Saturation\n├── sources\u002F\n│   ├── mod.rs          # trait Source, search_all fan-out, dedup, retry\n│   ├── crates_io.rs    # crates.io API\n│   ├── github.rs       # GitHub search API\n│   ├── npm.rs          # npm registry API\n│   ├── pypi.rs         # PyPI search (HTML scraping)\n│   ├── hacker_news.rs  # HN Algolia API\n│   ├── go.rs           # Go package search\n│   ├── maven.rs        # Maven Central API\n│   ├── nuget.rs        # NuGet API\n│   ├── rubygems.rs     # RubyGems API\n│   ├── docker_hub.rs   # Docker Hub API\n│   └── vscode.rs       # VS Code Marketplace API\n├── rank.rs             # fastembed embeddings + cosine similarity\n├── verdict.rs          # LLM prompt + response parsing\n├── llm.rs              # trait Llm (verdict backend interface)\n├── ollama.rs           # Llm impl: native Ollama client\n├── openai.rs           # Llm impl: OpenAI-compatible chat client\n└── tui.rs              # TUI state machine\nsrc\u002Fbin\u002Fpatent\u002F\n├── main.rs             # CLI entry point, pipeline wiring\n├── cli.rs              # clap argument parsing\n└── tui.rs              # ratatui rendering + event loop\n```\n\nLib\u002Fbin split: the testable core is the library; the binary is a thin CLI\u002FTUI\nshell.\n\n## Development\n\n```bash\ncargo fmt --all --check       # formatting (CI-enforced)\ncargo clippy --all-targets -- -D warnings  # lint (CI-enforced)\ncargo test                    # unit + wiremock integration tests\ncargo build --release         # optimized build\n```\n\nThe README demo GIF is generated with [vhs](https:\u002F\u002Fgithub.com\u002Fcharmbracelet\u002Fvhs):\n\n```bash\nvhs demo.tape                 # writes demo.gif\n```\n\n### Adding a new source\n\n1. Create `src\u002Fsources\u002Fyour_source.rs` implementing the `SourceAdapter` trait\n2. Add the variant to `Source` in `src\u002Fmodel.rs`\n3. Register it in `sources::build_source` and `sources::detect_sources`\n4. Add wiremock integration tests in `tests\u002Fsources.rs`\n\n## License\n\nLicensed under either of [MIT](LICENSE-MIT) or\n[Apache-2.0](LICENSE-APACHE) at your option.\n","patent 是一个用于代码想法的现有技术搜索工具，帮助开发者避免重复造轮子。其核心功能包括同时搜索11个开源注册表（如crates.io、npm、PyPI等），利用本地语义搜索对匹配项进行排名，并评估该领域是否开放、拥挤或饱和。专利采用Rust语言编写，具有快速安装和使用的特点，能够在几秒钟内返回结果而无需离开终端。适用于软件开发初期阶段，帮助开发者节省时间，寻找灵感与基准，以及进行竞争分析。",2,"2026-06-11 04:09:31","CREATED_QUERY"]