Getting Started with OpenHands Code Assistance on Mac

Getting Started with OpenHands Code Assistance on Mac

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:

  • A Mac running macOS
  • An active internet connection
  • Basic familiarity with the terminal

Step 1: Install Docker Desktop

OpenHands runs inside a Docker container, so you need Docker installed on your system. Follow these steps:

  • Download and install Docker Desktop for Mac from the official Docker website.









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.

  • Open your terminal and Create the following directory

sudo mkdir ~/.openhands-state        

  • Change ownership of the OpenHands state directory:

sudo chown -R $(whoami) ~/.openhands-state        

  • If the directory does not exist, create it manually:

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:


https://github.com/ranyelhousieny/Resume_Coach

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.


Robert Graham

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!

回复

要查看或添加评论,请登录

Rany ElHousieny, PhD???的更多文章