TUIInput
DocsTUIInput

Input

Smart text input with trigger-based autocomplete

Quick Start

main.py
from connectonion.tui import Input # Simple input text = Input().run() # With file autocomplete from connectonion.tui import FileProvider text = Input(triggers={"@": FileProvider()}).run()

Features

Trigger Autocomplete

Type a trigger character to activate autocomplete from a provider:

main.py
from connectonion.tui import Input, FileProvider, StaticProvider # @ triggers file browser text = Input(triggers={"@": FileProvider()}).run() # User types: "edit @src/" → shows file dropdown # / triggers command palette commands = StaticProvider([("/today", "/today"), ("/inbox", "/inbox")]) text = Input(triggers={"/": commands}).run()

Hints and Tips

main.py
text = Input( hints=["/ commands", "@ files", "Enter submit"], tips=["Try /today for briefing", "Join Discord!"], divider=True, ).run()

API

main.py
Input( prompt: str = None, # Custom prompt text triggers: dict = None, # {char: Provider} for autocomplete hints: list[str] = None, # Always-visible hints tips: list[str] = None, # Rotating tips divider: bool = False, # Add horizontal dividers max_visible: int = 8, # Max dropdown items console: Console = None, style: str = "modern", # "modern", "minimal", "classic" ).run() -> str

Styles

modern

Magenta prompt, clean design

minimal

Bare bones, no decorations

classic

Traditional input style

Related

Star us on GitHub

If ConnectOnion saves you time, a ⭐ goes a long way — and earns you a coffee chat with our founder.