BACK TO PROJECT UNIVERSE

LENS — 03 / SOURCE TREE INVENTORY

Lens

Understand your project.Before you change it.

A fast, offline command-line tool.Point it at a directory and readits files, languages, sizes and shape.

PURPOSE
A Rust CLI for inspecting source trees, files, directories, languages, sizes, and project structure.
STACK
  • RUST
  • CLAP
  • SERDE
  • JSON
STATUS
WORKING CLI · v0.1.0
VIEW REPOSITORY GITHUB.COM / METHUOS / LENS
LENS FILES --SORT SIZE27 FILES · 2159 LINES.gitignore9 BCargo.lock11.60 KBCargo.toml271 BLICENSE11.09 KBREADME.md5.48 KBsrc/analyzers/git.rs1.48 KBsrc/analyzers/language.rs1014 Bsrc/analyzers/largest.rs321 Bsrc/analyzers/mod.rs324 Bsrc/analyzers/rust.rs1.01 KBsrc/cli.rs1.13 KBsrc/inventory.rs1.51 KBsrc/main.rs1.37 KBsrc/output/dirs.rs2.17 KBsrc/output/files.rs2.50 KBsrc/output/json.rs131 Bsrc/output/markdown.rs1 Bsrc/output/mod.rs93 Bsrc/output/terminal.rs3.07 KBsrc/output/tree.rs1.05 KBsrc/scanner/.gitignore8 Bsrc/scanner/counter.rs1.22 KBsrc/scanner/ignore.rs86 Bsrc/scanner/mod.rs730 Bsrc/scanner/walker.rs2.35 KBsrc/search.rs1.79 KBsrc/utils.rs1.15 KB
  1. Cargo.lock11.60 KB
  2. LICENSE11.09 KB
  3. README.md5.48 KB
  4. src/output/terminal.rs3.07 KB
  5. src/output/files.rs2.50 KB
  6. src/scanner/walker.rs2.35 KB
  7. src/output/dirs.rs2.17 KB
  8. src/search.rs1.79 KB

DATA: lens files --format json ON THE LENS REPOSITORY (v0.1.0)

ILLUSTRATIVE PREVIEW — orbit and inventory built from a real lens run on its own repository.

01 / THE PROBLEM

Unfamiliar code arrives without a map.

Before changing a project you need to know what is in it: how big it is, which languages it uses, where the largest files are, how it is laid out, and what state its Git history is in.

02 / THE IDEA

One command. A compact inventory.

Run lens in a directory and get a summary of files, directories, size, lines, extensions, languages, largest files, Rust package details and Git state — with sorting, a tree view, search, and JSON output for scripts.

03 / THE BUILD

Rust, clap, and a respectful walker.

Lens is a Rust 2024 crate. A scanner walks the tree while honouring ignore rules, analyzers read languages, Rust manifests and Git, and output renders to the terminal or JSON. Unit tests cover sorting, line counting and size formatting.

IN USE / REAL OUTPUT

One command, a compact inventory.

$ lens  ·  run on its own repository, excerpt
Project Summary
===============
Name          lens
Files         27
Directories   5
Size          52.89 KB
Lines         2159

Languages
---------
Rust           21 files     1079 lines
Markdown        1 file       403 lines
TOML            1 file        14 lines

Rust Project
============
Package      lens
Version      0.1.0
Edition      2024
  • lensproject summary
  • lens files --sort size --reversefiles by size
  • lens dirs --sort linesdirectories by lines
  • lens treeproject tree
  • lens search Cargo --format jsoncase-insensitive search as JSON
  • lens gitbranch, status, commits, remote

REPOSITORY STATUS

WORKING CLI · v0.1.0

Builds from source with cargo. Commands: summary, files, dirs, largest, tree, search, languages, rust and git. JSON output for files, dirs and search.

GITHUB.COM / METHUOS / LENS