Skip to content

Helvesec/rmux-typescript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@rmux/sdk

@rmux/sdk is the TypeScript SDK for RMUX. Its public handles follow the same vocabulary as the Rust and Python SDKs: RMUX, Session, Window, and Pane.

Examples available

npm package

Installation

npm install @rmux/sdk

@rmux/sdk targets RMUX 0.6.x and uses the rmux executable. Install the RMUX binary separately and keep it on PATH, or pass a specific binary with RMUX.builder().binary(...).

import { RMUX } from "@rmux/sdk";

const rmux = new RMUX();
for (const session of await rmux.listSessions()) {
  console.log(session.session_name);
}

Rmux and Server remain available as aliases for existing code.

Endpoint Selection

new RMUX();                               // default rmux endpoint
new RMUX({ socketPath: "/tmp/rmux" });    // passes -S /tmp/rmux
new RMUX({ socketName: "demo" });         // passes -L demo
RMUX.builder().socketName("demo").connectOrStart();

Common Operations

const session = await rmux.ensureSession("demo");
const pane = session.pane(0, 0);
await pane.sendText("echo hello\n");
await pane.expectVisibleText().toContain("hello").timeout(5);
const text = await pane.captureText();

For raw commands:

const run = await rmux.cmd("rename-window", "-t", "demo:0", "logs");
if (run.returnCode !== 0) {
  throw new Error(run.stderr);
}

About

TypeScript SDK for RMUX terminal automation.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors