From a1b59b6185a80fd26cb7c948c074081ac84aba59 Mon Sep 17 00:00:00 2001 From: mamoodi Date: Thu, 2 Jan 2025 13:18:01 -0500 Subject: [PATCH] Minor README update, Headless and CLI doc changes (#5977) --- README.md | 8 ++--- docs/modules/usage/how-to/cli-mode.md | 29 ++++------------- docs/modules/usage/how-to/headless-mode.md | 38 ++++++++++------------ docs/modules/usage/installation.mdx | 7 +++- 4 files changed, 34 insertions(+), 48 deletions(-) diff --git a/README.md b/README.md index e55f1d88fe40..fbf479e07efd 100644 --- a/README.md +++ b/README.md @@ -64,16 +64,16 @@ works best, but you have [many options](https://docs.all-hands.dev/modules/usage --- -You can also [connect OpenHands to your local filesystem](https://docs.all-hands.dev/modules/usage/runtimes), +You can also [connect OpenHands to your local filesystem](https://docs.all-hands.dev/modules/usage/runtimes#connecting-to-your-filesystem), run OpenHands in a scriptable [headless mode](https://docs.all-hands.dev/modules/usage/how-to/headless-mode), interact with it via a [friendly CLI](https://docs.all-hands.dev/modules/usage/how-to/cli-mode), -or run it on tagged issues with [a github action](https://github.com/All-Hands-AI/OpenHands/blob/main/openhands/resolver/README.md). +or run it on tagged issues with [a github action](https://docs.all-hands.dev/modules/usage/how-to/github-action). Visit [Installation](https://docs.all-hands.dev/modules/usage/installation) for more information and setup instructions. > [!CAUTION] > OpenHands is meant to be run by a single user on their local workstation. -> It is not appropriate for multi-tenant deployments, where multiple users share the same instance--there is no built-in isolation or scalability. +> It is not appropriate for multi-tenant deployments where multiple users share the same instance. There is no built-in isolation or scalability. > > If you're interested in running OpenHands in a multi-tenant environment, please > [get in touch with us](https://docs.google.com/forms/d/e/1FAIpQLSet3VbGaz8z32gW9Wm-Grl4jpt5WgMXPgJ4EDPVmCETCBpJtQ/viewform) @@ -86,7 +86,7 @@ Having issues? The [Troubleshooting Guide](https://docs.all-hands.dev/modules/us ## 📖 Documentation To learn more about the project, and for tips on using OpenHands, -**check out our [documentation](https://docs.all-hands.dev/modules/usage/getting-started)**. +check out our [documentation](https://docs.all-hands.dev/modules/usage/getting-started). There you'll find resources on how to use different LLM providers, troubleshooting resources, and advanced configuration options. diff --git a/docs/modules/usage/how-to/cli-mode.md b/docs/modules/usage/how-to/cli-mode.md index 9af87b8ebd8d..fb256dfb420e 100644 --- a/docs/modules/usage/how-to/cli-mode.md +++ b/docs/modules/usage/how-to/cli-mode.md @@ -6,10 +6,9 @@ This mode is different from the [headless mode](headless-mode), which is non-int ## With Python -To start an interactive OpenHands session via the command line, follow these steps: +To start an interactive OpenHands session via the command line: 1. Ensure you have followed the [Development setup instructions](https://github.com/All-Hands-AI/OpenHands/blob/main/Development.md). - 2. Run the following command: ```bash @@ -21,31 +20,17 @@ This command will start an interactive session where you can input tasks and rec You'll need to be sure to set your model, API key, and other settings via environment variables [or the `config.toml` file](https://github.com/All-Hands-AI/OpenHands/blob/main/config.template.toml). - ## With Docker -To run OpenHands in CLI mode with Docker, follow these steps: +To run OpenHands in CLI mode with Docker: -1. Set `WORKSPACE_BASE` to the directory you want OpenHands to edit: +1. Set the following environmental variables in your terminal: -```bash -WORKSPACE_BASE=$(pwd)/workspace -``` - -2. Set `LLM_MODEL` to the model you want to use: - -```bash -LLM_MODEL="anthropic/claude-3-5-sonnet-20241022" - -``` - -3. Set `LLM_API_KEY` to your API key: - -```bash -LLM_API_KEY="sk_test_12345" -``` +* `WORKSPACE_BASE` to the directory you want OpenHands to edit (Ex: `export WORKSPACE_BASE=$(pwd)/workspace`). +* `LLM_MODEL` to the model to use (Ex: `export LLM_MODEL="anthropic/claude-3-5-sonnet-20241022"`). +* `LLM_API_KEY` to the API key (Ex: `export LLM_API_KEY="sk_test_12345"`). -4. Run the following Docker command: +2. Run the following Docker command: ```bash docker run -it \ diff --git a/docs/modules/usage/how-to/headless-mode.md b/docs/modules/usage/how-to/headless-mode.md index c4aaa31b6e63..1efc994b3913 100644 --- a/docs/modules/usage/how-to/headless-mode.md +++ b/docs/modules/usage/how-to/headless-mode.md @@ -7,10 +7,9 @@ This is different from [CLI Mode](cli-mode), which is interactive, and better fo ## With Python -To run OpenHands in headless mode with Python, -[follow the Development setup instructions](https://github.com/All-Hands-AI/OpenHands/blob/main/Development.md), -and then run: - +To run OpenHands in headless mode with Python: +1. Ensure you have followed the [Development setup instructions](https://github.com/All-Hands-AI/OpenHands/blob/main/Development.md). +2. Run the following command: ```bash poetry run python -m openhands.core.main -t "write a bash script that prints hi" ``` @@ -20,26 +19,15 @@ You'll need to be sure to set your model, API key, and other settings via enviro ## With Docker -1. Set `WORKSPACE_BASE` to the directory you want OpenHands to edit: - -```bash -WORKSPACE_BASE=$(pwd)/workspace -``` - -2. Set `LLM_MODEL` to the model you want to use: +To run OpenHands in Headless mode with Docker: -```bash -LLM_MODEL="anthropic/claude-3-5-sonnet-20241022" +1. Set the following environmental variables in your terminal: -``` +* `WORKSPACE_BASE` to the directory you want OpenHands to edit (Ex: `export WORKSPACE_BASE=$(pwd)/workspace`). +* `LLM_MODEL` to the model to use (Ex: `export LLM_MODEL="anthropic/claude-3-5-sonnet-20241022"`). +* `LLM_API_KEY` to the API key (Ex: `export LLM_API_KEY="sk_test_12345"`). -3. Set `LLM_API_KEY` to your API key: - -```bash -LLM_API_KEY="sk_test_12345" -``` - -4. Run the following Docker command: +2. Run the following Docker command: ```bash docker run -it \ @@ -58,3 +46,11 @@ docker run -it \ docker.all-hands.dev/all-hands-ai/openhands:0.18 \ python -m openhands.core.main -t "write a bash script that prints hi" ``` + +## Advanced Headless Configurations + +To view all available configuration options for headless mode, run the Python command with the `--help` flag. + +### Additional Logs + +For the headless mode to log all the agent actions, in your terminal run: `export LOG_ALL_EVENTS=true` diff --git a/docs/modules/usage/installation.mdx b/docs/modules/usage/installation.mdx index c2a250b4cf5f..9dd2790d9b4b 100644 --- a/docs/modules/usage/installation.mdx +++ b/docs/modules/usage/installation.mdx @@ -24,7 +24,12 @@ docker run -it --rm --pull=always \ docker.all-hands.dev/all-hands-ai/openhands:0.18 ``` -You can also run OpenHands in a scriptable [headless mode](https://docs.all-hands.dev/modules/usage/how-to/headless-mode), as an [interactive CLI](https://docs.all-hands.dev/modules/usage/how-to/cli-mode), or using the [OpenHands GitHub Action](https://docs.all-hands.dev/modules/usage/how-to/github-action). +You'll find OpenHands running at http://localhost:3000! + +You can also [connect OpenHands to your local filesystem](https://docs.all-hands.dev/modules/usage/runtimes#connecting-to-your-filesystem), +run OpenHands in a scriptable [headless mode](https://docs.all-hands.dev/modules/usage/how-to/headless-mode), +interact with it via a [friendly CLI](https://docs.all-hands.dev/modules/usage/how-to/cli-mode), +or run it on tagged issues with [a github action](https://docs.all-hands.dev/modules/usage/how-to/github-action). ## Setup