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

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.4
File Size Uploaded Provenance Actions
optio_host-0.3.4.tar.gz 44.0 kB Without provenance Details for optio_host-0.3.4.tar.gz

Built distribution (wheel)

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

Total release size: 71.7 kB

Release files / optio_host-0.3.4.tar.gz

Download URL optio_host-0.3.4.tar.gz
Size 44.0 kB
Tags Source
SHA-256 checksum
How to use checksums
f4758bbbc8147d48ebc0f425bfdaa474ed019e6de97cad17a787145a53d021f3
BLAKE2b-256 checksum
How to use checksums
95f774b218e77f9f7ac5edb6c355eb0b555991d8533cc1622b9621c79e5718e8
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.4-py3-none-any.whl

Download URL optio_host-0.3.4-py3-none-any.whl
Size 27.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
55ce16ffec23846c40ce177a0408cd3e377c43e2ce36d75c7336d0257fb8aed9
BLAKE2b-256 checksum
How to use checksums
f56df78b2e6babf7b60f887f90cab33c3df77574ab670fb9f8f75c5b4092474a
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.4

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