ls3d - List files in three dimensions
ls3d is a command-line tool analogous to ls that renders any directory as an interactive 3D spatial room directly inside your terminal.
Instead of scrolling through flat text lists, ls3d maps every file and subdirectory onto the floor of a single 3D room—scaled logarithmically by size and shaped/colored by filetype—so you can perceive the structure and weight of a directory at a glance. I was interested in creating this tool as a way to visualize any arbitrary directory as a single "room of objects" regardless of how many items exist.
Created with Google Antigravity
How It Works
Every item in the directory is placed on the room floor using a 3D Squarified Treemap (so even folders with 100+ files fit cleanly inside one room) or an optional Uniform Grid (T to toggle):
| File Type | 3D Shape | Color | Examples |
|---|---|---|---|
| Directories | Recessed Crate | Cyan | Subfolders (scaled by shallow size) |
| Code & Text | Cuboid | Indigo | .py, .ts, .js, .json, .md, .yaml |
| Media, DB & Archives | Smooth Cylinder | Emerald | .png, .mp4, .db, .sqlite, .zip, .gguf |
| Executables & Scripts | Pyramid | Amber | .sh, .bat, .ps1, .exe, +x binaries |
| File Clusters (Large Dirs) | Stacked / Layered Shape | Type Color | Bundled groups (e.g., [x1,000] Images) |
Under the hood, ls3d uses a pure Python + NumPy 3D software rasterizer with a per-pixel Z-buffer, directional lighting, ambient-occlusion floor shadows, 2x2 Supersampling Anti-Aliasing (SSAA), and 2x2 Unicode Quadrant Sub-Cells (▘▝▖▗▚▞▛▜▙▟▀▄▌▐█) for crisp diagonal edges in any 24-bit TrueColor terminal.
Handling Massive Directories (Semantic Clustering & Focus Mode)
Real folders often hold thousands of files (for example, 1,000 photos, 500 code files, and 300 logs). Rather than rendering 2,000 unreadable pixels or dropping files off-screen, ls3d automatically bundles large directories (default threshold: > 28 items) into stacked 3D clusters representing every file in the room:
- Single-Room Overview:
1,000photos appear as one stacked emerald cylinder ([x1,000] Images),500scripts as one stacked indigo cuboid ([x500] Source Code), etc.—keeping rendering fast regardless of directory size. - In-Room Focus Drill-Down (
Enter): PressEnteron a cluster to focus the 3D room onto that subset without leaving the directory (~/photos > [Focus: Images]). It splits by extension (*.jpg,*.png) and then into smart sorted buckets until you reach individual files. - Zoom Back Out (
Backspace/U): Pops back out one focus level at a time, and only steps up to the parent directory (..) once you're back at the full room view. - Raw Override (
K): Toggle smart clustering ON/OFF at any time (or pass--no-cluster/--cluster-threshold N).
Requirements
- Python 3.10+
numpy>=1.24- Any terminal supporting 24-bit TrueColor and UTF-8 (Windows Terminal, iTerm2, Kitty, Alacritty, WezTerm, GNOME Terminal, VS Code integrated terminal, etc.)
Installation
Install from PyPI with pip or pipx:
pip install ls3d
# or isolated CLI install:
pipx install ls3d
Or install from source for development:
git clone https://github.com/vhoudoverdov/ls3d.git
cd ls3d
pip install -e .
You can also invoke it as a Python module:
python -m ls3d
Usage
# Open an interactive 3D room for the current directory
ls3d
# Open a specific directory
ls3d ~/projects/webapp
# One-shot static output (prints inline to terminal scrollback and exits, like ls)
ls3d --once
# Customize camera angle, view mode, or floor layout
ls3d --once --angle -45
ls3d --once --first-person
ls3d --layout grid
# Include hidden dotfiles
ls3d -a
# Export a high-resolution PNG snapshot of the 3D room
ls3d --once --snapshot room.png --headless
Interactive Controls
| Key | Action |
|---|---|
← / → or A / D |
Rotate horizontal camera angle (smooth 60 FPS yaw) |
↑ / ↓ or W / S |
Tilt camera elevation (pitch) |
+ / - |
Zoom camera in / out |
Tab or [ / ] |
Select next / previous shape in the room |
PgDn / PgUp |
Jump forward / backward by 10 shapes |
Enter |
Focus into a stacked Cluster, OR step into a Directory (cd) |
Backspace or U |
Zoom out of Focus Mode, OR step up to parent directory (..) |
K |
Toggle Smart Semantic Clustering (Auto vs Raw) |
T |
Toggle floor layout (3D Treemap vs Uniform Grid) |
V |
Toggle camera projection (Isometric vs First-Person) |
G |
Toggle glyph renderer (2x2 Quadrant Sub-Cells vs Half-Blocks) |
M |
Toggle 2x2 SSAA anti-aliasing |
O |
Cycle sort order (SIZE → NAME → MTIME) |
. |
Toggle hidden dotfiles |
L |
Toggle floating 3D filename & size labels |
R |
Reset camera to default isometric angle (38°) |
P |
Save a PNG snapshot (ls3d_snapshot.png) |
? or H |
Toggle in-app help overlay |
Q or Esc |
Quit |
Running Tests
python -m unittest discover -s tests -v
License
MIT — see LICENSE.
Metadata
Release files for ls3d 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ls3d-0.1.2.tar.gz | 34.3 kB | With provenance | Details for ls3d-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ls3d-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for ls3d-0.1.2-py3-none-any.whl |
Total release size: 64.8 kB
Release files / ls3d-0.1.2.tar.gz
| Download URL | ls3d-0.1.2.tar.gz |
|---|---|
| Size | 34.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e1c78f3efeb2c20570b32d801c9766918bf805602fe835f86b11a78ae3cedc82
|
|
BLAKE2b-256 checksum How to use checksums |
1a6be4555fea7d670489fb9bd5a753b1ba3b53e1c4756e4c0f61b595351be2cd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logRelease files / ls3d-0.1.2-py3-none-any.whl
| Download URL | ls3d-0.1.2-py3-none-any.whl |
|---|---|
| Size | 30.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ae4c6f25167db308400a4ad858ce6ecc8061eb27e2986fdc2e9f74d749ea215d
|
|
BLAKE2b-256 checksum How to use checksums |
7c8da338cf39ce47ceceb26a9072e816a89b0619dfe05055e8cc34144bad8435
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logSecurity for ls3d 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for ls3d-0.1.2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.