diff --git a/openhands/usage/run-openhands/cli-mode.mdx b/openhands/usage/run-openhands/cli-mode.mdx index 45767f6fa..bbf44ce9e 100644 --- a/openhands/usage/run-openhands/cli-mode.mdx +++ b/openhands/usage/run-openhands/cli-mode.mdx @@ -28,22 +28,20 @@ configuration format has changed. Requires Python 3.12+ and uv installed. + **Install OpenHands:** ```bash - uvx --python 3.12 openhands + uv tool install openhands ``` - - - Add the following to your shell configuration file (`.bashrc`, `.zshrc`, etc.): - + **Run OpenHands:** ```bash - alias openhands="uvx --python 3.12 openhands" - alias oh="uvx --python 3.12 openhands" + openhands ``` - After adding these lines, reload your shell configuration with `source ~/.bashrc` or `source ~/.zshrc` (depending on your shell). - - + **Upgrade OpenHands:** + ```bash + uv tool upgrade openhands + ``` 1. Download the executable binary from @@ -99,7 +97,7 @@ configuration format has changed. --add-host host.docker.internal:host-gateway \ --name openhands-cli-$(date +%Y%m%d%H%M%S) \ python:3.12-slim \ - bash -c "pip install uv && uvx --python 3.12 openhands" + bash -c "pip install uv && uv tool install openhands && openhands" ``` The `-e SANDBOX_USER_ID=$(id -u)` is passed to the Docker command to ensure the sandbox user matches the host user’s diff --git a/openhands/usage/run-openhands/gui-mode.mdx b/openhands/usage/run-openhands/gui-mode.mdx index f248e6a9a..48cb8136a 100644 --- a/openhands/usage/run-openhands/gui-mode.mdx +++ b/openhands/usage/run-openhands/gui-mode.mdx @@ -15,7 +15,7 @@ You can launch the OpenHands GUI server directly from the command line using the **Prerequisites**: You need to have the [OpenHands CLI installed](/usage/run-openhands/cli-mode) first, OR have `uv` -installed and run `uvx --python 3.12 openhands serve`. Otherwise, you'll need to use Docker +installed and run `uv tool install openhands` and `openhands server`. Otherwise, you'll need to use Docker directly (see the [Docker section](#using-docker-directly) below). diff --git a/openhands/usage/run-openhands/local-setup.mdx b/openhands/usage/run-openhands/local-setup.mdx index a67f45808..a2d760357 100644 --- a/openhands/usage/run-openhands/local-setup.mdx +++ b/openhands/usage/run-openhands/local-setup.mdx @@ -76,20 +76,30 @@ We recommend using [uv](https://docs.astral.sh/uv/) for the best OpenHands exper See the [uv installation guide](https://docs.astral.sh/uv/getting-started/installation/) for the latest installation instructions for your platform. +**Install OpenHands**: +```bash +uv tool install openhands +``` + **Launch OpenHands**: ```bash # Launch the GUI server -uvx --python 3.12 openhands serve +openhands serve # Or with GPU support (requires nvidia-docker) -uvx --python 3.12 openhands serve --gpu +openhands serve --gpu # Or with current directory mounted -uvx --python 3.12 openhands serve --mount-cwd +openhands serve --mount-cwd ``` This will automatically handle Docker requirements checking, image pulling, and launching the GUI server. The `--gpu` flag enables GPU support via nvidia-docker, and `--mount-cwd` mounts your current directory into the container. +**Upgrade OpenHands**: +```bash +uv tool upgrade openhands +``` + If you prefer to use pip and have Python 3.12+ installed: diff --git a/openhands/usage/windows-without-wsl.mdx b/openhands/usage/windows-without-wsl.mdx index a75cb710e..c8f6e808a 100644 --- a/openhands/usage/windows-without-wsl.mdx +++ b/openhands/usage/windows-without-wsl.mdx @@ -163,10 +163,22 @@ After installation, restart your PowerShell session to ensure the environment va ### 3. Install and Run OpenHands -After installing the prerequisites, you can install and run OpenHands with: +After installing the prerequisites, install OpenHands with: ```powershell -uvx --python 3.12 openhands +uv tool install openhands +``` + +Then run OpenHands: + +```powershell +openhands +``` + +To upgrade OpenHands in the future: + +```powershell +uv tool upgrade openhands ``` ### Troubleshooting CLI Issues