Skip to main content

Overview

This mode is different from the headless mode, which is non-interactive and better for scripting.
If you’re upgrading from a CLI version before release 1.0.0, you’ll need to redo your settings setup as the configuration format has changed.

Getting Started

The first time you run the CLI, it will take you through configuring the required LLM settings. These will be saved for future sessions. The conversation history will be saved in ~/.openhands/conversations.

Interactive CLI Overview

What is CLI Mode?

CLI mode enables real-time interaction with OpenHands through the terminal. You can type natural language tasks, use interactive commands, and receive instant feedback—all inside your terminal.

CLI Options and Arguments

The OpenHands CLI supports various command-line options to customize your experience:

Basic Options

  • --version or -v: Display the CLI version
  • --task "your task": Start the CLI with an initial task message
  • --file path/to/file: Start the CLI with a specific file context
  • --headless: Run in headless mode with auto-exit functionality
  • --exit-without-confirmation: Exit without confirmation prompts

Experimental UI

The experimental UI is available starting from CLI version 1.5.0 and provides an enhanced terminal experience.
Enable the experimental UI with the --exp flag:
openhands --exp
Experimental UI Features:
  • Enhanced Visual Experience: Consistent dark mode CLI UI that overrides light-themed terminals
  • Loading Indicators: Spinner animations for long-running commands
  • Smart Queuing: Queue prompts while the agent is running to avoid interruptions
  • File Search: Use the @ macro to search and reference files in your project
  • Collapsible Messages: Reduced verbosity with optionally collapsible CLI messages
  • Multi-line Support: Improved multi-line input handling with automatic paste detection

Approval and Confirmation Modes

Control how the CLI handles agent actions:
  • --always-approve: Automatically approve all agent actions without prompting
  • --llm-approve: Use the LLM to automatically approve actions based on context

Skills and Capabilities

The CLI automatically loads and provides access to:
  • Project Skills: Custom skills defined in your project’s .openhands/skills/ directory
  • User Skills: Personal skills from ~/.openhands/skills/
  • Public Skills: Community-contributed skills from the OpenHands skills repository
  • Legacy Microagents: Backward compatibility with existing microagent configurations

Version Management

The CLI includes automatic version checking and will prompt you when updates are available. You can check your current version with:
openhands --version

CLI Commands and Settings

The OpenHands CLI provides various commands for managing settings, conversations, and configurations. For detailed information about available commands, configuration options, and troubleshooting, see the CLI Settings page. Key features include:
  • Interactive settings configuration with /settings
  • MCP server management with /mcp
  • Conversation management with /new and /help
  • Memory management with /condense
  • Real-time status monitoring and control