This guide explains how to use the OpenHands GitHub Action, both within the OpenHands repository and in your own projects.
To use the OpenHands GitHub Action in a repository, you can:
fix-me label to the issue or leave a comment on the issue starting with @openhands-agent.The action will automatically trigger and attempt to resolve the issue.
To install the OpenHands GitHub Action in your own repository, follow the README for the OpenHands Resolver.
fix-me label to the issue, or leave a comment starting with @openhands-agentfix-me label to the pull request, or address a specific comment by starting with @openhands-agentfix-me): Requests OpenHands to address the entire issue or pull request.@openhands-agent): Requests OpenHands to consider only the issue/pull request description and the specific comment.You can provide custom directions for OpenHands by following the README for the resolver.
To customize the default macro (@openhands-agent):
OPENHANDS_MACROThe .openhands_instructions file is a file that you can put in the root directory of your repository to guide OpenHands in understanding and working with your repository effectively. Here are key tips for writing high-quality instructions:
Concise but Informative: Provide a clear, focused overview of the repository that emphasizes the most common actions OpenHands will need to perform.
Repository Structure: Explain the key directories and their purposes, especially highlighting where different types of code (e.g., frontend, backend) are located.
Development Workflows: Document the essential commands for:
Testing Guidelines: Specify:
# Repository Overview
[Brief description of the project]
## General Setup
- Main build command
- Development environment setup
- Pre-commit checks
## Backend
- Location and structure
- Testing instructions
- Environment requirements
## Frontend
- Setup prerequisites
- Build and test commands
- Environment variables
## Additional Guidelines
- Code style requirements
- Special considerations
- Common workflows
For a real-world example, refer to the OpenHands repository's .openhands_instructions.