ConnectOnionConnectOnion

Terminal

Interactive terminal utilities: selection menus, file browser, and input with autocomplete.

Quick Start

main.py
1from connectonion import pick, yes_no, browse_files, input_with_at 2 3# Selection menu 4choice = pick("Pick a color", ["Red", "Green", "Blue"]) 5 6# Yes/No confirmation 7ok = yes_no("Are you sure?") 8 9# File browser 10path = browse_files() 11 12# Input with @ file autocomplete 13cmd = input_with_at("> ")

pick()

Single-select menu with keyboard navigation.

main.py
1# List options (press 1, 2, 3 or arrow keys) 2choice = pick("Apply this command?", [ 3 "Yes, apply", 4 "Yes for same command", 5 "No, tell agent how" 6]) 7 8# Dict options (returns key) 9choice = pick("Continue?", { 10 "y": "Yes, continue", 11 "n": "No, cancel", 12})

yes_no()

Simple binary confirmation.

main.py
1ok = yes_no("Delete this file?") 2# Press y → True, n → False

browse_files()

Navigate and select files.

main.py
1path = browse_files() 2# Arrow keys to navigate 3# Enter on folder to open 4# Enter on file to select 5# Returns: "src/agent.py"

input_with_at()

Text input with @ file autocomplete.

main.py
1cmd = input_with_at("> ") 2# User types: "edit @" 3# File browser opens automatically 4# Returns: "edit src/agent.py"

Keyboard Controls

KeyAction
↑/↓Navigate options
1-9Quick select by number
EnterConfirm selection
EscCancel
@Trigger file autocomplete