Skip to content

πŸ™Œ OpenHands: AI-Driven Development

Update CLI docs (#9074)

mamoodi848f69203366
diff --git a/docs/usage/how-to/cli-mode.mdx b/docs/usage/how-to/cli-mode.mdx
index 6bca68b042..1ca1a25933 100644
--- a/docs/usage/how-to/cli-mode.mdx
+++ b/docs/usage/how-to/cli-mode.mdx
@@ -14,34 +14,34 @@ for scripting.
**Note** - OpenHands requires Python version 3.12 or higher (Python 3.14 is not currently supported)
1. Install OpenHands using pip:
-
```bash
pip install openhands-ai
```
- Or if you prefer not to manage your own Python environment, you can use `uvx`:
+ Or if you prefer not to manage your own Python environment, you can use `uvx`:
```bash
uvx --python 3.12 --from openhands-ai openhands
```
2. Launch an interactive OpenHands conversation from the command line:
-
```bash
openhands
```
-3. Set your model, API key, and other preferences using the UI (or alternatively environment variables, below).
+<Note>
+ If you have cloned the repository, you can also run the CLI directly using Poetry:
-This command opens an interactive prompt where you can type tasks or commands and get responses from OpenHands.
+ poetry run python -m openhands.cli.main
+</Note>
-#### For Developers
+3. Set your model, API key, and other preferences using the UI (or alternatively environment variables, below).
-If you have cloned the repository, you can run the CLI directly using Poetry:
+This command opens an interactive prompt where you can type tasks or commands and get responses from OpenHands.
+The first time you run the CLI, it will take you through configuring the required LLM
+settings. These will be saved for future sessions.
-```bash
-poetry run python -m openhands.cli.main
-```
+The conversation history will be saved in `~/.openhands/sessions`.
### Running with Docker
@@ -68,12 +68,17 @@ docker run -it \
python -m openhands.cli.main --override-cli-mode true
```
-> **Note**: If you used OpenHands before version 0.44, you may want to run `mv ~/.openhands-state ~/.openhands` to migrate your conversation history to the new location.
+<Note>
+ If you used OpenHands before version 0.44, you may want to run `mv ~/.openhands-state ~/.openhands` to migrate your
+ conversation history to the new location.
+</Note>
-This launches the CLI in Docker, allowing you to interact with OpenHands as described above.
+This launches the CLI in Docker, allowing you to interact with OpenHands.
The `-e SANDBOX_USER_ID=$(id -u)` ensures files created by the agent in your workspace have the correct permissions.
+The conversation history will be saved in `~/.openhands/sessions`.
+
## Interactive CLI Overview
### What is CLI Mode?