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: about 1 month 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 (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-31T02:58:52.000Z (about 1 year ago)
- Last Synced: 2023-10-31T03:30:19.007Z (about 1 year ago)
- Topics: cli, command-line-interface, golang, prompt, prompter, terminal
- Language: Go
- Homepage:
- Size: 1.81 MB
- Stars: 3
- 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
[![Go Reference](https://pkg.go.dev/badge/github.com/jedib0t/go-prompter.svg)](https://pkg.go.dev/github.com/jedib0t/go-prompter)
![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)
[![Build Status](https://github.com/jedib0t/go-prompter/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/jedib0t/go-prompter/actions?query=workflow%3ACI+event%3Apush+branch%3Amain)
[![Coverage Status](https://coveralls.io/repos/github/jedib0t/go-prompter/badge.svg?branch=main)](https://coveralls.io/github/jedib0t/go-prompter?branch=main)
[![Go Report Card](https://goreportcard.com/badge/github.com/jedib0t/go-prompter)](https://goreportcard.com/report/github.com/jedib0t/go-prompter)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=jedib0t_go-prompter&metric=alert_status)](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