Overview
Broot is a modern, interactive terminal-based file manager and directory navigator written in Rust. It displays directory trees in a compact, navigable format with built-in fuzzy search, file preview, file size analysis, git status integration, and customizable verb system for executing commands on files. Broot excels at quickly finding and navigating to deeply nested files and directories.
Broot’s key innovation is its ability to show an entire directory tree in a compact view that fits within the terminal, using intelligent folding and filtering. As you type, it instantly filters the tree with fuzzy matching. It integrates with your shell to enable cd to directories you find, and supports custom verbs for any file operation.
Installation
# macOS
brew install broot
# Ubuntu/Debian
sudo apt install broot
# Arch Linux
sudo pacman -S broot
# Cargo (Rust)
cargo install --locked broot
# Fedora
sudo dnf install broot
# First run - install shell integration
broot
# When prompted, accept shell function installation
# This creates the `br` shell function for cd integration
Core Navigation
| Key | Action |
|---|
Enter | Open file or focus directory |
Alt+Enter | Open file in system default |
Tab | Toggle second panel |
Ctrl+Left | Open in left panel |
Ctrl+Right | Open in right panel |
Escape | Back / Clear filter |
Ctrl+Q | Quit broot |
? | Show help |
Basic Usage
# Launch broot in current directory
br
# Launch in specific directory
br /path/to/dir
# Launch with file sizes
br --sizes
# Launch showing hidden files
br --hidden
# Launch showing git status
br --git-status
# Launch with specific search
br --cmd "pattern"
# Print path instead of cd
broot --out /tmp/path
Searching and Filtering
# Just start typing to fuzzy search
# Example: typing "cfg" matches "config", "configuration", etc.
# Search modes (type prefix):
# (default) fuzzy search on file/dir names
# /pattern regex search
# e/pattern search file extensions
# c/pattern search file content
# f/pattern filter to files only
# d/pattern filter to directories only
| Prefix | Search Mode |
|---|
| (none) | Fuzzy name search |
/ | Regex name search |
c/ | Content search (grep) |
e/ | Extension search |
f/ | Files only filter |
d/ | Directories only filter |
Built-in Verbs
| Command | Action |
|---|
:open or Enter | Open file |
:edit | Open in editor ($EDITOR) |
:cd | Change directory (via shell) |
:cp <destination> | Copy file |
:mv <destination> | Move/rename file |
:rm | Delete file |
:mkdir <name> | Create directory |
:chmod <mode> | Change permissions |
:print_path | Print file path |
:quit | Exit broot |
:toggle_hidden | Show/hide hidden files |
:toggle_sizes | Show/hide file sizes |
:toggle_git_status | Show/hide git status |
:sort_by_size | Sort by file size |
:sort_by_date | Sort by modification date |
:sort_by_type | Sort by file type |
# Use verbs via command mode (type : then command)
# :edit - open selected file in editor
# :cd - cd to selected directory
# :cp ~/backup/ - copy selected file
# :mv newname - rename selected file
Panels
# Tab opens a second panel
# Navigate independently in each panel
# Keyboard shortcuts with panels
# Tab - toggle/create second panel
# Ctrl+Left - open in left panel
# Ctrl+Right - open in right panel
# Copy between panels
# Select file, type :cp {other-panel-directory}
# Preview file in second panel
# Tab to create panel, navigate to file
Git Integration
# Show git status
br --git-status
# Toggle in running broot
:toggle_git_status
# Git status indicators:
# M modified
# A added
# D deleted
# R renamed
# ? untracked
# ! ignored
Size Analysis
# Show file/directory sizes
br --sizes
# Sort by size
:sort_by_size
# Show dates
br --dates
# Sort by date
:sort_by_date
Configuration
# ~/.config/broot/conf.hjson or conf.toml
# Default flags
default_flags = "sdgh"
# s = sizes, d = dates, g = git, h = hidden
# Custom verbs
[[verbs]]
invocation = "create {subpath}"
execution = "touch {directory}/{subpath}"
[[verbs]]
invocation = "view"
execution = "less {file}"
leave_broot = false
[[verbs]]
invocation = "code"
execution = "code {file}"
leave_broot = false
[[verbs]]
invocation = "terminal"
execution = "$SHELL"
set_working_dir = true
leave_broot = false
# Editor integration
[[verbs]]
invocation = "edit"
shortcut = "e"
execution = "$EDITOR {file}"
leave_broot = false
# Custom skin (colors)
[skin]
default = "gray(23) none"
tree = "ansi(94) None"
file = "gray(18) None"
directory = "ansi(208) None Bold"
selected_line = "None gray(4)"
Advanced Usage
Custom Verbs
# Open in VS Code
[[verbs]]
invocation = "code"
execution = "code -r {file}"
leave_broot = false
# Open terminal in directory
[[verbs]]
invocation = "term"
execution = "kitty --directory {directory}"
leave_broot = false
# Git operations
[[verbs]]
invocation = "git_add"
execution = "git add {file}"
leave_broot = false
[[verbs]]
invocation = "git_diff"
execution = "git diff {file}"
leave_broot = false
# Bulk operations
[[verbs]]
invocation = "backup"
execution = "cp -r {file} {file}.bak"
auto_exec = false
Shell Function Integration
# The `br` function enables cd integration
# When you select a directory and press Enter,
# your shell actually changes to that directory
# Custom shell function
function bcd() {
local dir
dir=$(broot --only-folders --cmd ":print_path" "$@")
if [ -n "$dir" ]; then
cd "$dir"
fi
}
File Preview
# Preview files with syntax highlighting
# Select a file and press Tab to open preview panel
# Or configure a preview verb:
[[verbs]]
invocation = "preview"
execution = "bat --color=always {file}"
leave_broot = false
Troubleshooting
| Issue | Solution |
|---|
br: command not found | Run broot first to install shell integration; restart shell |
cd not working | Use br (shell function), not broot (binary) |
| Slow on large directories | Use search to filter; avoid --sizes on huge trees |
| Colors wrong | Check terminal color support; configure skin in conf.toml |
| Hidden files not showing | Use --hidden flag or :toggle_hidden |
| Git status not appearing | Ensure git is installed; use --git-status flag |
| Config not loading | Check file at ~/.config/broot/conf.hjson or conf.toml |
| Custom verb not working | Check verb syntax; test execution command manually |