Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jedib0t/go-prompter
Build full-featured CLI prompts in GoLang.
https://github.com/jedib0t/go-prompter
cli command-line-interface golang prompt prompter terminal
Last synced: 3 months ago
JSON representation
Build full-featured CLI prompts in GoLang.
- Host: GitHub
- URL: https://github.com/jedib0t/go-prompter
- Owner: jedib0t
- License: mit
- Created: 2023-09-26T17:48:36.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-31T02:58:52.000Z (over 1 year ago)
- Last Synced: 2024-10-14T12:55:53.287Z (4 months ago)
- Topics: cli, command-line-interface, golang, prompt, prompter, terminal
- Language: Go
- Homepage:
- Size: 1.81 MB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# go-prompter
[](https://pkg.go.dev/github.com/jedib0t/go-prompter)

[](https://github.com/jedib0t/go-prompter/actions?query=workflow%3ACI+event%3Apush+branch%3Amain)
[](https://coveralls.io/github/jedib0t/go-prompter?branch=main)
[](https://goreportcard.com/report/github.com/jedib0t/go-prompter)
[](https://sonarcloud.io/dashboard?id=jedib0t_go-prompter)Build full-featured CLI prompts in GoLang.
Demo of a SQL Prompt with the major features in play:
## Features
* Single-line and Multi-line prompt with line numbers
* [Syntax-Highlighting](prompt/syntax_highlighter.go) - use [Chroma](https://github.com/alecthomas/chroma) or roll-your-own
* Flexible [Auto-Complete](prompt/auto_completer.go) 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/re-run
* Completely customizable [KeyMap](prompt/key_map.go)
* Well-defined Actions that can be mapped to Key-Sequences
* Custom command-shortcuts for Key-Sequences
* Flexible [Styling/Customization](prompt/style.go) to change the look and feel of
* Auto-Complete Drop-down
* Cursor
* Dimensions (height/width)
* Line-Numbers
* Scrollbar## Bonus
* [Input](input) package that wraps around the [Bubble Tea](https://github.com/charmbracelet/bubbletea)
library and provides a basic interface to capture input events
* Key-presses
* Mouse-clicks and motion
* Window/terminal resizes
* [Powerline](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