Overview
The Forge ZSH theme adds AI context to your prompt, displaying active agent information, model details, and token usage directly in your terminal. It integrates seamlessly with your existing ZSH theme by augmenting the right prompt (RPROMPT).Features
- Active agent and model display
- Real-time token count tracking
- Cost estimation per conversation
- Nerd Font icon support (auto-detected)
- Currency conversion support
- Non-intrusive right-prompt integration
- High-performance prompt rendering
Installation
Automatic Setup
The theme is automatically installed when you set up the Forge ZSH plugin:This adds the theme loader to your
~/.zshrc:Manual Setup (Alternative)
To manually load just the theme, add this to your Or generate the theme dynamically:
~/.zshrc:Theme Components
The theme displays information in your right prompt (RPROMPT):Information Display
- Agent Name: Current active agent (if any)
- Model: AI model being used
- Token Count: Total tokens in conversation
- Cost: Estimated cost in your configured currency
- Icons: Nerd Font icons (when supported)
Configuration
Customize the theme using environment variables:Currency Settings
Font Settings
Complete Configuration Example
~/.zshrc
Theme Implementation
The theme is implemented as a single function that queries Forge for prompt information:Performance Optimization
The theme is designed for minimal performance impact:- Single command execution per prompt
- Fully formatted output from Rust (no shell string manipulation)
- Cached conversation state
- Fast binary execution (under 60ms)
Integration with Existing Themes
Oh My Zsh Themes
The Forge theme works alongside Oh My Zsh themes:~/.zshrc
Powerlevel10k
For Powerlevel10k users, the Forge theme appends to the right prompt:~/.zshrc
Starship
If using Starship, you can still use the Forge theme:~/.zshrc
Pure Prompt
The theme works with Pure and other async prompts:~/.zshrc
Customizing Display
The theme output is controlled by the Forge CLI. You can influence what’s displayed through configuration:Show/Hide Elements
Custom Formatting
The theme uses Forge’s internal formatting, which includes:- ANSI color codes for styling
- Icon rendering based on terminal capabilities
- Automatic truncation for long values
- Responsive width adjustment
Nerd Font Icons
Automatic Detection
The theme automatically detects Nerd Font support by checking:NERD_FONTenvironment variableUSE_NERD_FONTenvironment variable- Terminal font capabilities
- Common terminal emulators known to support Nerd Fonts
Supported Icons
When Nerd Fonts are available:- 🤖 Robot icon for agents
- 💬 Chat bubble for conversations
- 📊 Chart for token usage
- 💵 Money bag for costs
- 🔧 Wrench for system operations
Fallback Display
Without Nerd Fonts, the theme uses:- Text labels (Agent:, Model:, Tokens:)
- ASCII symbols
- Plain text formatting
Troubleshooting
Theme not showing
Theme not showing
Verify prompt substitution is enabled:Check if theme is loaded:
Icons not displaying
Icons not displaying
Install a Nerd Font and configure your terminal:Or disable icon display:
Slow prompt rendering
Slow prompt rendering
Check Forge CLI performance:Should complete in under 60ms. If slower, check:
- Disk I/O performance
- Forge configuration file size
- System resource usage
Prompt conflicts with existing theme
Prompt conflicts with existing theme
The Forge theme appends to RPROMPT. If you have conflicts:Or isolate the theme:
Performance Benchmarks
The theme is optimized for performance:| Operation | Time | Notes |
|---|---|---|
| Theme render | <60ms | Single Rust binary call |
| RPROMPT update | ~50ms | Includes formatting |
| No active conversation | ~10ms | Fast path for empty state |
.github/workflows/ci.yml:57).
Examples
Minimal Setup
~/.zshrc
Full Setup with Customization
~/.zshrc
Oh My Zsh Integration
~/.zshrc
Next Steps
ZSH Plugin
Install the complete ZSH plugin
Shell Completions
Set up shell completions
Configuration
Configure Forge settings
Customization
Customize Forge appearance