Skip to main content

Available Commands

The OpenHands CLI provides commands to help with settings and conversations. These commands work by typing / followed by the command. To see a list of all the available commands run /help when running the CLI.

Core Commands

  • /help - Display all available commands and their descriptions
  • /new - Start a new conversation without restarting the CLI
  • /settings - Configure your model, API key, and other preferences
  • /mcp - View MCP server status and configuration
  • /condense - Force compact conversation history to save memory and tokens

ACP Integration Commands

ACP (Agent Computer Protocol) integration provides enhanced agent capabilities and is available starting from CLI version 1.3.0.
When ACP is enabled, additional slash commands become available for managing agent sessions and interactions. These commands provide advanced control over agent behavior and session management.

Settings and Configuration

Interactive Settings Configuration

You can update your model, API key, and other preferences using the /settings command. Just follow the prompts:
  • Basic settings: Choose a provider/model and enter your API key.
  • Advanced settings: Set custom models and toggle memory condensation.

Memory Management

The /condense command allows you to manually trigger conversation history condensation:
  • Purpose: Reduces token usage by compacting conversation history
  • When to use: When conversations become long or you want to optimize performance
  • Effect: Preserves important context while reducing overall message count

Confirmation and Approval Modes

The CLI supports different modes for handling agent actions:
  • Interactive Mode (default): Prompts for approval before executing actions
  • Always Approve Mode (--always-approve): Automatically approves all actions
  • LLM Approve Mode (--llm-approve): Uses the LLM to intelligently approve actions
  • Confirmation Mode: Enhanced approval system with detailed action previews

MCP Server Management

If you’re upgrading from a version before release 1.0.0, you’ll need to redo your MCP server configuration as the format has changed from TOML to JSON.
To configure Model Context Protocol (MCP) servers, you need to manually create and configure the ~/.openhands/mcp.json file using this configuration format. Example: Adding Web Search Capability To add web search capability within your OpenHands CLI, we can use Tavily’s remote MCP server for AI-powered search and data extraction. To do so, you would create or edit ~/.openhands/mcp.json with the following, adding your Tavily API key in the appropriate place:
{
  "mcpServers": {
    "tavily-remote": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://mcp.tavily.com/mcp/?tavilyApiKey=<your-api-key>"
      ]
    }
  }
}
The /mcp command in the CLI provides a read-only view of MCP server status:
  • View active servers: Shows which MCP servers are currently active in the conversation.
  • View pending changes: If the mcp.json file has been modified, shows which servers will be mounted when the conversation is restarted.

Tips and Troubleshooting

  • Use /help at any time to see the list of available commands.
  • If you encounter permission issues, make sure your workspace directory is trusted and all required environment variables are set correctly.
  • If you want to start over, use /new to begin a fresh conversation without restarting the CLI.