A powerful shell plugin that provides intelligent command transformation, file tagging, and conversation management for the Forge AI assistant. Supports both ZSH and Fish.
- Smart Command Transformation: Convert
:commandsyntax into forge executions - Agent Selection: Tab completion for available agents using
:agent_name - File Tagging: Interactive file selection with
@[filename]syntax - Syntax Highlighting: Visual feedback for commands and tagged files (ZSH only)
- Conversation Continuity: Automatic session management across commands
- Interactive Completion: Fuzzy finding for files and agents via built-in picker
- Image Pasting: Paste images from clipboard as
@[path]attachments (:paste-image) - Right-Prompt Theme: Shows model, cost, and token usage in your shell prompt
Before using this plugin, ensure you have the following tools installed:
- fd - Fast file finder (alternative to find)
- forge - The Forge CLI tool
# macOS (using Homebrew)
brew install fd
# Ubuntu/Debian
sudo apt install fd-find
# Arch Linux
sudo pacman -S fdFor :paste-image / :pi support:
- macOS:
pngpaste(brew install pngpaste) - Linux X11:
xclip(apt install xclip) - Linux Wayland:
wl-paste(your distribution's package manager)
forge setup # Updates ~/.zshrc with plugin and themeforge fish setup # Updates ~/.config/fish/config.fish with plugin and themeBegin any command with : followed by your prompt:
: Get the current timeThis automatically starts a new conversation with the default Forge agent.
Specify an agent by name after the colon:
:sage How does caching work in this system?
:muse Create a deployment strategy for my appTab Completion: Type : followed by partial agent name and press TAB for interactive selection.
Tag files in your commands using the @[filename] syntax:
: Review this code @[src/main.rs]
: Explain the configuration in @[config.yaml]Interactive Selection: Type @ and press TAB to search and select files interactively using fuzzy finder.
Commands within the same session maintain context:
# First command
: My project uses React and TypeScript
# Second command (remembers previous context)
: How can I optimize the build process?The plugin automatically manages conversation IDs to maintain context across related commands.
Shell commands should follow the Object-Action format.
Examples:
:provider-login:sync-status
For backward compatibility, :login remains available as an alias for :provider-login.
Clear the current conversation context and start fresh:
:new
# or use the alias
:nThis will:
- Clear the current conversation ID
- Show the banner with helpful information
- Reset the session state
- Display a confirmation message with timestamp
View system and project information:
:info
# or use the alias
:iThis displays:
-
System information
-
Project details
-
Current configuration
-
Current configuration
Browse and switch between conversations interactively:
:conversation
# or use the alias
:cThis will display an interactive list of all conversations with preview, allowing you to select and switch.
Switch to a specific conversation by ID:
:conversation <conversation_id>Toggle between current and previous conversation (like cd -):
:conversation -
# or
:c -The plugin remembers your previous conversation, allowing you to quickly toggle back and forth. This works just like cd - in your shell, and also works with :new - when you start a new conversation, you can toggle back to your previous one.
If there's no previous conversation tracked (e.g., first time using the plugin), :c - will show the conversation list popup, allowing you to select a conversation.
This is useful when:
- You need to temporarily check another conversation and come back
- You're comparing or referencing information between two conversations
- You want to quickly switch context between related tasks
- You started a new conversation but want to reference the previous one
Create a copy of an existing conversation with interactive selection:
:cloneThis will:
- Display an interactive list of all conversations with preview
- Allow you to select a conversation to clone
- Create a new conversation with the same content
- Automatically switch to the cloned conversation
- Show the cloned conversation content and details
You can also clone a specific conversation by providing its ID:
:clone <conversation_id>This is useful when you want to:
- Create a backup before making significant changes
- Start a new conversation branch from an existing context
- Experiment with different approaches while preserving the original
The plugin automatically displays session information including:
- Conversation ID when starting new sessions
- Active agent information
- New session confirmations with timestamps
The plugin provides visual feedback through syntax highlighting:
- Tagged Files (
@[filename]): Displayed in green bold - Agent Commands (
:agent): Agent names in yellow bold - Command Text: Remaining text in white bold
Note: Syntax highlighting is only available in ZSH. Fish has built-in syntax highlighting that cannot be overridden for
:commands. In Fish,:commandwill appear in the default error color (red), but the plugin intercepts Enter before Fish evaluates the line, so commands work correctly.
You can paste images from your clipboard directly into a prompt:
:paste-image # or :piThis reads an image from the system clipboard, saves it to a temporary file, and inserts @[/tmp/forge-paste-xxx.png] into your command line. Add a prompt and press Enter to send the image to the AI.
Supported clipboard tools:
| Platform | Tool | Install |
|---|---|---|
| macOS | pngpaste |
brew install pngpaste |
| Linux (X11) | xclip |
apt install xclip |
| Linux (Wayland) | wl-paste |
Distribution package manager |
Customize the plugin behavior by setting these variables before loading the plugin:
# Custom forge binary location
export FORGE_BIN="/path/to/custom/forge"FORGE_BIN: Path to the forge executable (default:forge)FORGE_EDITOR: Editor command to use for:editcommand (default:$EDITORornano)FORGE_SYNC_ENABLED: Enable/disable automatic workspace sync (default:true)FORGE_MAX_COMMIT_DIFF: Maximum diff size for commit message generation in bytes (default:100000)FORGE_SKIP_INTERACTIVE: Skip interactive prompts (internal use)FORGE_CURRENCY_SYMBOL: Currency symbol for cost display in ZSH theme (default:"$")FORGE_CURRENCY_CONVERSION_RATE: Conversion rate for currency display (default:1.0)NERD_FONT: Enable Nerd Font icons in ZSH theme (default: auto-detected, set to"1"or"true"to enable,"0"or"false"to disable)USE_NERD_FONT: Alternative variable for enabling Nerd Font icons (same behavior asNERD_FONT)- Internal pattern matching for conversation syntax (
:) - New session command keyword:
:newor:n
Sync your codebase for semantic search:
:syncThis will index the current directory for semantic code search.
Run comprehensive environment diagnostics to check your Forge setup:
:doctorZSH (forge doctor) checks:
- ZSH version and terminal information
- Forge installation and version
- Plugin and theme loading status
- Completions availability
- Dependencies (fd, bat)
- ZSH plugins (autosuggestions, syntax-highlighting)
- Editor configuration and PATH setup
- Nerd Font support for icons
Fish (forge fish doctor) checks:
- Fish version and terminal information
- Forge installation and version
- Plugin and theme loading status
- Dependencies (fzf, fd, bat)
- Editor configuration and PATH setup
The plugin creates a .forge directory in your current working directory (similar to .git) for temporary files:
FORGE_EDITMSG.md: Temporary file used when opening an external editor with:edit
All transformed commands are properly saved to shell history, allowing you to:
- Navigate command history with arrow keys
- Search previous forge commands with
Ctrl+R - Reuse complex commands with file tags
- Tab: Interactive completion for files (
@) and agents (:) - Enter: Transform and execute
:commands - Ctrl+C: Interrupt running forge commands
: What's the weather like?
:sage Explain the MVC pattern
:planner Help me structure this project: Review this implementation @[src/auth.rs]
: Debug the issue in @[logs/error.log] @[config/app.yml]: I'm working on a Rust web API
: What are the best practices for error handling?
: Show me an example with @[src/errors.rs]
:info
:new
: New conversation starts here# Copy an image to clipboard first (Ctrl+C in browser, screenshot, etc.)
:paste-image # Inserts @[/tmp/forge-paste-xxx.png] into command line
:pi # Shortcut
# Combine with a prompt
:paste-image then describe what you see# Sync current directory for semantic search
:sync