Skip to main content

dirgo

CI Release License: MIT PyPI

A fast, minimal and interactive terminal disk usage analyzer built with Go and Bubble Tea. Visualize disk usage, explore directories and files, and find what's eating your disk space — all from your terminal, on macOS, Linux, and Windows.

dirgo screenshot

Features

  • Instant directory listing — files appear immediately; directory sizes compute in the background
  • Proportional size bars — color-coded percentage bars for quick visual scanning
  • Efficient directory scanning — a bounded pool of workers shares the directory walk, so one huge subfolder (node_modules, ~/Library) never serializes the scan; one lstat per file and none per directory
  • Smart refresh — checks directory modtime before rescanning; skips unchanged directories
  • LRU cache — bounded in-memory cache (100 entries) for instant back-navigation within a session; deleting with d updates cached sizes up the tree instead of forcing a rescan
  • Line counting — automatic line count for the selected text file; batch count all with s
  • Hex view — built-in hex dump for binary files (xxd on macOS, hexdump fallback on Linux)
  • Large file protection — prevents accidentally opening very large blob files
  • Fuzzy search — filter entries in real time with subsequence matching
  • Symlink detection — symlinks shown with → / ⇢ indicators; symlinked directories can be opened but are never followed when sizing, so nothing is counted twice
  • Move to trash — safely delete files/directories with d
  • Cross-platform — works on macOS, Linux, and Windows (Quick Look, file open, trash, and hex view adapt per OS)
  • CPU profiling — built-in --profile flag for performance analysis

How it compares

dirgo is in the same family as ncdu, gdu, and dust. The differences:

  • No up-front scan. ncdu and gdu scan the whole tree before you can browse; dirgo lists the current directory immediately and fills in sizes as they're computed. dust prints a one-shot report rather than an interactive view.
  • File-level tools, not just sizes. Line counts, hex view, Quick Look / open, and move to trash are one key away, so you can inspect and clean up without leaving the browser.
  • Installs everywhere. One static binary via Homebrew, pip/uv, go install, or the release archives.

Install

Homebrew (macOS / Linux)

brew install mohsinkaleem/tap/dirgo

Install script (macOS / Linux)

curl -fsSL https://raw.githubusercontent.com/mohsinkaleem/dirgo/main/scripts/install.sh | sh

The script downloads the latest release, verifies its checksum and installs dirgo to /usr/local/bin, or ~/.local/bin if that isn't writable. Set DIRGO_INSTALL_DIR to pick another folder or DIRGO_VERSION (e.g. v1.2.1) to pin a release.

pip / uv (any platform)

pip install dirgo
uv tool install dirgo

Go install

go install github.com/mohsinkaleem/dirgo@latest

Pre-built binaries

Archives for macOS, Linux and Windows (amd64 and arm64) are attached to every release, along with checksums.txt. On Windows, extract dirgo.exe and put it somewhere on your PATH. On macOS, a binary downloaded through a browser is quarantined by Gatekeeper; clear the flag with xattr -d com.apple.quarantine dirgo.

From source

git clone https://github.com/mohsinkaleem/dirgo.git
cd dirgo
make build

Usage

# Analyze current directory
dirgo

# Analyze a specific path
dirgo ~/Documents

# Print version
dirgo --version

# Enable CPU profiling
dirgo --profile /path/to/dir

Keybindings

Key Action
↑ / k Move cursor up
↓ / j Move cursor down
← / Backspace Go to parent directory
→ / l / Enter Open selected directory / file
Space Quick Look preview (macOS qlmanage, Linux xdg-open, Windows explorer)
g Jump to top
G Jump to bottom
PgUp / Ctrl+U Page up
PgDn / Ctrl+D Page down
r Smart refresh (skips if unchanged)
t Toggle top 10 view
o Open in Finder / file manager
/ Search / filter
Esc Clear search filter / exit top 10 / close help
h Toggle hidden files
f Cycle filter (all → dirs only → files only)
s Count lines for all files
c cd to path
x Hex view (binary files)
d Move to trash
? Help
q / Ctrl+C Quit

Architecture

For a full walkthrough of the design — component breakdown, message flow, the scanning pipeline, and a deep dive on the concurrency model — see the architecture guide.

Prefer to learn by doing? The interactive tour lets you drive a working replica of the TUI in your browser, step through the message loop one frame at a time, and run the concurrent scanner with adjustable core counts.

main.go        Entry point, --profile/--version flags, Bubble Tea program setup
model.go       Application state, Update loop, message handling
scanner.go     Directory scanning with os.ReadDir + manual recursion, bounded concurrency
cache.go       Bounded in-memory LRU cache with eviction
entry.go       FileEntry data model, sorting, filtering, fuzzy match
render.go      Row rendering, header/footer, help overlay
keys.go        Key bindings
styles.go      Lipgloss color and style definitions (pre-defined bar color styles)
utils.go       Formatting, line counting (bytes.Count + sync.Pool), helpers

Scanning Pipeline

  1. scanDirectory() calls os.ReadDir to read the directory in a single syscall, immediately stats files, and separates directories from files.
  2. Directory sizes are computed in parallel using dirSizeRecursive() — a manual recursive function using os.ReadDir that avoids the overhead of filepath.WalkDir. Bounded concurrency is enforced via a semaphore (CPU count, max 16).
  3. File stat is parallelised for directories with 20+ files to leverage multi-core CPUs.

Caching

  • In-memory: LRU cache holding up to 100 directory scan results. Accessed on navigation; updated on scan completion.
  • On-disk: Not implemented as of now. Wanted to keep it simple and deterministic.

Smart Refresh

Pressing r compares the directory's current modtime against the cached value. If unchanged, the rescan is skipped entirely (~microseconds). If changed, a full rescan is triggered.

Development

# Run tests
make test

# Run benchmarks
make bench

# CPU profile a benchmark
make profile-cpu

# Memory profile
make profile-mem

# Build cross-platform release binaries
make release

Requirements

  • Go 1.25+ (only needed to build from source or go install)
  • macOS / Linux / Windows

Contributing

Contributions are welcome! See CONTRIBUTING.md for the development setup, and please follow the code of conduct. To report a security issue, see SECURITY.md.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

MIT

Metadata

Release files for dirgo 1.3.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 dirgo 1.3.0
File Size Uploaded
dirgo-1.3.0.tar.gz 7.9 kB Details

Built distribution (wheel)

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

Total release size: 15.9 kB

Release files / dirgo-1.3.0.tar.gz

Download URL dirgo-1.3.0.tar.gz
Size 7.9 kB
Tags Source
SHA-256 checksum
How to use checksums
71ffbb18ffb3acc880048a3fb845a77bfe2e97c578e60cc102127ab3ba7e4d5b
BLAKE2b-256 checksum
How to use checksums
48bd1e417d9fcb5b6125d33002c0f31790ede6a342688310347f4cd5d573b00d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 14, 2026.

Transparency log

Release files / dirgo-1.3.0-py3-none-any.whl

Download URL dirgo-1.3.0-py3-none-any.whl
Size 8.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
430bcaf493b8a4a971eb844b81b46f37ceb6f96db63bd37e73bdf194527160da
BLAKE2b-256 checksum
How to use checksums
3ff6502498706b3899167302e9308f59afa80b92b19b637e0fc94fc1c08c1f61
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 14, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.3.0 This release

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.0

2 release files

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