Local-or-remote host abstraction for optio task types (run commands local or remote, transfer files, tunnels).
Project description
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.
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 optio_host-0.2.5.tar.gz.
File metadata
- Download URL: optio_host-0.2.5.tar.gz
- Upload date:
- Size: 28.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db6b9fba39402be6895bf6dd34b498bce45e486629e3667d457100c6d50d0aad
|
|
| MD5 |
ba0addae5fc513e2056db8ae5f26fe24
|
|
| BLAKE2b-256 |
ad1add183b8bb2438a6c950bcc14afb587ae0a8262a60ab46859e6e2ff6c578e
|
File details
Details for the file optio_host-0.2.5-py3-none-any.whl.
File metadata
- Download URL: optio_host-0.2.5-py3-none-any.whl
- Upload date:
- Size: 20.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e2dd4e962772cf09d8dad0d1f94f7ce07aa9cea130659961c0026a81f62381a1
|
|
| MD5 |
26d92b96cd8c539de2750286642301ab
|
|
| BLAKE2b-256 |
d0005ee4d09297349599e5543ea79d33b731ee806cc7fd50e52fcee39d3d3d0c
|