A headless universal REPL driver for LLMs. Supports PTY, TUI apps, and Tab completion.
Project description
REPL Bridge
REPL Bridge is a Python library that turns any CLI tool (Bash, Python, Julia, SSH, Vim) into a programmatic object controllable by code or LLMs.
It uses node-pty style process forking combined with a headless VT100 emulator (pyte) to maintain perfect state of the visual terminal, allowing for robust interaction with TUI applications and complex shells.
Features
- Universal: Works with any binary (Python, Node, Bash, top, vim).
- Stateful: Maintains a 2D grid of the screen (supports colors, cursor position).
- Smart Waiting: Detects when commands finish via Silence Detection, Regex, or Kernel Introspection.
- Tab Completion: Includes a cursor-differential engine to solve inline vs grid completion ambiguity.
- TUI Support: Handles
htop,fzf, andtmuxrendering correctly.
Installation
pip install .
Quick Start
from brepl import REPLSession
# Start a session
session = REPLSession("bash")
# Run a command (atomic execution)
result = session.execute("ls -la")
print(result.output)
# Interactive / TUI mode
session.send_text("top", enter=True)
session.wait(timeout=1.0)
print(session.screen.render()) # Prints the top table
session.send_key("q")
License
MIT License - see LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file brepl-0.1.0.tar.gz.
File metadata
- Download URL: brepl-0.1.0.tar.gz
- Upload date:
- Size: 13.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e0fee80cb8dc35e41c3b5a3758f03200f237a2762621dd15a915bfe102d18759
|
|
| MD5 |
357f50245858755206f5023b62b6755e
|
|
| BLAKE2b-256 |
c3436a2612270a847e9c28d290157e3db95006c7b85144e9c5eedfcbaa28e913
|
File details
Details for the file brepl-0.1.0-py3-none-any.whl.
File metadata
- Download URL: brepl-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0613027b42b7abbca91e188e1377dae95ca211c34b82dafb45a9a710794d772b
|
|
| MD5 |
18d2367647e042fcbe61fc1cee78dcdc
|
|
| BLAKE2b-256 |
7cb75bce9d91d79c7dfde63c39430aa561336479c088c24c1b38fe2195c83f26
|