Skip to content

Latest commit

 

History

History
93 lines (67 loc) · 3.64 KB

README.md

File metadata and controls

93 lines (67 loc) · 3.64 KB

reaterm — Read-only terminal access from Python

MIT license

PyPI total downloads npm total downloads

Give your Python app eyes into a project—not a writable shell.

ReaTerm brings a focused, read-only command interface to Python. Its native Rust engine implements a short inspection allowlist instead of forwarding arbitrary strings to a shell. Choose a filesystem root, read the information you need, and keep writes out of the native execution path.

Why use ReaTerm?

  • One line to inspect: reaterm.run("ls -al").
  • Everything needed for a quick look: directory listings, file contents, literal text searches, and metadata.
  • AI-ready tool integrations: OpenAI, Anthropic, and a local stdio Model Context Protocol (MCP) server.
  • Security by design: fixed commands, bounded reads, scoped paths, and OS-backed restrictions.

A small API that gets to the point

import reaterm

print(reaterm.run("ls -al"))
print(reaterm.run('cat "README.md"'))

For precise argv and a reusable root:

from reaterm import ReaTerm

terminal = ReaTerm(root=".")
print(terminal.run("grep", "-n", "TODO", "README.md"))

Give AI assistants a read-only tool

from reaterm.tools.openai import reaterm_tool_openai
from reaterm.tools.anthropic import reaterm_tool_anthropic

# OpenAI: tools=[reaterm_tool_openai]
# Anthropic: tools=[reaterm_tool_anthropic]

Your application executes returned tool calls explicitly and sends results back. Tool schemas alone never run commands, and returning file content to a provider can disclose information in the selected root.

Connect an MCP client

reaterm-mcp --root /absolute/path/to/project

Compatible MCP clients can invoke the run_command tool using a read-only command name and exact argv tokens. The server exposes no shell or arbitrary executable access; the root is selected when the server starts, not by the model. The optional MCP SDK is installed separately from the base package.

Explore the tool integrations

Requires Python 3.11+ and a separately installed native Rust CLI. Supported: Linux x86-64/ARM64, macOS Intel/Apple Silicon, and Windows x86-64. Published PyPI availability has not been verified. The native restrictions apply to ReaTerm itself, not a parent shell.

Website · See the security model

Security and installation notes

This is an unaudited prototype, not a production data-loss-prevention boundary. The native executable is installed separately from the Python adapter and must be discoverable on PATH or via REATERM_BIN. See source installation.

ReaTerm denies common secret filenames by default, but does not scan file contents or redact arbitrary credentials. Output remains untrusted model input; it may contain prompt injection. The wrapper defaults to a 15-second native subprocess wall timeout, whereas Unix native execution has a 10-second CPU budget; standalone native I/O can still block. Linux requires Landlock ABI v3 (approximately kernel 6.2+). See the threat model before exposing a directory to an agent.