go-prompter

module
v0.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 26, 2023 License: MIT

README

go-prompter

Go Reference Software License Build Status Coverage Status Go Report Card Quality Gate Status

Build full-featured CLI prompts in GoLang.

A SQL prompt demo with most of the major features in play:

Demo

Features

  • 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 Keywords SetAutoCompleter(...)
    • Expand to context based additional Keywords using SetAutoCompleterContextual(...)
  • 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/rerun
  • Completely customizable KeyMap
    • Control what Actions can be triggered by what (special) Key-combinations
  • Custom command-shortcuts if the KeyMap is not flexible enough
  • Extremely flexible Styling/Customization
    • Auto-Complete look and feel
    • Cursor look and feel
    • Dimensions (height/width)
    • Line-Numbers look and feel
    • Scrollbar look and feel

Bonus

  • Input package that wraps around bubbletea 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
    • Can auto-adjust and auto-remove segments to meet terminal width limitations
    • Usable as header and/or prefix for the Prompt

Directories

Path Synopsis
examples
color command
input command
powerline command
prompt/simple command
prompt/sql command
mocks
input
Code generated by MockGen.
Code generated by MockGen.
prompt
Code generated by MockGen.
Code generated by MockGen.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL