|
| 1 | +--- |
| 2 | +title: Modern CLI Tools |
| 3 | +sidebar_position: 3 |
| 4 | +--- |
| 5 | + |
| 6 | +# Modern CLI Tools for Multi-Agent Workflows |
| 7 | + |
| 8 | +Managing parallel agent sessions, rapid context switching across worktrees, and quick file edits without breaking flow—modern CLI tools eliminate friction that accumulates across dozens of daily operations. These tools complement agent workflows with better defaults, richer information, and ergonomic interfaces. |
| 9 | + |
| 10 | +**Four categories:** Text editing (micro), file navigation (eza, yazi, fzf), and git operations (lazygit) address the most frequent CLI tasks in multi-agent development workflows. |
| 11 | + |
| 12 | +## Text Editing |
| 13 | + |
| 14 | +### micro |
| 15 | + |
| 16 | +[**micro**](https://micro-editor.github.io/) is a Go-based terminal text editor that brings GUI-like keybindings to the command line. Single binary, no dependencies, cross-platform support. |
| 17 | + |
| 18 | +**Key differentiators:** Ctrl+S to save, Ctrl+Q to quit, Ctrl+F to find—no modal editing or memorization required. Syntax highlighting for 130+ languages out of box. Multi-cursor support (Sublime-style) for parallel editing. Lua plugin system for extensibility. Integrated terminal and mouse support for hybrid keyboard/mouse workflows. |
| 19 | + |
| 20 | +**Best suited for:** Developers needing quick edits in agent context without switching to IDE. Engineers who find Vim's modal editing overhead for one-line changes. Users wanting terminal editing with familiar modern editor keybindings (coming from VSCode, Sublime, or similar GUI editors). |
| 21 | + |
| 22 | +**Trade-offs:** Feature-minimal compared to IDEs—no LSP integration, limited refactoring tools, basic navigation. Not as powerful as Vim/Neovim for complex multi-file operations or advanced text object manipulation. For large files (1000+ lines) or deep code exploration, IDE remains superior tool choice. |
| 23 | + |
| 24 | +**vs Vim:** No modal editing learning curve enables instant productivity. Trade: less powerful for macro operations and text object manipulation at scale. |
| 25 | + |
| 26 | +**vs Nano:** More sophisticated feature set—multi-cursor editing, plugin ecosystem, better syntax highlighting for code. Better suited for actual development work rather than simple config edits. |
| 27 | + |
| 28 | +**Installation:** |
| 29 | + |
| 30 | +```bash |
| 31 | +# macOS |
| 32 | +brew install micro |
| 33 | + |
| 34 | +# Linux (binary) |
| 35 | +curl https://getmic.ro | bash |
| 36 | + |
| 37 | +# Cross-platform (Go) |
| 38 | +go install github.com/zyedidia/micro/cmd/micro@latest |
| 39 | +``` |
| 40 | + |
| 41 | +Requirements: None (static binary). Optional: clipboard support via xclip/xsel on Linux. |
| 42 | + |
| 43 | +## File Navigation |
| 44 | + |
| 45 | +### eza |
| 46 | + |
| 47 | +[**eza**](https://eza.rocks/) is a Rust-based ls replacement, actively maintained fork of the unmaintained exa project. Fast, feature-rich, with better defaults than traditional ls. |
| 48 | + |
| 49 | +**Key differentiators:** Colors for file types and permissions by default. Git integration shows per-file status (`--git`) or per-directory repository state (`--git-repos`). Human-readable file sizes in long format without flags. Tree view (`--tree`), icons support (`--icons`), and hyperlink support for terminal emulators. Fixes Grid Bug from exa that caused rendering issues. |
| 50 | + |
| 51 | +**Best suited for:** Developers working across git worktrees who need instant branch status visibility. Engineers wanting better ls defaults without heavy configuration overhead. Users comfortable with modern Rust tooling ecosystem and willing to install additional dependencies. |
| 52 | + |
| 53 | +**Trade-offs:** More dependencies than ls (Rust binary, optional Nerd Fonts for icons). Some features need configuration (icon support requires compatible fonts). Slightly longer learning curve for advanced options, though defaults work well immediately. |
| 54 | + |
| 55 | +**vs ls:** Colors, git status visibility, human-readable sizes by default. Better information density without memorizing flags. |
| 56 | + |
| 57 | +**vs exa:** Actively maintained (exa development stopped), security patches, bug fixes (Grid Bug), feature parity plus hyperlinks and bright color support. |
| 58 | + |
| 59 | +**Installation:** |
| 60 | + |
| 61 | +```bash |
| 62 | +# macOS |
| 63 | +brew install eza |
| 64 | + |
| 65 | +# Cargo (Rust) |
| 66 | +cargo install eza |
| 67 | + |
| 68 | +# Linux package managers |
| 69 | +sudo apt install eza # Debian/Ubuntu |
| 70 | +sudo pacman -S eza # Arch |
| 71 | +``` |
| 72 | + |
| 73 | +Requirements: None (static binary). Optional: Nerd Fonts for icon support (`--icons`). |
| 74 | + |
| 75 | +### yazi |
| 76 | + |
| 77 | +[**yazi**](https://yazi-rs.github.io/) is a Rust-based terminal file manager with full asynchronous I/O and multi-threaded CPU task distribution. Currently in public beta, suitable as daily driver. |
| 78 | + |
| 79 | +**Key differentiators:** Full asynchronous architecture keeps UI responsive during heavy operations (large directories, remote filesystems). Rich preview support for images (Kitty, Sixel, iTerm2, WezTerm protocols), videos, PDFs, archives, and code with syntax highlighting via built-in integration. Lua-based plugin system with package manager for extensibility. Vim-like keybindings with visual mode, multi-tab support, and auto-completion. Client-server architecture with pub-sub model enables cross-instance communication. Integrates with ripgrep, fd, fzf, and zoxide for enhanced workflows. |
| 80 | + |
| 81 | +**Best suited for:** Developers navigating complex directory structures who need rich file previews without leaving terminal. Engineers working with remote filesystems where responsiveness matters (async I/O prevents UI freezing). Users wanting Vim-like file management with extensive customization (Lua plugins, themes, custom previewers). |
| 82 | + |
| 83 | +**Trade-offs:** Currently in public beta—stable enough for daily use but evolving rapidly. More complex than simpler tools like nnn (which is tiny, nearly 0-config). Learning curve for Vim keybindings if coming from traditional file managers. Lacks "undo" feature that Vifm provides. |
| 84 | + |
| 85 | +**vs Ranger:** Significantly faster (Rust vs Python architecture). Asynchronous I/O prevents UI freezing on heavy operations. |
| 86 | + |
| 87 | +**vs lf:** Both fast and async-capable (lf written in Go). Yazi offers richer built-in preview support and plugin ecosystem. |
| 88 | + |
| 89 | +**vs nnn:** nnn is smaller, faster to start, nearly 0-config. Yazi trades simplicity for rich features (previews, plugins, advanced async task management). |
| 90 | + |
| 91 | +**Installation:** |
| 92 | + |
| 93 | +```bash |
| 94 | +# macOS |
| 95 | +brew install yazi |
| 96 | + |
| 97 | +# Cargo (Rust) |
| 98 | +cargo install --locked yazi-fm yazi-cli |
| 99 | + |
| 100 | +# Linux package managers |
| 101 | +sudo pacman -S yazi # Arch |
| 102 | +``` |
| 103 | + |
| 104 | +Requirements: None (static binary). Optional: Überzug++ or similar for advanced image preview, ffmpegthumbnailer for video thumbnails, fd/ripgrep/fzf/zoxide for enhanced integration. |
| 105 | + |
| 106 | +### fzf |
| 107 | + |
| 108 | +[**fzf**](https://junegunn.github.io/fzf/) is a Go-based fuzzy finder that processes millions of items instantly. Single binary, 11+ years mature (since 2013), widely adopted as the standard fuzzy CLI tool. |
| 109 | + |
| 110 | +**Key differentiators:** Shell integration provides Ctrl+R (history search), Ctrl+T (file search), Alt+C (directory navigation), and `**<TAB>` (fuzzy completion for any command). Vim/Neovim integration via fzf.vim and fzf-lua plugins. Tmux integration via fzf-tmux wrapper for popup windows. Preview window support shows file contents or git diffs during selection. Highly customizable via environment variables (FZF_DEFAULT_OPTS, FZF_DEFAULT_COMMAND). Pipe-friendly architecture works with any command output. |
| 111 | + |
| 112 | +**Best suited for:** Developers navigating large codebases who need instant file/symbol location without IDE context switches. Engineers with heavy shell usage for command history search and script selection. Users wanting fuzzy selection everywhere—git branches, docker containers, kubernetes pods, process lists. |
| 113 | + |
| 114 | +**Trade-offs:** Requires shell setup script for full power (Ctrl+R, Ctrl+T, `**<TAB>` bindings). Learning curve for advanced customization (environment variables, preview commands, custom key bindings). Power comes from integration with other tools—standalone usage provides limited value. |
| 115 | + |
| 116 | +**vs traditional find/grep:** Interactive visual feedback with instant results. Fuzzy matching reduces need for exact pattern specification. |
| 117 | + |
| 118 | +**Installation:** |
| 119 | + |
| 120 | +```bash |
| 121 | +# macOS |
| 122 | +brew install fzf |
| 123 | +$(brew --prefix)/opt/fzf/install # Shell integration |
| 124 | + |
| 125 | +# Git clone |
| 126 | +git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf |
| 127 | +~/.fzf/install |
| 128 | + |
| 129 | +# Linux package managers |
| 130 | +sudo apt install fzf # Debian/Ubuntu |
| 131 | +sudo pacman -S fzf # Arch |
| 132 | +``` |
| 133 | + |
| 134 | +Requirements: None (static binary). Shell integration script essential for full functionality. |
| 135 | + |
| 136 | +:::tip fzf Shell Integration |
| 137 | +Full fzf power requires shell integration. After installation, run: |
| 138 | + |
| 139 | +```bash |
| 140 | +$(brew --prefix)/opt/fzf/install # macOS Homebrew |
| 141 | +~/.fzf/install # Git installation |
| 142 | +``` |
| 143 | + |
| 144 | +Enables: Ctrl+R (history), Ctrl+T (files), Alt+C (cd), `**<TAB>` (completion) |
| 145 | +::: |
| 146 | + |
| 147 | +## Git Operations |
| 148 | + |
| 149 | +### lazygit |
| 150 | + |
| 151 | +[**lazygit**](https://github.com/jesseduffield/lazygit) is a Go-based Git TUI (terminal user interface) for visual branch management, interactive staging, and commit navigation. Cross-platform with extensive customization options. |
| 152 | + |
| 153 | +**Key differentiators:** Visual branch tree shows repository topology without command memorization. Interactive staging supports hunk selection and individual line staging. Commit navigation browses history with inline diffs. Customizable keybindings via YAML config. Mouse support for clicking to select, scrolling through commits. Multi-worktree awareness for parallel branch development. |
| 154 | + |
| 155 | +**Best suited for:** Developers managing multi-worktree workflows who need visual branch context. Engineers doing complex interactive rebases, cherry-picks, and merges. Users wanting git discoverability via menu-driven interface instead of command memorization. |
| 156 | + |
| 157 | +**Trade-offs:** Performance degrades on massive repositories (Linux kernel: 57s load time, 2.6GB RAM usage). Not a replacement for all git commands—some operations faster via raw CLI. Learning curve for keybindings, though discoverable via built-in help menu. |
| 158 | + |
| 159 | +**vs raw git:** Visual interface reduces command memorization burden. Complex operations (rebase, cherry-pick) easier with interactive UI. |
| 160 | + |
| 161 | +**vs gitui:** More mature ecosystem (plugins, community integrations) but slower on massive repos. gitui benchmarks: 24s load time, 0.17GB RAM on Linux kernel. |
| 162 | + |
| 163 | +**vs tig:** Significantly faster (57s vs 4m20s on Linux kernel). More interactive—tig focuses on browsing, lazygit enables full git workflows. |
| 164 | + |
| 165 | +**Installation:** |
| 166 | + |
| 167 | +```bash |
| 168 | +# macOS |
| 169 | +brew install lazygit |
| 170 | + |
| 171 | +# Go |
| 172 | +go install github.com/jesseduffield/lazygit@latest |
| 173 | + |
| 174 | +# Windows |
| 175 | +scoop install lazygit |
| 176 | + |
| 177 | +# Linux package managers |
| 178 | +sudo apt install lazygit # Debian/Ubuntu |
| 179 | +sudo pacman -S lazygit # Arch |
| 180 | +``` |
| 181 | + |
| 182 | +Requirements: git. Optional: custom config in `~/.config/lazygit/config.yml`. |
| 183 | + |
| 184 | +## Philosophy: Mix CLI and UI Tools |
| 185 | + |
| 186 | +Don't be dogmatic about terminal-only or GUI-only workflows. IDEs remain the best tools for code navigation, symbol search, and viewing large files. CLI excels at quick edits, git operations, and managing parallel sessions. |
| 187 | + |
| 188 | +**Use the best tool for each task:** |
| 189 | + |
| 190 | +- **Code navigation and exploration:** IDE (VS Code, IntelliJ, etc.) - superior symbol search, go-to-definition, call hierarchies |
| 191 | +- **Quick edits in agent context:** CLI (micro, vim) - faster than switching to IDE for one-line changes |
| 192 | +- **Git operations across worktrees:** CLI (lazygit, raw git commands) - better visibility into multiple branches |
| 193 | +- **Reading large files or complex logic:** IDE - better syntax highlighting, folding, and navigation |
| 194 | + |
| 195 | +Pragmatism beats purism. These are all just tools—choose based on efficiency, not ideology. |
| 196 | + |
| 197 | +--- |
| 198 | + |
| 199 | +**Related Course Content:** |
| 200 | + |
| 201 | +- [Lesson 7: Planning & Execution](/docs/practical-techniques/lesson-7-planning-execution) - Multi-worktree workflows leveraging these CLI tools |
| 202 | +- [Developer Tools: Terminals](/developer-tools/terminals) - Terminal recommendations for running these CLI tools efficiently |
| 203 | +- [Developer Tools: MCP Servers](/developer-tools/mcp-servers) - Extend CLI agents with code research and web grounding |
0 commit comments