: prefix syntax, tag files with @[filename], and maintain conversation context across sessions.
Overview
The shell integration provides:- Smart command transformation - Convert
:commandsyntax into Forge executions - File tagging - Reference files with
@[filename]and interactive selection - Conversation continuity - Automatic session management across commands
- Syntax highlighting - Visual feedback for commands and tagged files
- Agent selection - Tab completion for available agents
- Background syncing - Automatic workspace indexing
Quick Start
Installation
Prerequisites
Install required dependencies:- macOS (Homebrew)
- Ubuntu/Debian
- Arch Linux
Plugin Setup
The plugin is automatically installed with Forge. Enable it in your~/.zshrc:
Core Features
Conversation Commands
Start conversations with the: prefix:
Agent Selection
Specify agents by name with tab completion:File Tagging
Reference files in your commands:- Manual Tagging
- Interactive Selection
- Automatic context loading for referenced files
- Multiple files in single command
- Fuzzy finding with
fzfintegration - Syntax highlighting for tagged files (green bold)
Session Management
- New Session
- Switch Conversations
- Clone Conversations
Start fresh conversation:This will:
- Clear current conversation context
- Show banner with helpful info
- Reset session state
- Display confirmation with timestamp
Workspace Operations
Syntax Highlighting
The plugin provides visual feedback:Highlighting Legend
- Tagged Files (
@[filename]): Green bold - Agent Commands (
:agent): Yellow bold for agent name - Command Text: White bold
Configuration
Customize plugin behavior with environment variables:Theme Customization
The Forge theme adds right-side prompt with agent and model info:- Active agent name
- Current model
- Token count
- Cost estimation
- Nerd Font icons (auto-detected)
- Color-coded status
- Real-time updates
- Currency conversion
Advanced Features
Command History
All transformed commands save to ZSH history:Keyboard Shortcuts
| Shortcut | Action |
|---|---|
| Tab | Interactive completion (files, agents) |
| Enter | Transform and execute :commands |
| Ctrl+C | Interrupt running Forge commands |
| Ctrl+R | Search command history |
| ↑/↓ | Navigate command history |
Background Operations
The plugin handles background tasks:- Auto-sync: Periodic workspace indexing
- Update checks: Notify about new Forge versions
- Conversation saving: Automatic session persistence
Git Integration
Shell plugin integrates with git workflows:Diagnostics
Run:doctor for comprehensive environment check:
- ZSH version and terminal info
- Forge installation and version
- Plugin and theme loading status
- Completions availability
- Dependencies (fzf, fd, bat)
- ZSH plugins (autosuggestions, syntax-highlighting)
- Editor configuration
- PATH setup
- Nerd Font support
Usage Examples
Basic Workflow
Multi-File Analysis
Session Management
Troubleshooting
Commands not transforming
Commands not transforming
- Verify plugin is loaded:
type _forge_line_init - Check ZSH version:
zsh --version(requires 5.0+) - Reload config:
source ~/.zshrc - Look for errors in plugin loading
File completion not working
File completion not working
- Install
fzf:brew install fzf(or platform equivalent) - Install
fd:brew install fd - Test fzf:
echo test | fzf - Verify PATH includes fzf and fd
Conversation context lost
Conversation context lost
- Check
_FORGE_CONVERSATION_IDis set:echo $_FORGE_CONVERSATION_ID - Verify
.forgedirectory exists in project - Don’t mix
:newwith:c- they manage context differently - Use
:infoto see current conversation status
Theme not showing
Theme not showing
- Verify theme loaded:
echo $_FORGE_THEME_LOADED - Check RPROMPT:
echo $RPROMPT - Enable prompt substitution:
setopt PROMPT_SUBST - Reload shell config
Best Practices
- Use
:syncearly - Index workspace when entering new projects - Leverage
:new- Start fresh for unrelated tasks - Tag files liberally - Provide context with
@[file]references - Use descriptive prompts - Clear instructions get better results
- Switch agents - Use specialized agents for specific tasks
- Review with
:info- Check current session context - Run
:doctor- Diagnose issues before reporting bugs
Related Features
- Custom Commands - Create reusable command workflows
- Semantic Search - Power behind
:syncand code exploration - Git Operations - Integrated git workflows
- Multi-Agent Workflows - Orchestrate specialized agents