Skip to main content

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

  • Host Protocol + 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 behind asyncssh.
  • RunResult / HostCommandError — the result and error types produced by Host.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.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for optio-host 0.4.1
File Size Uploaded Provenance Actions
optio_host-0.4.1.tar.gz 63.2 kB Without provenance Details for optio_host-0.4.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for optio-host 0.4.1
File Interpreter ABI Platform Actions
optio_host-0.4.1-py3-none-any.whl Python 3 none any Details for optio_host-0.4.1-py3-none-any.whl

Total release size: 99.8 kB

Release files / optio_host-0.4.1.tar.gz

Download URL optio_host-0.4.1.tar.gz
Size 63.2 kB
Tags Source
SHA-256 checksum
How to use checksums
44e9da70ae659b7f56fbb700c29ae4ba57267fe9a951a0264387d433729e5f90
BLAKE2b-256 checksum
How to use checksums
8f5deff17b224f9acf2ec1933cea2b42e00af7fb4d882952655123d5c4debc44
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.4.1-py3-none-any.whl

Download URL optio_host-0.4.1-py3-none-any.whl
Size 36.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3113a0848bc9ab082a3570c3d3dff33d0735f454f9db52622ac130c2d8670bf1
BLAKE2b-256 checksum
How to use checksums
0a0e268910d0245e101eacbbff8a5cf2e71e0162c239deae7207dde7a0b19aca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Security for optio-host 0.4.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page