Skip to content
Docsgr similar

Command line

gr similar

Find similar code using local embeddings

From the help of gr 0.2.16. gr help similar prints it in full.

Find similar code by node id, path, or path:symbol. Similarity never proves equivalence or a call. Use --batch <in.jsonl> for an offline audit: one {ref,k} input and one {ref,hits,model,model_rev} output per line.

gr similar <ref> [-k N] [--kind K] [--path P] [--json] [flags]
FlagWhat it does
--batch stringoffline JSONL audit input
--jsonprint the JSON result
-k, --k intmaximum similar hits (max 100) (default 10)
--kind stringnode kind filter
--path stringcode-path prefix filter

Every command also takes --root <folder>, the project to act on. Without it, gr uses the git repository you are in, or else the current folder.

These docs describe Graphide 0.2.16, the latest release. Something wrong or missing? Tell us onDiscord or at hello@graphide.com.