Skip to main content

ruos

Ultra-lite Python client for ruOS: your cloud desktops, ruOS Lite browsers, and the hosted ruOS MCP tools, from Python.

The library is a single compiled Rust extension (PyO3, abi3 wheels for Python 3.8+). It has no Python dependencies, uses rustls (no OpenSSL), and releases the GIL during every network call.

pip install ruos

Sign in

The Python package has no login flow of its own. Use one of these:

  1. npx ruos login, which stores tokens in ~/.config/ruos/credentials.json (mode 0600; $RUOS_CONFIG_DIR or $XDG_CONFIG_HOME/ruos if set). The Python client reads the same file and refreshes the access token automatically. On refresh it writes the file back in the format npx ruos expects (version: 1, expires_at in epoch milliseconds, all other fields kept), so one login covers both tools.
  2. Set RUOS_TOKEN to an access token or a tenant API token (ruos_mcp_…, minted in the dashboard).
  3. Pass Client(token="...").

Precedence is token=, then RUOS_TOKEN, then the credentials file. Only file-based credentials are refreshed.

Use

import ruos

c = ruos.Client()

c.whoami()          # {"tier": "pro", "token_source": "credentials_file", "plan": {...}, ...}
c.desktops()        # [{"machine_id": "...", "name": "dev", "state": "started", ...}, ...]
c.lite()            # saved ruOS Lite browsers ([] if none)

c.start("dev")      # by machine id, Fly id, name or display name; or "lite"
c.stop("dev")

c.tools()           # hosted MCP tools/list
c.call("desktop_status")                       # hosted MCP tools/call
c.call("desktop_exec", machine_id="...", command="uname -a")

png_or_jpeg = c.screenshot()                   # machine="lite" by default
open("screen.jpg", "wb").write(png_or_jpeg)

c.act("lite", "click", x=640, y=360)
c.act("lite", "type", text="hello")
c.act("lite", "key", keys="ctrl+l")

print(ruos.__version__)

act takes these actions: mouse_move, click, double_click, drag, scroll, type, key, cursor_position, screen_size. Its keyword arguments are x, y, to_x, to_y, button, direction, amount, text and keys. Anything else raises ValueError before a request is sent.

Options

ruos.Client(
    token=None,              # explicit bearer
    base_url=None,           # default: $RUOS_BASE_URL or https://ruos.cognitum.one
    credentials_path=None,   # default: ~/.config/ruos/credentials.json
    timeout=None,            # seconds, default 60
)

Errors

Every API error is a ruos.RuosError:

Exception When
ruos.AuthError no credentials, HTTP 401/403, or a failed token refresh
ruos.NotFound HTTP 404, or no desktop matches the name you gave
ruos.RateLimited HTTP 429; retry_after holds the server's hint in seconds
ruos.RuosError anything else (5xx, transport, MCP tool errors)

Invalid arguments raise ValueError or TypeError. Tokens never appear in exception messages or repr(Client).

Notes

  • whoami() reports the tenant's plan and where the token came from. ruOS does not yet have a route that returns your identity.
  • The hosted MCP endpoint (/mcp) is stateless Streamable HTTP. The client sends each JSON-RPC request on its own and accepts both SSE and JSON replies.
  • Source: packages/ruos-py. Design: ADR-100.

License: MIT OR Apache-2.0.

Metadata

Release files for ruos 0.1.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 ruos 0.1.0
File Size Uploaded
ruos-0.1.0.tar.gz 32.8 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for ruos 0.1.0
File
ruos-0.1.0-cp38-abi3-win_amd64.whl CPython 3.8 abi3 Windows x86-64 Details
ruos-0.1.0-cp38-abi3-manylinux_2_28_aarch64.whl CPython 3.8 abi3 Linux glibc 2.28+ ARM64 Details
ruos-0.1.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.8 abi3 Linux glibc 2.17+ x86-64 Details
ruos-0.1.0-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl CPython 3.8 abi3 macOS 10.12+ universal2 (ARM64, x86-64), macOS 11.0+ ARM64, macOS 10.12+ x86-64 Details

Total release size: 5.0 MB

Release files / ruos-0.1.0.tar.gz

Download URL ruos-0.1.0.tar.gz
Size 32.8 kB
Tags Source
SHA-256 checksum
How to use checksums
a731211adecf94c012dad2ffe6df104a001bfddbd586cd287507b1970f00d1f2
BLAKE2b-256 checksum
How to use checksums
54bd921a471017161577ac93b94cc677b8b531cf6a7e929d0e627e2ba75c829d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / ruos-0.1.0-cp38-abi3-win_amd64.whl

Download URL ruos-0.1.0-cp38-abi3-win_amd64.whl
Size 958.1 kB
Tags CPython 3.8 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
8bc9fcdf6c5799720d43569df8df757a33f10e161b49cb05089fb37030ed0c3e
BLAKE2b-256 checksum
How to use checksums
50d759b9d331c9788e91556f7bdea89ff3548d6998c1fdd2ea09edfec5413635
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / ruos-0.1.0-cp38-abi3-manylinux_2_28_aarch64.whl

Download URL ruos-0.1.0-cp38-abi3-manylinux_2_28_aarch64.whl
Size 1.0 MB
Tags CPython 3.8 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
e3398977b07c23d140e2596559279a2d1fe222c46b03343b46e7182a59c7a729
BLAKE2b-256 checksum
How to use checksums
0ba0b4ea70ddc99f5165749a8e413581f3fd1af476215578e823c9fa732f95e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / ruos-0.1.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL ruos-0.1.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.0 MB
Tags CPython 3.8 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
20b026649854842798837466826eca71ebf46dd4876470b711b096dc07b25d85
BLAKE2b-256 checksum
How to use checksums
9f7bc3f8e9e63d7cb687539b85a398c57a3e3b8728cf3a2f69f9d01d84f52415
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / ruos-0.1.0-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl

Download URL ruos-0.1.0-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Size 1.9 MB
Tags CPython 3.8 abi3 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
1435041874e0680331ef9b02a457ea6b5cebb4739dfaa25344943a5ae57b777c
BLAKE2b-256 checksum
How to use checksums
4045ba3a0f6877e1e6bdb8d3563a0ae6de2a74d26016c87e4ecd0be6765cd679
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

0.2.0

5 release files

This release

0.1.0 This release

5 release files

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