| Crates.io | cruxlines |
| lib.rs | cruxlines |
| version | 0.3.0 |
| created_at | 2025-12-27 21:28:24.700475+00 |
| updated_at | 2026-01-23 19:20:40.445419+00 |
| description | Ranks symbol definitions by cross-file references using tree-sitter. |
| homepage | |
| repository | https://github.com/kantord/cruxlines |
| max_upload_size | |
| id | 2007861 |
| size | 155,390 |
cruxlines analyzes a codebase and ranks symbol definitions by how often they are referenced, with a bias toward references coming from "hot" files. It outputs quickfix-friendly lines for jumping to definitions.
cruxlines works in two layers:
File graph
Definition scoring
The output includes all components so you can interpret the score.
The goal is to keep logic simple and avoid heavy per-language semantics:
These heuristics are not semantically perfect, but they keep complexity low while producing useful rankings.
Analyze the current repo (run from the repo root):
cruxlines
Filter by ecosystem (defaults to all):
cruxlines --ecosystem python
Shorthand aliases are supported (py, js, ts, tsx, rs):
cruxlines -e py
Java/Kotlin use the java ecosystem (alias jvm):
cruxlines -e java
Include score metadata in the output:
cruxlines --metadata
Use the library API by passing a repo root and selected ecosystems:
use std::collections::HashSet;
use std::path::PathBuf;
use cruxlines::{cruxlines, Ecosystem};
let repo_root = PathBuf::from(".");
let ecosystems = HashSet::from([Ecosystem::Python, Ecosystem::JavaScript]);
let rows = cruxlines(&repo_root, &ecosystems)?;
Each line matches the Vim quickfix format and includes the definition line:
path:line:col: <line>
With --metadata, the message includes the scoring fields:
path:line:col: rank=... local=... file=... name=... | <line>
Reference detection is heuristic and may include false positives.
.java).py).js, .jsx).ts, .tsx).kt, .kts).rs)cruxlines expects to run from the repository root (a directory with .git) and
always scans the whole repo.
cruxlines uses git history to compute frecency for files via the frecenfile
crate. If no git repository is found, frecency defaults to neutral weighting.