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

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.3.3
File Size Uploaded Provenance Actions
optio_host-0.3.3.tar.gz 44.1 kB Without provenance Details for optio_host-0.3.3.tar.gz

Built distribution (wheel)

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

Total release size: 71.7 kB

Release files / optio_host-0.3.3.tar.gz

Download URL optio_host-0.3.3.tar.gz
Size 44.1 kB
Tags Source
SHA-256 checksum
How to use checksums
5c3bb7b3bced5573ebd530db7890f3760db4edf786e8fb294604c0dbb82901c1
BLAKE2b-256 checksum
How to use checksums
c77350b2c1318a6d881d655ac1fec3fac56f0ba7fcbbd99ba589236619db8ab3
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.3-py3-none-any.whl

Download URL optio_host-0.3.3-py3-none-any.whl
Size 27.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e16d9c232693998bdbd6a176af858713f3b2e5f0fd4dc14eba56af86fee3f5b8
BLAKE2b-256 checksum
How to use checksums
5a72b129bc5b754476e23f7d00996f9b5c59233b4b1e0ed32dad17519b2dff4d
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.3.3

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