Metadata-Version: 2.4
Name: reaterm
Version: 0.0.2
Summary: Python wrapper for the ReaTerm read-only native CLI
Author: Pro-GenAI
License: MIT
Project-URL: Homepage, https://reaterm.pro-genai.com/
Project-URL: Documentation, https://reaterm.pro-genai.com/#get-started
Project-URL: Repository, https://github.com/Pro-GenAI/ReaTerm
Project-URL: Issues, https://github.com/Pro-GenAI/ReaTerm/issues
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Provides-Extra: decision
Requires-Dist: openai>=1.0.0; extra == "decision"
Provides-Extra: mcp
Requires-Dist: mcp<3,>=2.0; extra == "mcp"
Provides-Extra: mcp-test
Requires-Dist: mcp<3,>=2.0; extra == "mcp-test"
Requires-Dist: pytest<10,>=8; extra == "mcp-test"
Requires-Dist: pytest-mcptest==0.1.1; extra == "mcp-test"

# reaterm — Read-only terminal access from Python

[![MIT license](https://img.shields.io/github/license/Pro-GenAI/ReaTerm?label=license)](../../LICENSE)

<a href="https://pepy.tech/projects/reaterm"><img src="https://static.pepy.tech/personalized-badge/reaterm?period=total&amp;units=NONE&amp;left_color=BLACK&amp;right_color=GREEN&amp;left_text=PyPI%20Downloads" alt="PyPI total downloads" height="28"></a>
<a href="https://www.npmjs.com/package/reaterm"><img src="https://shieldcn.dev/npm/dt/reaterm.svg?label=npm%20downloads" alt="npm total downloads" height="28"></a>

**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

~~~python
import reaterm

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

For precise argv and a reusable root:

~~~python
from reaterm import ReaTerm

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

## Give AI assistants a read-only tool

~~~python
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

~~~sh
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](../../docs/TOOL_INTEGRATIONS.md)

**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](https://reaterm.pro-genai.com/) ·
[See the security model](../../docs/THREAT_MODEL.md)


## 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](../../docs/DEVELOPMENT.md).

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](../../docs/THREAT_MODEL.md) before exposing a directory to an agent.
