{"id":44528984,"url":"https://github.com/sadopc/godu","last_synced_at":"2026-02-16T21:01:21.131Z","repository":{"id":337684000,"uuid":"1154758395","full_name":"sadopc/godu","owner":"sadopc","description":"Fast, interactive disk usage analyzer for the terminal. Tree view, treemap, file type breakdown, safe deletion, and JSON export built in Go.","archived":false,"fork":false,"pushed_at":"2026-02-10T19:09:58.000Z","size":360,"stargazers_count":10,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-02-14T00:39:20.480Z","etag":null,"topics":["bubbletea","cli","disk-analyzer","disk-usage","go","golang","ncdu","terminal","treemap","tui"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sadopc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-10T18:40:39.000Z","updated_at":"2026-02-11T14:34:58.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/sadopc/godu","commit_stats":null,"previous_names":["sadopc/godu"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/sadopc/godu","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sadopc%2Fgodu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sadopc%2Fgodu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sadopc%2Fgodu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sadopc%2Fgodu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sadopc","download_url":"https://codeload.github.com/sadopc/godu/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sadopc%2Fgodu/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29452586,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T15:52:44.973Z","status":"ssl_error","status_checked_at":"2026-02-14T15:52:11.208Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bubbletea","cli","disk-analyzer","disk-usage","go","golang","ncdu","terminal","treemap","tui"],"created_at":"2026-02-13T18:24:35.093Z","updated_at":"2026-02-14T19:01:17.732Z","avatar_url":"https://github.com/sadopc.png","language":"Go","readme":"# godu\n\nA fast, interactive disk usage analyzer for the terminal. Think **ncdu** meets **WinDirStat** — built in Go with a modern TUI.\n\ngodu combines parallel scanning speed, visual treemap analysis, file type breakdowns, and safe file deletion into a single tool.\n\n![Tree View](screenshots/treeview.png)\n\n## Features\n\n- **Parallel scanning** — goroutine-per-directory with semaphore, scans 500K+ files in under a second on SSD\n- **3 view modes** — tree list, squarified treemap, file type breakdown\n- **Gradient bars** — purple-to-teal color gradient showing relative sizes\n- **Safe deletion** — mark files with Space, review, confirm, then delete\n- **Export/Import** — save scan results to JSON, reload later without rescanning\n- **Vim keybindings** — `hjkl` navigation, feels natural\n- **Responsive layout** — adapts to any terminal size\n- **Zero dependencies** — single static binary, no CGo, no networking\n\n## Screenshots\n\n### Tree View\nSorted file listing with percentage bars, size columns, and directory navigation.\n\n![Tree View](screenshots/treeview.png)\n\n### Treemap\nSquarified treemap visualization using Unicode box-drawing characters. Rectangles sized proportionally to disk usage.\n\n![Treemap](screenshots/treemap.png)\n\n### File Types\nBreakdown by category (Media, Code, Archives, Documents, System, Executables) with top extensions per category.\n\n![File Types](screenshots/filetypes.png)\n\n### Help\nFull keybinding reference overlay.\n\n![Help](screenshots/help.png)\n\n## Installation\n\n### Homebrew (macOS / Linux)\n\n```bash\nbrew tap sadopc/tap\nbrew install godu\n```\n\n### From source\n\nRequires **Go 1.21+**.\n\n```bash\n# Clone the repository\ngit clone https://github.com/serdar/godu.git\ncd godu\n\n# Build\ngo build -o godu ./cmd/godu\n\n# Or install directly to your GOPATH/bin\ngo install ./cmd/godu\n```\n\n### Add to PATH\n\nAfter `go install`, the binary is at `~/go/bin/godu`. Make sure `~/go/bin` is on your PATH:\n\n```bash\n# Add to your shell profile (~/.zshrc, ~/.bashrc, etc.)\nexport PATH=\"$HOME/go/bin:$PATH\"\n\n# Reload your shell\nsource ~/.zshrc   # or ~/.bashrc\n```\n\nNow you can run `godu` from anywhere.\n\n### Using Make\n\n```bash\nmake build      # Build binary in current directory\nmake install    # Install to GOPATH/bin\nmake release    # Cross-compile for macOS and Linux (amd64 + arm64)\n```\n\n## Usage\n\n```bash\n# Scan current directory\ngodu\n\n# Scan a specific path\ngodu /home\n\n# Scan showing hidden files (default)\ngodu --hidden /path\n\n# Scan hiding hidden files\ngodu --no-hidden /path\n\n# Export scan results to JSON (headless, no TUI)\ngodu --export scan.json /path\n\n# Import and browse a previous scan\ngodu --import scan.json\n\n# Disable GC during scan (faster, uses more memory)\ngodu --no-gc /large/directory\n\n# Exclude directories\ngodu --exclude node_modules,.git /project\n\n# Show version\ngodu --version\n```\n\n## Keybindings\n\n### Navigation\n\n| Key | Action |\n|-----|--------|\n| `j` / `↓` | Move cursor down |\n| `k` / `↑` | Move cursor up |\n| `l` / `→` / `Enter` | Enter directory |\n| `h` / `←` / `Backspace` | Go to parent |\n\n### Views\n\n| Key | Action |\n|-----|--------|\n| `1` | Tree view (default) |\n| `2` | Treemap view |\n| `3` | File type breakdown |\n\n### Sorting\n\n| Key | Action |\n|-----|--------|\n| `s` | Sort by size |\n| `n` | Sort by name |\n| `C` | Sort by item count |\n| `M` | Sort by modification time |\n\n### Actions\n\n| Key | Action |\n|-----|--------|\n| `Space` | Mark/unmark item |\n| `d` | Delete marked items (with confirmation) |\n| `E` | Export scan to JSON |\n| `r` | Rescan directory |\n| `a` | Toggle apparent size / disk usage |\n| `.` | Toggle hidden files |\n| `?` | Show help |\n| `q` | Quit |\n| `Ctrl+C` | Force quit |\n\n## How It Works\n\n### Scanning\n\ngodu uses a parallel directory walker. Each subdirectory spawns a goroutine (bounded by a semaphore of `3 * GOMAXPROCS`) to maximize I/O throughput. Sizes are calculated bottom-up after the full tree is built, avoiding race conditions.\n\nHardlinks are detected via inode tracking to prevent double-counting. Symlinks are flagged but not followed by default.\n\n### Data Model\n\nThe file tree is stored in memory as `DirNode` and `FileNode` structs. Paths are reconstructed by walking parent pointers rather than stored per-node, saving significant memory at scale. Each node tracks both apparent size (file content) and disk usage (allocated blocks).\n\n### Treemap\n\nThe treemap uses a squarified layout algorithm adapted for character cells. Rectangles are drawn with Unicode box-drawing characters (`┌─┐│└┘`) and colored by file category. Labels are placed inside rectangles when they fit, truncated with `...` when they don't.\n\n### Export Format\n\nScan results export as nested JSON arrays compatible with ncdu's format:\n\n```json\n[1,0,{\"progname\":\"godu\",\"progver\":\"dev\",\"timestamp\":1234567890},\n  [{\"name\":\"/path\"},\n    {\"name\":\"file.txt\",\"asize\":1024,\"dsize\":4096},\n    [{\"name\":\"subdir\"},\n      {\"name\":\"inner.go\",\"asize\":512,\"dsize\":4096}\n    ]\n  ]\n]\n```\n\n## Project Structure\n\n```\ngodu/\n├── cmd/godu/main.go              # CLI entry point\n├── internal/\n│   ├── model/\n│   │   ├── tree.go               # FileNode, DirNode, TreeNode interface\n│   │   ├── sort.go               # Multi-field sorting\n│   │   └── filetype.go           # Extension-to-category mapping (150+)\n│   ├── scanner/\n│   │   ├── scanner.go            # Scanner interface, options\n│   │   ├── parallel.go           # Parallel directory walker\n│   │   └── progress.go           # Progress reporting\n│   ├── ui/\n│   │   ├── app.go                # Root Bubble Tea model\n│   │   ├── keys.go               # Key bindings\n│   │   ├── style/\n│   │   │   ├── theme.go          # Colors, gradients, styles\n│   │   │   └── layout.go         # Responsive layout calculations\n│   │   └── components/\n│   │       ├── treeview.go       # Tree list with gradient bars\n│   │       ├── treemap.go        # Squarified treemap\n│   │       ├── filetypes.go      # File type breakdown\n│   │       ├── header.go         # Header + breadcrumb\n│   │       ├── statusbar.go      # Status bar + tab bar\n│   │       ├── scanprogress.go   # Scanning overlay\n│   │       ├── confirm.go        # Delete confirmation dialog\n│   │       └── help.go           # Help overlay\n│   ├── ops/\n│   │   ├── delete.go             # File deletion\n│   │   ├── export.go             # JSON export\n│   │   └── import.go             # JSON import\n│   └── util/\n│       ├── format.go             # Size/count formatting\n│       └── icons.go              # Unicode icons\n├── screenshots/                  # README screenshots\n├── Makefile\n├── go.mod\n└── go.sum\n```\n\n## Dependencies\n\n| Package | Purpose |\n|---------|---------|\n| [bubbletea](https://github.com/charmbracelet/bubbletea) | TUI framework (Elm architecture) |\n| [lipgloss](https://github.com/charmbracelet/lipgloss) | Terminal styling |\n| [bubbles](https://github.com/charmbracelet/bubbles) | Key binding helpers |\n| [go-colorful](https://github.com/lucasb-eyer/go-colorful) | Gradient color interpolation |\n| [natural](https://github.com/maruel/natural) | Natural string sorting |\n\nNo CGo. No database. No networking. Compiles to a single static binary.\n\n## Performance\n\nTested on Apple Silicon Mac Mini with SSD:\n\n| Directory | Files | Time |\n|-----------|-------|------|\n| 56K files | 56,000 | 0.29s |\n| Home dir | 413,000 | ~1s |\n| Large SSD | 786,000 | ~2s |\n\n## License\n\n[MIT](LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsadopc%2Fgodu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsadopc%2Fgodu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsadopc%2Fgodu/lists"}