Run major agents and harnesses programmatically, in a sandbox. Openclaw, Claude Code, Hermes agent,...
Project description
harnesdk
Run major agents and harnesses programmatically, in a sandbox. Openclaw, Claude Code, Hermes agent,...
- GitHub | PyPI | Documentation
- Created by Alaeddine Abdessalem | PyPI @alaeddineabdessalem
- MIT License
Installation
pip install harnesdk
Setup
Set the required environment variables:
export ANTHROPIC_API_KEY=your_anthropic_api_key
export E2B_API_KEY=your_e2b_api_key
Usage
Run an agent and get output
import asyncio
from harnesdk.agent import AgentSession
async with AgentSession() as session:
result = await session.run("Create a hello world HTTP server in Go")
print(result.output)
Stream output in real time
import asyncio
from harnesdk.agent import AgentSession
async with AgentSession() as session:
async for chunk in session.stream("Create a hello world HTTP server in Go"):
print(chunk, end="", flush=True)
Run and serve an app from the sandbox (Jupyter)
from harnesdk.agent import AgentSession
from IPython.display import IFrame
async with AgentSession() as session:
async for chunk in session.stream(
"build an 'introducing HarneSDK' html page, and serve it with python http server under port 8000. "
"Use this pattern nohup your-server-command > /tmp/server.log 2>&1 < /dev/null &"
):
print(chunk)
page_url = session.sandbox.get_host(8000)
print(f"app live at {page_url}")
display(IFrame(f"https://{page_url}", width=700, height=400))
Output:
I'll create an introductory HTML page for HarneSDK and serve it using Python's HTTP server on port 8000.
The server is now running at **http://localhost:8000**
app live at 8000-7zerfgtyjcjpl79a141ez.e2b.app
Generated app:
Development
To set up for local development:
# Clone your fork
git clone git@github.com:your_username/harnesdk.git
cd harnesdk
# Install in editable mode with live updates
uv tool install --editable .
This installs the CLI globally but with live updates - any changes you make to the source code are immediately available when you run harnesdk.
Author
harnesdk was created in 2026 by Alaeddine Abdessalem.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file harnesdk-0.2.0.tar.gz.
File metadata
- Download URL: harnesdk-0.2.0.tar.gz
- Upload date:
- Size: 160.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"20.04","id":"focal","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2214436a67ef90d9e22c672affa018668407a91c56b09fa10ba8024013402556
|
|
| MD5 |
58e7f0f62c57ca3a2c1feb7f42cbbd02
|
|
| BLAKE2b-256 |
21431b0f0e197e3c4d24f12023df2c7f324cf111f5ead308dce77db541795ca1
|
File details
Details for the file harnesdk-0.2.0-py3-none-any.whl.
File metadata
- Download URL: harnesdk-0.2.0-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"20.04","id":"focal","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b2664dd0a4e4be242b204981553c7242b22350a45d8cff475081ccfebf370390
|
|
| MD5 |
1aa6bc981a6da5c51ad6485354d29914
|
|
| BLAKE2b-256 |
36bc612ad79753fc5f6930994742c6a0bef32efdf30f6ea53612213d13f1b991
|