This release is a pre-release and may not be stable for production use.
Schema-driven form wizards for the terminal.
TUI Forms is a Python library for building interactive, schema-driven form wizards in terminal user interfaces.
Define your form once using JSONSchema — field types, validation rules, and defaults — and tui-forms renders a guided, step-by-step wizard in the terminal.
Inspired by react-jsonschema-form, it brings the same declarative, schema-first philosophy to the terminal.
Whether you are building a CLI tool, a developer scaffold, or a TUI application, TUI Forms gives you a consistent, extensible form layer without reinventing the wheel.
Full documentation: https://collective.github.io/tui-forms
✨ Features
- Schema-driven forms — define your form once using JSONSchema; field types, defaults, and validation rules live in the schema.
- Multiple question types — text, boolean (yes/no), single-choice, and multiple-choice questions, plus hidden constant and computed values.
- Conditional questions — show or hide questions based on previous answers using JSONSchema
if/thenlogic. - Jinja2 defaults — reference previous answers in default values using
{{ answer_key }}template syntax. - Pluggable renderer backends — use the built-in zero-dependency
stdlibrenderer, the styledrichrenderer, thecookiecutter-style renderer, or implement your own by subclassingBaseRenderer. - Progress indicator — automatically shows
[current/total]progress as the user works through the form.
🚀 Quick start
from tui_forms import create_renderer
schema = {
"title": "New project",
"properties": {
"name": {
"type": "string",
"title": "Project name",
"default": "my-project",
},
"use_tests": {
"type": "boolean",
"title": "Include tests?",
"default": True,
},
"language": {
"type": "string",
"title": "Primary language",
"oneOf": [
{"const": "python", "title": "Python"},
{"const": "rust", "title": "Rust"},
],
},
},
}
renderer = create_renderer("stdlib", schema)
answers = renderer.render()
# {"name": "my-project", "use_tests": True, "language": "python"}
For more examples and integration guides, see the full documentation.
📦 Installation
Install tui-forms using your preferred package manager.
The core package has no dependencies beyond the Python standard library. Optional extras enable additional renderer backends.
pip
pip install tui-forms
With the rich and cookiecutter renderer backends:
pip install "tui-forms[rich]"
uv
uv add tui-forms
poetry
poetry add tui-forms
🛠️ Contributing
Clone the repository and set up the development environment:
git clone https://github.com/collective/tui-forms.git
cd tui-forms
make install
Key commands:
| Command | Description |
|---|---|
make test |
Run all tests |
make test-coverage |
Run tests with coverage report |
make format |
Format the codebase |
make lint |
Run the linter |
make lint-mypy |
Check type hints |
make docs-html |
Build the HTML documentation |
make docs-livehtml |
Build and serve documentation locally |
For a full contributing guide, see Contributing to TUI Forms.
📄 License
TUI Forms is distributed under the MIT License.
Metadata
Release files for tui-forms 1.0.0b2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tui_forms-1.0.0b2.tar.gz | 1.2 MB | Without provenance | Details for tui_forms-1.0.0b2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tui_forms-1.0.0b2-py3-none-any.whl | Python 3 | none | any | Details for tui_forms-1.0.0b2-py3-none-any.whl |
Total release size: 2.8 MB
Release files / tui_forms-1.0.0b2.tar.gz
| Download URL | tui_forms-1.0.0b2.tar.gz |
|---|---|
| Size | 1.2 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
05603a5c528eba9d0b10843175fdc69e0316ff5955bd89d9c7d3b1e72ba17aee
|
|
BLAKE2b-256 checksum How to use checksums |
ccf4d322a781d50373ba3ac72a251a1c5bfd75bcac1b8cf532ca9754804df3ee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.8 {"installer":{"name":"uv","version":"0.10.8","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}
|
Release files / tui_forms-1.0.0b2-py3-none-any.whl
| Download URL | tui_forms-1.0.0b2-py3-none-any.whl |
|---|---|
| Size | 1.6 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0ce11ede01bc4c6fc541fe7ab4eb10cdc7e3d722bb6c10af742ed3169854b4de
|
|
BLAKE2b-256 checksum How to use checksums |
9d6df84e2ab64417ec817da909c708d2ad88115b01fac59006f0cafe6f86d9ab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.8 {"installer":{"name":"uv","version":"0.10.8","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}
|
Security for tui-forms 1.0.0b2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.