Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

noot-0.1.0.dev1.tar.gz (18.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

noot-0.1.0.dev1-py3-none-any.whl (25.2 kB view details)

Uploaded Python 3

File details

Details for the file noot-0.1.0.dev1.tar.gz.

File metadata

  • Download URL: noot-0.1.0.dev1.tar.gz
  • Upload date:
  • Size: 18.5 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

Hashes for noot-0.1.0.dev1.tar.gz
Algorithm Hash digest
SHA256 f16df68eba3d736231d0d3f3ef75b56f9a7e9b2fd2229f659c439bc1f4714a9c
MD5 cb2f24f7868afaa85771d8cd222e69ca
BLAKE2b-256 933eeba9efe40bc7819626fc518364c87b09d8bd0727f59254a534e117739760

See more details on using hashes here.

File details

Details for the file noot-0.1.0.dev1-py3-none-any.whl.

File metadata

  • Download URL: noot-0.1.0.dev1-py3-none-any.whl
  • Upload date:
  • Size: 25.2 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

Hashes for noot-0.1.0.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 50cd8a84a113bb7d1c10729b95d7c2dc5aceef47df11c9bc6f5b6dabf849d6a0
MD5 1ad30c8a9de97df1176346c78c059623
BLAKE2b-256 7a65b35f386be2f9ce3beebb3f557beee3f382fa8d3523e522d02048a9859f91

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page