Releases: deeplook/dirplot
Releases · deeplook/dirplot
v0.3.3
Added
- Breadcrumbs mode (
--breadcrumbs/--no-breadcrumbs,-b/-B, on by default): directories
that form a single-child chain (one subdirectory, no files) are collapsed into a single tile
whose header shows the full path separated by/(e.g.src / dirplot / fonts). When the
label is too wide, middle segments are replaced with…(src / … / fonts). The root tile
is never collapsed. Disable with-Bor--no-breadcrumbs. - Tree depth in root label: the root tile header now includes
depth: Nalongside the
file, directory, and size summary (e.g.myproject — 124 files, 18 dirs, 4.0 MB (…), depth: 6).
The depth reflects the original tree structure and is invariant to whether breadcrumbs mode
is active.
v0.3.2
Added
- Vertical file labels: file tiles that are at least twice as tall as wide now
display their label rotated 90° CCW, letting the text span the full tile height
instead of being squeezed into the narrow width. - Scan and render timing shown in header output:
Found 1,414 files … [2.3s]andSaved dirplot to out.png [0.4s]. - Multiple local roots:
dirplot map src testsaccepts two or more local
directory paths, finds their common parent, and shows only those subtrees. --subtree/-soption (repeatable) — allowlist complement to--exclude:
keep only the named direct children of the root after scanning. Supports nested
paths such as--subtree src/dirplot/fonts.
Fixed
--excludeon pod and Docker backends now prunes entire subtrees — previously only
the exact path was matched, so all children leaked through.- Clearer error for distroless pods: exit code 126 from
kubectl execnow surfaces as
an actionable message explaining that the container has no shell orfindutility. - Adaptive file-label font size is now computed with a single
textbboxmeasurement
(one call per tile) instead of stepping down one pixel at a time — eliminates an
O(font_size × n_tiles) bottleneck that caused near-blocking on large trees such as
.venvdirectories.
Changed
-sshort alias reassigned from--font-sizeto--subtree.--font-sizestill
works as before; it just no longer has a single-letter alias.
v0.3.1
Added
-
github://URI now accepts an optional subpath after the repository name, letting
you scan a subdirectory directly:github://owner/repo/sub/path— subpath on the default branchgithub://owner/repo@ref/sub/path— subpath on a specific branch, tag, or commit SHAhttps://github.com/owner/repo/tree/branch/sub/path— full GitHub URL form- Tags and commit SHAs are supported wherever a branch ref was previously accepted
(e.g.github://torvalds/linux@v6.12), as the GitHub trees API accepts any git ref.
-
--legend Nreplaces the old boolean--legend/--no-legendflag. It now shows a
file-count legend — a sorted list of the top N extensions by number of files,
with a coloured swatch and the file count for each entry:- Pass
--legendalone to use the default of 20 entries. - Pass
--legend 10for a custom limit. - Omit the flag entirely to show no legend.
- The number of rows is also capped automatically so the box never overflows the
image, based on available vertical space and the current--font-size. - Extensions with the same count are sorted alphabetically as a tiebreaker.
- When the total number of extensions exceeds the limit, a
(+N more)line is
appended at the bottom of the box.
- Pass
-
The root tile header now includes a summary of the scanned tree after an em-dash
separator:myproject — 124 files, 18 dirs, 4.0 MB (4,231,680 bytes).
Applies to both PNG and SVG output. The label is truncated with…when the tile
is too narrow to fit the full string. -
Greatly expanded archive format support via the new
libarchive-ccore dependency
(wraps the system libarchive C library):- New formats:
.iso,.cpio,.xar,.pkg,.dmg,.img,.rpm,.cab,
.lha,.lzh,.a,.ar,.tar.zst,.tzst - New ZIP aliases:
.nupkg(NuGet),.vsix(VS Code extension),.ipa(iOS app),
.aab(Android App Bundle) .tar.zst/.tzstrouted through libarchive for consistent behaviour across all
supported Python versions (stdlibtarfileonly gained zstd support in 3.12).libarchive-c>=5.0added as a core dependency alongsidepy7zrandrarfile.
Requires the system libarchive library:
brew install libarchive/apt install libarchive-dev.- See ARCHIVES.md for the full format table, platform notes, and
intentionally unsupported formats (.deb, UDIF.dmg).
- New formats:
-
Encrypted archive handling:
--passwordCLI option passes a passphrase upfront.- If an archive turns out to be encrypted and no password was given, dirplot prompts
interactively (Password:hidden-input prompt) and retries — no need to re-run with a flag. - A wrong password exits cleanly with
Error: incorrect password. PasswordRequiredexception exported fromdirplot.archivesfor programmatic use.- Encryption behaviour by format (since dirplot reads metadata only, never extracts):
- ZIP and 7z: central directory / file list is unencrypted by default → readable without
a password even for encrypted archives. - RAR with header encryption (
-hp): listing is hidden without password;
wrong password raisesPasswordRequired.
- ZIP and 7z: central directory / file list is unencrypted by default → readable without
Fixed
--versionmoved back to the top-leveldirplotcommand (was accidentally scoped
todirplot mapafter the CLI was restructured into subcommands).
v0.3.0
Added
- Kubernetes pod scanning via
pod://pod-name/pathsyntax — useskubectl execand
findto build the tree without copying files out of the pod. Works on any running
pod that has a POSIX shell andfind(GNU or BusyBox). No extra dependency; only
kubectlis required.- Namespace can be specified inline (
pod://pod-name@namespace:/path) or via
--k8s-namespace. - Container can be selected for multi-container pods via
--k8s-container. -xdevis intentionally omitted so mounted volumes (emptyDir, PVC, etc.) within
the scanned path are traversed — the common case in k8s where images declare
VOLUMEentries that are always mounted on a separate filesystem.- Automatically falls back to a portable
sh+statloop on BusyBox/Alpine pods.
- Namespace can be specified inline (
- Docker container scanning via
docker://container:/pathsyntax — usesdocker exec
andfindto build the tree without copying files out of the container. Works on any
running container that has a POSIX shell andfind(GNU or BusyBox). No extra
dependency; only thedockerCLI is required.- Automatically detects BusyBox
find(Alpine-based images) and falls back to a
portablesh+statloop when GNU-printfis unavailable. - Virtual filesystems (
/proc,/sys,/dev) are skipped via-xdev. - Supports
--exclude,--depth,--log, and all other standard options. Dockerfileand.dockerignoreadded so the project itself can be used as a
scan target.
- Automatically detects BusyBox
- SVG output format via
--format svgor by saving to a.svg-suffixed path with--output.
The output is a fully self-contained, interactive SVG file:- CSS hover highlight — file tiles brighten and gain a soft glow; directory headers
brighten on mouse-over (.tile/.dir-tileclasses, no JavaScript needed). - Floating tooltip panel — a JavaScript-driven semi-transparent panel tracks the cursor
and shows the file or directory name, human-readable size, and file-type / item count.
No external scripts or stylesheets — the panel logic is embedded in the SVG itself. - Van Wijk cushion shading — approximated via a single diagonal
linearGradient
overlay (gradientUnits="objectBoundingBox"), defined once and shared across all tiles.
Matches the ×1.20 highlight / ×0.80 shadow range of the PNG renderer.
Disabled with--no-cushion.
- CSS hover highlight — file tiles brighten and gain a soft glow; directory headers
--format png|svgCLI option; format is also auto-detected from the--outputfile
extension.create_treemap_svg()added to the public Python API (from dirplot import create_treemap_svg).drawsvg>=2.4added as a core dependency.- Rename the treemap command to
map(dirplot map ). - Add
termsizesubcommand and restructure CLI as multi-command app. - Add
--dephtparameter to limit the scanning of large file trees. - Support for SSH remote directory scanning (
pip install dirplot[ssh]). - Support for AWS S3 buckets in the cloud (
pip install dirplot[s3]). - Support for local archive files, .zip, tgz, .tar.xz, .rar, .7z, etc.
- Include example archives for 17 different extentions for testing.
- Comprehensive documentation.
github://owner/repo[@branch]URI scheme for GitHub repository scanning. The old
github:owner/reposhorthand has been removed.- File tiles now have a 1-px dark outline (60/255 below fill colour per channel) so
adjacent same-coloured tiles — e.g. a directory full of extension-less files — are
always visually distinct rather than blending into a single flat block.
Changed
docs/REMOTE-ACCESS.mdrenamed todocs/EXAMPLES.md; Docker and Kubernetes pod
sections added; images with captions added for all remote backends.
Fixed
- SVG tooltips now show the original byte count when
--logis active, not the
log-transformed layout value.Node.original_sizeis populated byapply_log_sizes
for both file and directory nodes and is used by the SVG renderer fordata-size. - GitHub error messages are now clear and actionable.
v0.2.0
v0.1.2
v0.1.1
Features
- Nested squarified treemap rendered as a PNG at the exact pixel dimensions of the terminal window.
- Inline terminal display via iTerm2 and Kitty graphics protocols, auto-detected at runtime; supports iTerm2, WezTerm, Warp, Hyper, Kitty, and Ghostty.
- System-viewer fallback (
open/xdg-open) as the default display mode. - File-extension colours from the GitHub Linguist palette (~500 known extensions); unknown extensions fall back to a stable MD5-derived colour from the chosen colormap.
- Van Wijk quadratic cushion shading giving each tile a raised 3-D look (
--cushion, on by default). - Bundled JetBrains Mono fonts for crisp directory labels at any size.
- CLI options:
--output,--show/--no-show,--inline,--legend,--font-size,--colormap,--exclude,--size,--header/--no-header,--cushion/--no-cushion,--log. - Full test suite (65 tests), strict mypy, ruff linting, pre-commit hooks, and CI on Python 3.10–3.13.