A Go wrapper that translates StrawPot protocol arguments into OpenHands CLI flags. It acts as a pure translation layer — process management, sessions, and infrastructure are handled by StrawPot core.
- OpenHands CLI (
pip install openhands-ai) - An LLM API key for your chosen model provider
curl -fsSL https://raw.githubusercontent.com/strawpot/strawpot_openhands_cli/main/strawpot_openhands/install.sh | shThis downloads a pre-built binary for your platform (macOS/Linux, amd64/arm64) to /usr/local/bin. Override the install directory with INSTALL_DIR:
INSTALL_DIR=~/.local/bin curl -fsSL ... | shThe wrapper exposes two subcommands:
Runs openhands login to authenticate.
strawpot_openhands setupTranslates StrawPot protocol flags into an OpenHands CLI command and outputs it as JSON.
strawpot_openhands build \
--agent-workspace-dir /path/to/workspace \
--working-dir /path/to/project \
--task "fix the bug" \
--config '{"model":"gpt-4o"}'Output:
{
"cmd": ["openhands", "--headless", "--json", "-t", "fix the bug", "--override-with-envs"],
"cwd": "/path/to/project",
"env": {"LLM_MODEL": "gpt-4o"}
}| Flag | Required | Description |
|---|---|---|
--agent-workspace-dir |
Yes | Workspace directory for instructions and symlinks |
--working-dir |
No | Working directory for the command (cwd in output) |
--task |
No | Task prompt (passed as -t, or combined into instructions file when prompts are present) |
--config |
No | JSON config object (default: {}) |
--role-prompt |
No | Role prompt text (written to instructions.md) |
--memory-prompt |
No | Memory/context prompt (appended to instructions.md) |
--skills-dir |
No | Directory with skill subdirectories (symlinked to skills/) |
--roles-dir |
No | Directory with role subdirectories (repeatable, symlinked to roles/) |
--agent-id |
No | Agent identifier |
Pass via --config:
| Key | Type | Default | Description |
|---|---|---|---|
model |
string | (none) | Model to use (passed via LLM_MODEL env var with --override-with-envs) |
| Variable | Description |
|---|---|
LLM_API_KEY |
LLM API key for the configured model provider |
- OpenHands headless mode always runs in auto-approve mode — there is no opt-out.
- Since OpenHands CLI does not support a separate
--system-promptflag, role/memory prompts and task are combined into a singleinstructions.mdfile and passed via-f. When only a task is provided (no prompts), it is passed directly via-t. - Model selection uses the
LLM_MODELenvironment variable (returned in theenvfield of the JSON output) rather than a CLI flag.
cd openhands/wrapper
go test -v ./...Releases are built with GoReleaser and published automatically via GitHub Actions.
See LICENSE for details.