Skip to content

Helvesec/rmux-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

librmux

librmux is the Python SDK for RMUX. Its public handles follow the same vocabulary as the Rust SDK: RMUX, Session, Window, and Pane.

Examples available

Installation

python -m pip install librmux

librmux targets RMUX 0.6.0 and uses the rmux executable. Install the RMUX binary separately and keep it on PATH, or pass a specific binary with RMUX.builder().binary(...).

from librmux import RMUX

rmux = RMUX()
for session in rmux.list_sessions():
    print(session["session_name"])

Rmux and Server remain available as aliases for existing code.

Endpoint Selection

RMUX()                         # default rmux endpoint
RMUX(socket_path="/tmp/rmux")   # passes -S /tmp/rmux
RMUX(socket_name="demo")        # passes -L demo
RMUX.builder().socket_name("demo").connect_or_start()

Common Operations

session = rmux.ensure_session("demo")
pane = session.pane(0, 0)
pane.send_text("echo hello\n")
pane.expect_visible_text().to_contain("hello").timeout(5)
text = pane.capture_text()

For raw commands:

run = rmux.cmd("rename-window", "-t", "demo:0", "logs")
if run.returncode != 0:
    raise RuntimeError(run.stderr)

About

Python SDK for RMUX, the universal terminal multiplexer.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages