te (手)
Your helping hand for editing terminal commands
te (Japanese: 手, "hand") is an interactive TUI tool that makes editing commands much easier by separating navigation and editing into two distinct modes. Perfect for tweaking long commands from your shell history or current command line.
The Problem
Editing long commands in the terminal buffer is frustrating:
# You have this command in your terminal (maybe from history)
# Want to change "asset" to "frontend"?
# - Arrow key through the entire line character by character
# - Easy to accidentally delete quotes, commas, or other syntax
# - Hard to see where you are in a long command
The Solution
te gives you a two-mode interface inspired by vim:
- Navigation Mode: Jump between command components with arrow keys
- Edit Mode: Focus on editing a single component without accidentally breaking the rest
Simply prefix your command with te:
te will:
- 🧩 Parse your command into logical components (base, flags, values)
- 🎯 Let you navigate between components with arrow keys (Navigation Mode)
- ✏️ Let you edit individual components safely (Edit Mode)
- 👁️ Show a real-time preview as you make changes
- ⚡ Output the final command when ready
Features
🎯 Two-Mode Interface
Clear separation between navigation and editing, inspired by modal editors:
- Navigation Mode: Use arrow keys to jump between command components instantly
- Edit Mode: Edit a single component in isolation without breaking the rest
- Visual distinction shows which mode you're in
🧩 Component-Based Parsing
Breaks commands into logical pieces:
- Base commands and subcommands
- Flags (
--flagor-f) - Values associated with flags
- Each component is independently editable
🔧 Universal Wrapper
Works with any CLI command. te simply parses your command string - no special support needed from the tool.
🚀 Edit, Don't Execute
te focuses on helping you build the right command:
- Shows the final command instead of executing it
- Copy-paste friendly output
- Safe to experiment - no accidental command execution
Installation
Homebrew (macOS/Linux)
Cargo (crates.io)
Pre-built Binaries
Download from GitHub Releases:
# macOS (Apple Silicon)
|
# macOS (Intel)
|
# Linux (x64)
|
# Linux (ARM64)
|
From Source
Shell Integration (Strongly Recommended)
Enable shell integration to unlock te's full power, including direct command execution.
Zsh (~/.zshrc):
Bash (~/.bashrc or ~/.bash_profile):
Fish (~/.config/fish/config.fish):
te init fish | source
With shell integration you get:
- ✅
te-runfunction - Execute commands directly and add them to history - ✅ Zsh only:
Ctrl+Tkeybinding to invoke te on your current command line
Usage with shell integration:
# Use te-run to execute commands
# In Zsh: Type a command and press Ctrl+T to edit it interactively
Usage
Basic Usage
Simply prefix your existing command with te:
# Edit a kubectl command
# Edit a docker command
# Edit an ffmpeg command
# Edit the last command from history
In the TUI
Navigation Mode (default):
↑/↓orj/k: Move between command componentsEnter: Switch to Edit Mode for the selected component1-9, then letters: Jump directly to a component by its displayed shortcut keyi: Insert new component before currenta: Append new component after currentdorDeleteorBackspace: Delete selected componentuorCtrl+Z: UndoCtrl+RorCtrl+Y: RedoGorEnd: Jump to last componentHome: Jump to first componentCtrl+XorCtrl+Enter: Confirm and output the final commandqorEsc: Exit without outputting
Edit Mode (when editing a component):
- Type to edit the component value
Enter: Save changes and return to Navigation ModeEsc: Cancel changes and return to Navigation ModeShift+EnterorCtrl+J: Insert newline (for multi-line editing)Ctrl+XorCtrl+Enter: Save and output the final command- Standard readline shortcuts supported (Ctrl+A/E/K/U/W/Y, etc.)
How It Works
- Parse:
tebreaks your command into components (base command, flags, values) - Navigate: Use
↑/↓to jump between components instantly - Edit: Press
Enterto edit a component - Confirm: Press
Ctrl+Xto output the final command - Execute: With shell integration (
te-run), the command runs automatically and is added to history
Comparison
te takes a unique approach to command editing:
| Tool | Scope | Key Feature |
|---|---|---|
| Terminal default | Any | Character-by-character editing |
AWS CLI --cli-auto-prompt |
AWS only | Interactive prompts with AWS-specific knowledge |
kube-prompt |
kubectl only | REPL with kubectl auto-completion |
trogon |
Click/Typer apps | Auto-generated forms from Python code |
te |
Any CLI tool | Modal editing: Navigate by component, not by character |
Why "te" (手)?
In Japanese, 手 (te) means "hand" - representing:
- 🤝 A helping hand for complex commands
- ✋ Easy to type (just 2 characters)
- 🎌 Honoring the Unix philosophy with a Japanese touch
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT License - see LICENSE for details
Credits
Built with:
- ratatui - Terminal UI framework
- crossterm - Cross-platform terminal manipulation
- clap - Command line argument parsing
Star ⭐ this repo if you find it useful!