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.0

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.0
File Size Uploaded Provenance Actions
optio_host-0.4.0.tar.gz 63.4 kB Without provenance Details for optio_host-0.4.0.tar.gz

Built distribution (wheel)

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

Total release size: 100.0 kB

Release files / optio_host-0.4.0.tar.gz

Download URL optio_host-0.4.0.tar.gz
Size 63.4 kB
Tags Source
SHA-256 checksum
How to use checksums
1019d85b03b111dc64f7cbccbeff0121854d65910473dbd8100b8a9821da022c
BLAKE2b-256 checksum
How to use checksums
8139f230af6f44eee5eee0846b75f0fb89e2447acf6cbb2e30617da3a3e4d0b3
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.0-py3-none-any.whl

Download URL optio_host-0.4.0-py3-none-any.whl
Size 36.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e644cce6c459e7cae48154914233f03a208dadd0a5ff39b6ba88e49db810e89a
BLAKE2b-256 checksum
How to use checksums
8df895b45eeff28706f737a8d1d17498eb57ae3099e2bce051f57d520f12422a
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.0

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