Skip to main content

Built-in Commands

Forge provides a suite of built-in commands prefixed with a forward slash (/) that enhance workflow efficiency and provide system control. These commands can be used directly in the Forge terminal interface.

Available Slash Commands

CommandDescriptionWhen to Use
/newStart a new taskWhen you've completed your current task and want to begin a fresh conversation
/infoView environment summaryWhen you need to check your environment configuration, logs location, or command history
/modelsList available AI modelsWhen you want to see which AI models are available and their capabilities
/dumpSave conversation to JSONWhen you need to debug issues or report problems to the development team
/actSwitch to ACT modeWhen you want Forge to execute commands and implement changes (this is the default mode)
/planSwitch to PLAN modeWhen you want Forge to analyze and plan but not modify files
/helpDisplay help informationWhen you need a reminder of available commands
/exitExit the applicationWhen you want to cleanly exit the Forge CLI

Command Details

/new

The /new command clears the current conversation context and starts a fresh task. This is useful when you've completed your current task and want to begin something entirely different.

/new

When to use: Use this when switching between unrelated tasks to ensure a clean context.

/info

The /info command displays information about your environment, including system details, logs location, and command history.

/info

Example output:

System Information:
- OS: macOS Monterey 12.6
- Architecture: x86_64
- Shell: /bin/zsh

Environment:
- Current Directory: /Users/username/projects
- Forge Version: 0.8.2

Log Files:
- Location: /Users/username/.forge/logs
- Debug Log: debug.log
- Error Log: error.log

Recent Commands:
1. analyze this codebase
2. fix the bug in auth.js
3. /models

When to use: Use this when you need to troubleshoot, find log files, or review your recent commands.

/models

The /models command lists all available AI models with their capabilities and context limitations.

/models

Example output:

Available models:
- anthropic/claude-3.7-sonnet (Context: 200K tokens)
- anthropic/claude-3.5-haiku (Context: 200K tokens)

When to use: Use this when you want to check which models are available or understand their capabilities.

/dump

The /dump command saves the current conversation in JSON format to a file for future reference.

/dump

Example output:

Conversation saved to: /Users/username/2023-03-15_14-22-37-dump.json

When to use: Use this when you need to debug issues, inspect the conversation context, or report problems to the development team.

/act

The /act command switches Forge to ACT mode, where it can execute commands and implement changes.

/act

Example output:

Switched to ACT mode. Forge will now implement changes when instructed.

When to use: This is the default mode. Use this command to switch back to ACT mode if you were previously in PLAN mode.

/plan

The /plan command switches Forge to PLAN mode, where it analyzes and suggests changes without modifying files.

/plan

Example output:

Switched to PLAN mode. Forge will analyze and plan but NOT implement changes.

When to use: Use this when you want Forge to analyze your codebase and suggest changes without actually implementing them. This is useful for understanding what would happen before making changes.

/help

The /help command displays information about available commands and their usage.

/help

When to use: Use this when you need a quick reminder of the available commands and their functions.

/exit

The /exit command cleanly exits the Forge CLI application.

/exit

When to use: Use this when you want to close Forge. Alternatively, you can press Ctrl+D.

Custom Commands

In addition to these built-in commands, Forge allows you to define your own custom commands in your forge.yaml configuration file. These custom commands can be used to trigger specific agents to perform specialized tasks.

For information about creating custom commands, see the Custom Commands documentation.

Best Practices

  • Start Fresh: Use /new when switching between unrelated tasks to ensure the context is clean.
  • Debug Context: Use /dump for debugging purposes when you need to inspect the conversation context or report issues.
  • Understand Before Acting: Use /plan to see what actions Forge would take before allowing it to make changes.
  • Check System Status: Use /info when something isn't working as expected to diagnose potential issues.
  • Select Appropriate Models: Use /models to understand which model is best for your specific task.
  • Create Custom Commands: Define your own custom commands for project-specific operations and workflows.