Getting Started with OpenHands Code Assistance on Mac
Rany ElHousieny, PhD???
Generative AI ENGINEERING MANAGER | ex-Microsoft | AI Solutions Architect | Generative AI & NLP Expert | Proven Leader in AI-Driven Innovation | Former Microsoft Research & Azure AI | Software Engineering Manager
OpenHands is an AI-powered code assistance tool designed to streamline development workflows. This guide will walk you through the process of installing and running OpenHands on your Mac using Docker.
Prerequisites
Before you begin, ensure you have:
Step 1: Install Docker Desktop
OpenHands runs inside a Docker container, so you need Docker installed on your system. Follow these steps:
You can use the following article if you decide to use Rancher:
Step 2: Configure Permissions and Setup Directory
Before running OpenHands, you need to configure permissions and create the necessary directory.
sudo mkdir ~/.openhands-state
sudo chown -R $(whoami) ~/.openhands-state
sudo chown -R $(whoami) ~/.openhands-state
Step 3: Pull the OpenHands Runtime Image
Next, pull the OpenHands runtime image from the All-Hands AI Docker registry:
docker pull docker.all-hands.dev/all-hands-ai/runtime:0.23-nikolaik
Step 4: Run OpenHands
Start OpenHands using the following docker run command:
docker run -it --rm --pull=always \
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.23-nikolaik \
-e LOG_ALL_EVENTS=true \
-v /var/run/docker.sock:/var/run/docker.sock \
-v ~/.openhands-state:/.openhands-state \
-p 3000:3000 \
--add-host host.docker.internal:host-gateway \
--name openhands-app \
docker.all-hands.dev/all-hands-ai/openhands:0.23
Step 5: Access OpenHands
Once OpenHands is running, you can access it in your browser at:
https://localhost:3000
Step 5: Configure Open-Hands
The first screen will ask you which LLM to use, You can select OpenAI and follow this article to get the API Key
Make sure to name the key in a way to track it:
You can connect it to a GitHub Project. I will use my project that I created in the previous articles:
You will need to sync with Github first
Copy the token and add it to OpenHands and click save
In the following articles, I will work on this project to build a full AI project using just prompts
Conclusion
You have successfully installed and launched OpenHands on your Mac. From here, you can start leveraging its AI-powered assistance to enhance your coding experience. If you encounter any issues, refer to the OpenHands documentation or the support community for further assistance.
AI Solutions Architect | ML Engineer | AI Ethics Advocate | NLP & Generative AI Expert
2 周This is a great tool for streamlining development workflows. Looking forward to trying it out!