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.
- 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.
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"))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.
reaterm-mcp --root /absolute/path/to/projectCompatible 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.
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
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.