Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor README update, Headless and CLI doc changes #5977

Merged
merged 1 commit into from
Jan 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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.
Expand Down
29 changes: 7 additions & 22 deletions docs/modules/usage/how-to/cli-mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 \
Expand Down
38 changes: 17 additions & 21 deletions docs/modules/usage/how-to/headless-mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
```
Expand All @@ -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 \
Expand All @@ -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`
7 changes: 6 additions & 1 deletion docs/modules/usage/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading