optio-host
Local-or-remote host abstraction for optio task types. The agent-coordination protocol that used to live here now lives in optio-agents.
optio-host lets a task author run shell commands, manage workdirs, and stream files without caring whether the work happens locally or on a remote host over SSH.
What's in the box
HostProtocol +LocalHost/RemoteHost/make_host()— uniform interface for running commands, opening port forwards, transferring files, and tearing down workdirs. SSH details (auth, multiplexing, channel cleanup) are hidden behindasyncssh.RunResult/HostCommandError— the result and error types produced byHost.run_command.create_download_task(...)— a ready-made optio task that downloads a file from a remote host with progress reporting and integrity checks.- For the log/deliverables coordination protocol, the keyword parser, and HookContext, see optio-agents.
When to use it
You're building an optio task type that needs to run work on a host — local or remote — and you want:
- one abstraction that works in both modes,
- a structured way for the running process to talk back to optio (progress + deliverables) — see optio-agents,
- SSH transport handled for you.
If you're writing the end-user task type directly (not consuming this library from another optio task package), you probably want optio-core instead.
Installation
pip install optio-host
optio-host depends on optio-core and asyncssh. Python 3.11+.
Minimal example
from optio_host import make_host, SSHConfig
# Local
async with make_host(ssh=None) as host:
result = await host.run(["uname", "-a"])
print(result.stdout)
# Remote
ssh = SSHConfig(host="worker-1", user="optio", key_path="~/.ssh/id_optio")
async with make_host(ssh=ssh) as host:
result = await host.run(["uname", "-a"])
print(result.stdout)
License
Apache-2.0.
Metadata
Release files for optio-host 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| optio_host-0.3.1.tar.gz | 40.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| optio_host-0.3.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 67.9 kB
Release files / optio_host-0.3.1.tar.gz
| Download URL | optio_host-0.3.1.tar.gz |
|---|---|
| Size | 40.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e96d51b4d025d7b98b298349f902a11a2e93d2ee8e19a7a6455a13f8f4799018
|
|
BLAKE2b-256 checksum How to use checksums |
06d5230ba060661260ca84d43cd3df1f43fd1944aca52f5de76588abe26041c6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.5
|
Release files / optio_host-0.3.1-py3-none-any.whl
| Download URL | optio_host-0.3.1-py3-none-any.whl |
|---|---|
| Size | 27.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
36921e9e778e7027b08599dc1d7d7575f79586c936c8410e8eb70dc6d00053ff
|
|
BLAKE2b-256 checksum How to use checksums |
9bb4f55c12e17648850c4e2120cbb560484db925e50965e4ab736a1acb8f0454
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.5
|