Metadata-Version: 2.4
Name: trap-cli
Version: 0.0.1
Summary: tp — non-invasive CLI testing framework for AI workflows. Submits results to trapstreet.run.
Project-URL: Homepage, https://trapstreet.run
Project-URL: Repository, https://github.com/trapstreet/trap
Project-URL: Issues, https://github.com/trapstreet/trap/issues
Author-email: "trapstreet.run" <founder@trapstreet.run>
License-Expression: MIT
License-File: LICENSE
Keywords: agent,ai,benchmark,eval,llm,trapstreet,workflow
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Testing
Requires-Python: >=3.13
Requires-Dist: gitpython>=3.1
Requires-Dist: httpx>=0.27
Requires-Dist: psutil>=7.2.2
Requires-Dist: py-cpuinfo>=9.0.0
Requires-Dist: pydantic>=2.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: rich>=13.0
Requires-Dist: tokencost>=0.1.26
Requires-Dist: typer>=0.12
Description-Content-Type: text/markdown

# trap

[![CI](https://github.com/trapstreet/trap/actions/workflows/ci.yml/badge.svg)](https://github.com/trapstreet/trap/actions/workflows/ci.yml)
[![PyPI](https://img.shields.io/pypi/v/trap-cli)](https://pypi.org/project/trap-cli/)
[![Python](https://img.shields.io/pypi/pyversions/trap-cli)](https://pypi.org/project/trap-cli/)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)

**Non-invasive CLI testing framework for AI prompts, agents, and workflows.**

trap treats any solution as a black box — it invokes it as a subprocess, captures outputs, then optionally scores them through a language-agnostic judge and grader. The solution doesn't need to import trap or know it exists.

## Install

```bash
# requires uv — https://docs.astral.sh/uv/getting-started/installation/

# from PyPI
uv tool install trap-cli

# from git (latest main)
uv tool install "git+https://github.com/trapstreet/trap.git"
```

The command is `tp`.

## How it works

trap runs your solution as a subprocess with one env var (`TRAP_MANIFEST` — an input dir and
an output dir), captures what it writes, then optionally scores it through a judge (per case)
and a grader (overall). See the [full flow and IO contract](docs/index.md).

Two roles, two directories, one IO contract:

- **Solution author** — writes `trap.yaml` and the solution code
- **Task author** — writes `traptask.yaml`, `inputs/`, `expected/`, and optional judge/grader scripts

## Quick start

```bash
# from examples/echo/solution/
tp run           # run all cases
tp run -t smoke  # run only cases tagged `smoke`
```

## Documentation

- [Quick start](docs/quickstart.md)
- [Writing a solution](docs/guides/writing-solution.md)
- [Writing a task](docs/guides/writing-task.md)
- [CLI reference](docs/reference/cli.md)
- [IO contract](docs/reference/io-contract.md)

## License

MIT
