OpenHands is an autonomous AI software engineer capable of executing complex engineering tasks through a command-line interface.
- Python 3.11+
- Poetry or pip
- Docker (optional, for sandboxed execution)
# Clone the repository
git clone https://github.com/All-Hands-AI/OpenHands.git
cd OpenHands
# Using Poetry (recommended)
poetry config virtualenvs.in-project true
poetry install
# Or using pip
python3 -m venv .venv
source .venv/bin/activate
pip install -e .# Install and run CLI directly
uvx --python 3.12 --from openhands-ai openhands# Run with a task
openhands "Write a Python function that calculates factorial"
# Use a specific model
openhands --llm-model claude-3-5-sonnet-20241022 "Create a web scraper"
# Set API keys
export ANTHROPIC_API_KEY=your_key_here
export OPENAI_API_KEY=your_key_hereCreate a config.toml file based on config.template.toml:
[llm]
model = "claude-3-5-sonnet-20241022"
api_key = "your-api-key"
[runtime]
type = "local" # or "docker"While in a session, you can use these commands:
/help- Show available commands/exit- Exit the session/finish- Mark task as complete/settings- Modify LLM settings
openhands/cli/- CLI interface and commandsopenhands/core/- Core configuration and setupopenhands/controller/- Agent control and executionopenhands/agenthub/- Available agentsopenhands/runtime/- Execution environmentsopenhands/events/- Event systemopenhands/memory/- Agent memory managementmicroagents/- Microagent definitions.openhands/- Local configuration and microagents
OpenHands supports various LLM providers:
- Anthropic: Claude models (recommended)
- OpenAI: GPT-4, GPT-3.5
- Local models: Via Ollama or other providers
See the LLM configuration guide for details.
- Local: Direct execution on your machine
- Docker: Sandboxed execution in containers (safer for untrusted code)
This project is licensed under the MIT License - see the LICENSE file for details.
@inproceedings{
wang2025openhands,
title={OpenHands: An Open Platform for {AI} Software Developers as Generalist Agents},
author={Xingyao Wang and Boxuan Li and Yufan Song and Frank F. Xu and Xiangru Tang and Mingchen Zhuge and Jiayi Pan and Yueqi Song and Bowen Li and Jaskirat Singh and Hoang H. Tran and Fuqiang Li and Ren Ma and Mingzhang Zheng and Bill Qian and Yanjun Shao and Niklas Muennighoff and Yizhe Zhang and Binyuan Hui and Junyang Lin and Robert Brennan and Hao Peng and Heng Ji and Graham Neubig},
booktitle={The Thirteenth International Conference on Learning Representations},
year={2025},
url={https://openreview.net/forum?id=OJd3ayDDoF}
}