Noot library
Project description
noot
noot allows you to test interactive CLIs. Think of it as a Stagehand for interactive CLIs.
def test_create_web_project():
with Flow.spawn('python setup_wizard.py') as f:
f.expect('Welcome to Project Setup Wizard')
f.step("Enter project name 'mywebapp' and press enter")
# `expect` parses assertions from natural language
f.expect('Web Application project option is available')
f.step('Press enter to select Web Application')
# or specify assertions on screen state directly
assert "author name" in f.screen()
f.step("Enter author name 'Alice' and press enter")
Run your tests:
pytest tests/test_cli.py
The first run records LLM responses to the cassette file. Subsequent runs replay from the cassette, so no API calls are made.
Recording Modes
Control recording behavior with the RECORD_MODE environment variable:
RECORD_MODE |
Behavior |
|---|---|
once |
(Default) Record if cassette is missing, replay if it exists. |
none |
Replay only. Fails if a request isn't cached. Use this in CI. |
all |
Always re-record, overwriting existing cassettes. |
Example - force re-recording:
RECORD_MODE=all pytest tests/test_cli.py
Example - CI mode (fail if cassette is missing):
RECORD_MODE=none pytest tests/test_cli.py
Cassettes are stored in <project_root>/.cassettes/:
- CLI cassettes (LLM responses):
.cassettes/cli/ - HTTP cassettes (API recordings):
.cassettes/http/
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file noot-0.1.0.dev0.tar.gz.
File metadata
- Download URL: noot-0.1.0.dev0.tar.gz
- Upload date:
- Size: 15.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8ec834354233dd602bf6c5af7cd3a83b1350a78646934d736a322652d404e847
|
|
| MD5 |
7d612ce83e9777e682c60012cb9d121a
|
|
| BLAKE2b-256 |
b70a9e94bb9912f4040ae10b67565181d102383ef8ba2335d7a952cab63c0d05
|
File details
Details for the file noot-0.1.0.dev0-py3-none-any.whl.
File metadata
- Download URL: noot-0.1.0.dev0-py3-none-any.whl
- Upload date:
- Size: 21.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
08f882ec94fbf40050894854cdd9011f7a7d094ee012cca20f1551a44dcd1545
|
|
| MD5 |
eab2ea8450234634cdfcd05255c0c643
|
|
| BLAKE2b-256 |
1a54955e72008e523e7641c9a617d91ede17a4b7d3e95cea8994f8a815a4443d
|