Build full-featured CLI prompts in GoLang.
Demo of a SQL Prompt with the major features in play:
- Single-line and Multi-line prompt with line numbers
- Syntax-Highlighting - use Chroma or roll-your-own
- Flexible Auto-Complete drop-downs
- Start with built-in
AutoCompleter
for simple KeywordsSetAutoCompleter(...)
- Expand to context based additional Keywords using
SetAutoCompleterContextual(...)
- Start with built-in
- Generate prompts with or without a "prefix"
- Header and Footer generator functions for dynamic content
- History integration with built-in go-back/go-forward/list/re-run
- Completely customizable KeyMap
- Well-defined Actions that can be mapped to Key-Sequences
- Custom command-shortcuts for Key-Sequences
- Flexible Styling/Customization to change the look and feel of
- Auto-Complete Drop-down
- Cursor
- Dimensions (height/width)
- Line-Numbers
- Scrollbar
- Input package that wraps around the Bubble Tea
library and provides a basic interface to capture input events
- Key-presses
- Mouse-clicks and motion
- Window/terminal resizes
- Powerline package to generate Powerline-like lines
- Supports "segments" on both left and right sides
- Auto-adjust and auto-remove segments to meet terminal width limitations
- Usable as header and/or prefix for the Prompt