Skip to main content

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.

Vasken Houdoverdov

Created with Google Antigravity

ls3d

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:

  1. Single-Room Overview: 1,000 photos appear as one stacked emerald cylinder ([x1,000] Images), 500 scripts as one stacked indigo cuboid ([x500] Source Code), etc.—keeping rendering fast regardless of directory size.
  2. In-Room Focus Drill-Down (Enter): Press Enter on 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.
  3. 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.
  4. Raw Override (K): Toggle smart clustering ON/OFF at any time (or pass --no-cluster / --cluster-threshold N).

ls3d-many-files

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.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ls3d 0.1.0
File Size Uploaded Provenance Actions
ls3d-0.1.0.tar.gz 34.2 kB With provenance Details for ls3d-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ls3d 0.1.0
File Interpreter ABI Platform Actions
ls3d-0.1.0-py3-none-any.whl Python 3 none any Details for ls3d-0.1.0-py3-none-any.whl

Total release size: 64.8 kB

Release files / ls3d-0.1.0.tar.gz

Download URL ls3d-0.1.0.tar.gz
Size 34.2 kB
Tags Source
SHA-256 checksum
How to use checksums
b124274eb24c593e2a5f8c77077926c30fb9a376d5aa0eaccc6760acf131ce6a
BLAKE2b-256 checksum
How to use checksums
eadb7484a7eb870cf785b315911a35ea514461fa340396ab8e8f1ed2e35c1adc
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 log

Release files / ls3d-0.1.0-py3-none-any.whl

Download URL ls3d-0.1.0-py3-none-any.whl
Size 30.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b82271364c9266169d8f70bcd0737596d28e92f2893c3fc4a91d5969340a5f54
BLAKE2b-256 checksum
How to use checksums
abe9b82c6f44ef44a6713f0c43c620ebde416ad75ec9ea23e9837574e5a9c60d
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 log

Security for ls3d 0.1.0

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.

Select from 2 files

Attestation for ls3d-0.1.0.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 log

A 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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page