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.
Metadata
Release files for brepl 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| brepl-0.1.0.tar.gz | 13.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| brepl-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 28.0 kB
Release files / brepl-0.1.0.tar.gz
| Download URL | brepl-0.1.0.tar.gz |
|---|---|
| Size | 13.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e0fee80cb8dc35e41c3b5a3758f03200f237a2762621dd15a915bfe102d18759
|
|
BLAKE2b-256 checksum How to use checksums |
c3436a2612270a847e9c28d290157e3db95006c7b85144e9c5eedfcbaa28e913
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.12
|
Release files / brepl-0.1.0-py3-none-any.whl
| Download URL | brepl-0.1.0-py3-none-any.whl |
|---|---|
| Size | 14.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0613027b42b7abbca91e188e1377dae95ca211c34b82dafb45a9a710794d772b
|
|
BLAKE2b-256 checksum How to use checksums |
7cb75bce9d91d79c7dfde63c39430aa561336479c088c24c1b38fe2195c83f26
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.12
|