πŸ“Š Tokui

June 19, 2026 Β· View on GitHub

Build Go Report Card

Tokui is a high-performance, cross-platform command-line tool for visualizing and exploring code statistics. It integrates with the powerful code statistics engine tokei to present code line count metrics through a responsive, keyboard-driven Terminal User Interface (TUI), helping you quickly analyze code composition and understand project structure.

Project Origin

This project is a fork of the excellent disk space analyzer noxdir, heavily modified and refactored by a Large Language Model (LLM) to transform it from a disk analyzer into a code statistics visualizer.

πŸ“Έ Previews

Demo

✨ Features

  • Interactive Terminal UI: Navigate, filter, and explore your project with an intuitive keyboard-driven interface.
  • Deep Tokei Integration: Leverages tokei for accurate lines of code, comments, blanks, and total lines, categorized by language.
  • File Preview: Press Enter on any file to instantly preview its contents in a scrollable overlay window.
  • Language Filtering: Filter by a single language (Tab), or select multiple languages via the multi-select overlay (Ctrl+L).
  • Visual Charts: Toggle a language distribution pie chart with Ctrl+w.
  • Column Sorting: Sort the directory listing by any column (s) and toggle ascending/descending order (S).
  • Tree Mode: Toggle tree mode (t) to expand and collapse directories inline.
  • Mouse Support: Scroll, click, and double-click to navigate rows and overlays.
  • Zero-Dependency Release: Pre-built binaries bundle tokei internallyβ€”no separate installation required.
  • Privacy-Focused: Runs entirely locally. No telemetry or data uploads, ever.

⚠️ Prerequisites

Pre-built release binaries have tokei embeddedβ€”no manual installation is needed.

If you are building from source or want to use your own tokei installation, ensure tokei is available in your PATH. Tokui will automatically prefer the system-installed version if present.

πŸ“¦ Installation

Pre-compiled Binaries

Download the latest release from the Releases page. Unzip and runβ€”no extra installation required.

Build from Source (Go 1.24+)

# Clone the repository
git clone https://github.com/zdyxry/tokui.git
cd tokui

# Download tokei binaries for embedding (optional but recommended)
make fetch-tokei-binaries

# Build
make build

# Run
./bin/tokui

Note: make fetch-tokei-binaries downloads platform-specific tokei binaries that will be embedded into the final executable. If skipped, the build will still succeed using placeholder files; the resulting binary will fallback to a system-installed tokei at runtime.

πŸ› οΈ Usage

Tokui supports two modes of operation:

Tokui automatically invokes the bundled (or system-installed) tokei to analyze the specified directory.

# Analyze the current directory
tokui

# Analyze a specific directory
tokui /path/to/your/project

2. Pipe Mode

If you have tokei installed separately, run it manually with custom arguments and pipe its JSON output to tokui. This is useful for advanced filtering (e.g., --exclude).

# Analyze the current directory
tokei -o json . | tokui

# Analyze a specific directory and exclude node_modules
tokei -o json --exclude node_modules . | tokui

CLI Arguments

Usage:
  tokui [directory] [flags]

Flags:
  -r, --root string   Specify the root directory to analyze. Defaults to the current directory ".".
  -t, --tree          Start in tree mode. Directories are expandable inline instead of navigable.
  -h, --help          Show help information

⌨️ Keybindings

Main View

KeyAction
↑ / kMove cursor up
↓ / jMove cursor down
g / homeGo to top
G / endGo to bottom
EnterEnter directory / Expand-Collapse directory / Preview file
eOpen file in editor
BackspaceGo back to the parent directory
tToggle navigation mode / tree mode
TabCycle through language filters
Ctrl+LOpen multi-language selection overlay
/Activate file name filter (press Esc to exit filter mode)
sCycle sort column (Name β†’ Languages β†’ Code β†’ Comments β†’ Blanks β†’ Total β†’ % of Parent)
SToggle ascending / descending order for the current sort column
Ctrl+wShow/hide language distribution pie chart
?Show/hide full help
q / Ctrl+cQuit the application / Close file preview

File Preview Mode

KeyAction
↑ / kScroll up
↓ / jScroll down
PgUpPage up
PgDnPage down
q / EscClose file preview and return to directory view

Mouse Support

Tokui also supports basic mouse interaction in terminals that report mouse events:

ActionEffect
Scroll wheelMove cursor / scroll previews and language lists
Left clickSelect a row or an item in the language selection overlay
Double left clickEnter directory, expand/collapse directory, or open file preview
Double left click ..Go back to the parent directory
Click outside overlayClose the file preview, language selection, or chart overlay

🀝 Contributing

Pull Requests are welcome! If you'd like to add new features or report bugs, please open an issue first to discuss your ideas.

πŸ“ License

Tokui is licensed under the MIT License.

This project bundles a copy of tokei (MIT OR Apache-2.0) for zero-dependency operation. See THIRD-PARTY-LICENSES for details.