Overview
The Forge ZSH plugin provides intelligent command transformation, file tagging, and conversation management directly in your terminal. It transforms:command syntax into Forge executions with automatic session management and context continuity.
Features
- Smart command transformation with
:commandsyntax - Agent selection with tab completion
- Interactive file tagging using
@[filename]syntax - Syntax highlighting for commands and files
- Automatic conversation continuity across sessions
- Interactive fuzzy finding for files and agents
Prerequisites
Before installing the plugin, ensure you have these tools:fzf
Command-line fuzzy finder for interactive selections
fd
Fast file finder (alternative to find)
forge
The Forge CLI tool
Automatic Setup
The easiest way to install the Forge ZSH plugin is using the automatic setup:This command will:
- Add the plugin configuration to your
~/.zshrc - Enable required ZSH plugins (zsh-autosuggestions, zsh-syntax-highlighting)
- Load the Forge plugin and theme
- Set up all necessary keybindings
~/.zshrc:Manual Setup (Alternative)
If you prefer manual installation, add this to your Or if using Oh My Zsh, add
~/.zshrc:forge to your plugins array:Basic Usage
Starting Conversations
Begin any command with: followed by your prompt:
Using Specific Agents
Specify an agent by name after the colon:: and press TAB for interactive agent selection.
File Tagging
Tag files in your commands using@[filename] syntax:
@ and press TAB to search and select files interactively.
Session Management
Start New Session
Start New Session
Clear context and start fresh:This clears the conversation ID and resets the session state.
Switch Conversations
Switch Conversations
Browse and switch between conversations:
Clone Conversations
Clone Conversations
Create a copy of an existing conversation:
View System Info
View System Info
Display system and project information:
Configuration
Customize plugin behavior using environment variables in your~/.zshrc:
Available Configuration Variables
| Variable | Default | Description |
|---|---|---|
FORGE_BIN | forge | Path to forge executable |
FORGE_EDITOR | $EDITOR or nano | Editor command for :edit |
FORGE_SYNC_ENABLED | true | Enable automatic workspace sync |
FORGE_MAX_COMMIT_DIFF | 100000 | Max diff size for commits (bytes) |
FORGE_CURRENCY_SYMBOL | $ | Currency symbol for cost display |
FORGE_CURRENCY_CONVERSION_RATE | 1.0 | Currency conversion rate |
NERD_FONT | auto-detected | Enable Nerd Font icons |
Keyboard Shortcuts
The plugin registers these keybindings:- Tab (
^I): Interactive completion for files and agents - Enter (
^M,^J): Transform and execute commands - Ctrl+C: Interrupt running Forge commands
Advanced Features
Syntax Highlighting
The plugin provides visual feedback:- Tagged files (
@[filename]): Green bold - Agent commands (
:agent): Yellow bold - Command text: White bold
Command History
All transformed commands are saved to ZSH history:- Navigate with arrow keys
- Search with
Ctrl+R - Reuse complex commands with file tags
Codebase Indexing
Sync your codebase for semantic search:Environment Diagnostics
Run comprehensive diagnostics:- ZSH version and terminal info
- Forge installation and version
- Plugin and theme loading status
- Dependencies (fzf, fd, bat)
- Editor configuration
- Nerd Font support
Troubleshooting
Plugin not loading
Plugin not loading
Ensure the plugin is sourced after Oh My Zsh initialization:
Tab completion not working
Tab completion not working
Check that fzf is installed and in your PATH:
Syntax highlighting issues
Syntax highlighting issues
Install zsh-syntax-highlighting:
Commands not transforming
Commands not transforming
Verify the plugin is loaded:If empty, the plugin isn’t loaded. Check your
~/.zshrc configuration.Next Steps
ZSH Theme
Customize your prompt with AI context
Shell Completions
Set up completions for other shells
Configuration
Learn about Forge configuration options
Agents
Explore available agents and their capabilities