herdr-client
Sync and async Python clients for the herdr Unix socket API. The package implements the canonical newline-delimited JSON protocol with no runtime dependencies.
Documentation
Read the complete documentation at https://mariotaddeucci.github.io/herdr-client/.
It includes installation, configuration, Sync and Async examples, subscriptions, typed results, raw requests, errors and the generated API reference.
Installation
python -m pip install herdr-client
Or with uv:
uv add herdr-client
Requirements:
- Python 3.13 or newer.
- A running Herdr instance with an accessible Unix socket.
Quick example
Synchronous:
from herdr_client import HerdrClient
client = HerdrClient()
print(client.ping())
print(client.workspace_list())
Asynchronous:
import asyncio
from herdr_client import AsyncHerdrClient
async def main() -> None:
client = AsyncHerdrClient()
print(await client.ping())
print(await client.workspace_list())
asyncio.run(main())
The package name is herdr-client; the import package is herdr_client.
Public API
Both clients expose the same operation names:
request(method, params)ping()workspace_list()tab_list(workspace_id=None)pane_list(workspace_id=None)pane_send_text(pane_id, text)pane_send_keys(pane_id, keys)pane_send_input(pane_id, text="", keys=None)pane_read(pane_id, source="recent", lines=80, strip_ansi=True, format=None)pane_wait_for_output(...)subscribe(subscriptions)
Return values are ordinary dictionaries with schema-derived TypedDict types. The
package includes py.typed for static type checkers.
Socket resolution
Without an explicit socket_path, clients use this order:
session="name"in the constructor.HERDR_SOCKET_PATH.HERDR_SESSION=name.$HOME/.config/herdr/herdr.sock.
Named sessions use $HOME/.config/herdr/sessions/<name>/herdr.sock.
from pathlib import Path
from herdr_client import AsyncHerdrClient, HerdrClient
sync_client = HerdrClient(socket_path=Path("/run/user/1000/herdr.sock"))
async_client = AsyncHerdrClient(session="docs")
Protocol coverage
The registry follows protocol 22 and contains 103 canonical JSON methods. Ten methods
have convenience wrappers: ping, workspace_list, tab_list, pane_list,
pane_send_text, pane_send_keys, pane_send_input, pane_read,
pane_wait_for_output and subscribe.
The remaining canonical methods have named stubs that raise NotImplementedError. Use
request() for a canonical method without a convenience wrapper. The hybrid
pane.graphics.stream transport is not implemented.
Development
git clone https://github.com/mariotaddeucci/herdr-client.git
cd herdr-client
uv sync --all-groups
uv run pytest
uv run ruff check .
uv run ruff format --check .
uv run pyrefly check
uv run mkdocs build --strict
The default test command requires at least 90 percent coverage. Live integration tests are opt-in and require an explicitly configured Herdr socket.
Publishing
Package releases are published when a GitHub release is created after PyPI Trusted Publishing is configured. The release tag must match the version detected from Git:
gh release create v0.1.0 --target main --generate-notes
Documentation deploys to GitHub Pages from main.
License
Apache License 2.0.
Metadata
Release files for herdr-client 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| herdr_client-0.1.0.tar.gz | 34.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| herdr_client-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 77.9 kB
Release files / herdr_client-0.1.0.tar.gz
| Download URL | herdr_client-0.1.0.tar.gz |
|---|---|
| Size | 34.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1da581ddf61c75353a35070aa6c3b489bc7dbfada6c7ddd386fec4cbca72c381
|
|
BLAKE2b-256 checksum How to use checksums |
0054da17038793afae3b25412a4fbcb2eb6075f3735e9b5d1f33810817f9ba8c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 20, 2026.
Transparency logRelease files / herdr_client-0.1.0-py3-none-any.whl
| Download URL | herdr_client-0.1.0-py3-none-any.whl |
|---|---|
| Size | 43.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
32c6e78a2ea6ec31ddaedad655df9838e6c06aea1314164eeb69f1383249ea65
|
|
BLAKE2b-256 checksum How to use checksums |
27f78715aa90c670b327dcd7ae5aca770b94c8fa05422bc6d396165dc8c4479a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 20, 2026.
Transparency log