I'm trying to run the CLI in Docker using these in...
# questions
s
I'm trying to run the CLI in Docker using these instructions: https://docs.all-hands.dev/openhands/usage/run-openhands/cli-mode#using-docker But the Docker image is at 0.59 so I get deprecation warnings. Is there a 1.0.1 in the works or should I build my own?
l
cc @quick-window-91705, are the docs up to date?
q
Yep the docs are up to date However, we have problems with the PyPI package which is being resolved upstream in the agent sdk Here are the logs I see, which are expected at the moment
Copy code
(base) rohitmalhotra@Rohits-Laptop enterprise % docker run -it \
    --pull=always \
    -e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.59-nikolaik \
    -e SANDBOX_USER_ID=$(id -u) \
    -e SANDBOX_VOLUMES=$SANDBOX_VOLUMES \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -v ~/.openhands:/root/.openhands \
    --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"
3.12-slim: Pulling from library/python
e363695fcb93: Download complete 
eb47881cf6d9: Download complete 
1a7d6facecb1: Download complete 
29fec25b6102: Download complete 
Digest: sha256:dc9e92fcdc085ad86dda976f4cfc58856dba33a438a16db37ff00151b285c8ca
Status: Downloaded newer image for python:3.12-slim
Collecting uv
  Downloading uv-0.9.3-py3-none-manylinux_2_28_aarch64.whl.metadata (11 kB)
Downloading uv-0.9.3-py3-none-manylinux_2_28_aarch64.whl (20.1 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 20.1/20.1 MB 32.0 MB/s eta 0:00:00
Installing collected packages: uv
Successfully installed uv-0.9.3
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager, possibly rendering your system unusable. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv. Use the --root-user-action option if you know what you are doing and want to suppress this warning.

[notice] A new release of pip is available: 25.0.1 -> 25.2
[notice] To update, run: pip install --upgrade pip
      Built func-timeout==4.3.5
Installed 140 packages in 85ms
Error: No module named 'openhands'
Traceback (most recent call last):
  File "/root/.cache/uv/archive-v0/Glr9hx1yutgvhXjQ_IvPm/lib/python3.12/site-packages/openhands_cli/simple_main.py", line 42, in main
    from openhands_cli.agent_chat import run_cli_entry
  File "/root/.cache/uv/archive-v0/Glr9hx1yutgvhXjQ_IvPm/lib/python3.12/site-packages/openhands_cli/agent_chat.py", line 10, in <module>
    from openhands.sdk import (
ModuleNotFoundError: No module named 'openhands'
Traceback (most recent call last):
  File "/root/.cache/uv/archive-v0/Glr9hx1yutgvhXjQ_IvPm/bin/openhands", line 12, in <module>
    sys.exit(main())
             ^^^^^^
  File "/root/.cache/uv/archive-v0/Glr9hx1yutgvhXjQ_IvPm/lib/python3.12/site-packages/openhands_cli/simple_main.py", line 42, in main
    from openhands_cli.agent_chat import run_cli_entry
  File "/root/.cache/uv/archive-v0/Glr9hx1yutgvhXjQ_IvPm/lib/python3.12/site-packages/openhands_cli/agent_chat.py", line 10, in <module>
    from openhands.sdk import (
ModuleNotFoundError: No module named 'openhands'
s
I couldn't find where to see the available images but tried a few things and this works: docker.all-hands.dev/all-hands-ai/openhands:1.0.1-cli
q
Hmm I believe we don't publish a docker image for the CLI, what command are you running Jim?
s
So I got 0.59 on that command for the CLI instructions. Now I'm trying the local LLM (I'm testing with LM Studio) using this: https://docs.all-hands.dev/openhands/usage/llms/local-llms#5-start-openhands
that gives
Copy code
docker pull docker.all-hands.dev/all-hands-ai/runtime:0.59-nikolaik

docker run -it --rm --pull=always \
    -e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.59-nikolaik \
    -e LOG_ALL_EVENTS=true \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -v ~/.openhands:/.openhands \
    -p 3000:3000 \
    --add-host host.docker.internal:host-gateway \
    --name openhands-app \
    docker.all-hands.dev/all-hands-ai/openhands:0.59
the image list
Copy code
% docker image ls docker.all-hands.dev/all-hands-ai/openhands --all
REPOSITORY                                    TAG         IMAGE ID       CREATED       SIZE
docker.all-hands.dev/all-hands-ai/openhands   1.0.1-cli   4f566d28f527   3 days ago    1.83GB
docker.all-hands.dev/all-hands-ai/openhands   0.59        00968de77a7b   6 days ago    1.83GB
docker.all-hands.dev/all-hands-ai/openhands   0.54        41e4de30642b   8 weeks ago   1.83GB
q
I may be mistaken - it seems like this is kicking off the OpenHands GUI (the app server) How are you starting the CLI?
s
If I run
Copy code
docker run -it \
    --pull=always \
    -e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.59-nikolaik \
    -e SANDBOX_USER_ID=$(id -u) \
    -e SANDBOX_VOLUMES=$SANDBOX_VOLUMES \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -v ~/.openhands:/root/.openhands \
    --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"
i get the same missing openhands error you showed. If I run
uvx --python 3.12 --from openhands-ai openhands
as https://www.all-hands.dev/blog/host-your-own-coding-agents-with-openhands-using-nvidia-dgx-spark says then I get the CLI setup which warns me it is deprecated and the prompts don't look the same as that post shows
I'm trying to make a devcontainer.json that will just launch the CLI using LM Studio for local LLM
q
Ahh I understand now You can continue to use the V0 CLI (the one with the deprecation warnings). It should behave the same as the new V1 CLI (the one referenced in the docs) The V1 CLI doesn't work with UV yet, and we're fixing it asap. Apologies for the confusion! We're expecting around early next week the command above should work again
✅ 1