MCPcopy Index your code
hub / github.com/erikgeiser/promptkit

github.com/erikgeiser/promptkit @v0.11.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.11.0 ↗ · + Follow
175 symbols 870 edges 28 files 66 documented · 38% 3 cross-repo links
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

promptkit

Interactive command line prompts with style!

<a href="https://github.com/erikgeiser/promptkit/releases/latest"><img alt="Release" src="https://img.shields.io/github/release/erikgeiser/promptkit.svg?style=for-the-badge"></a>
<a href="https://pkg.go.dev/github.com/erikgeiser/promptkit"><img alt="Go Doc" src="https://img.shields.io/badge/godoc-reference-blue.svg?style=for-the-badge"></a>
<a href="https://github.com/erikgeiser/promptkit/actions?workflow=Build"><img alt="GitHub Action: Build" src="https://img.shields.io/github/actions/workflow/status/erikgeiser/promptkit/build.yml?branch=main&style=for-the-badge"></a>



<a href="https://github.com/erikgeiser/promptkit/actions?workflow=Check"><img alt="GitHub Action: Check" src="https://img.shields.io/github/actions/workflow/status/erikgeiser/promptkit/check.yml?branch=main&style=for-the-badge"></a>
<a href="https://github.com/erikgeiser/promptkit/raw/v0.11.0/LICENSE.md"><img alt="Software License" src="https://img.shields.io/badge/license-MIT-brightgreen.svg?style=for-the-badge"></a>
<a href="https://goreportcard.com/report/github.com/erikgeiser/promptkit"><img alt="Go Report Card" src="https://goreportcard.com/badge/github.com/erikgeiser/promptkit?style=for-the-badge"></a>

Promptkit is a collection of common command line prompts for interactive programs. Each prompts comes with sensible defaults, re-mappable key bindings and many opportunities for heavy customization.


Disclaimers: * The API of library is not yet stable. Expect significant changes in minor versions before v1.0.0. * Windows is currently not explicitly supported because input events are dropped when running multiple prompts sequentially due to a bug in bubbletea. See https://github.com/charmbracelet/bubbletea/pull/140 and https://github.com/charmbracelet/bubbletea/issues/121 for more information.


Selection

Selection with filter and pagination support: Example Code


The selection prompt is highly customizable and also works well with custom types which for example enables filtering only on custom fields: Example Code


Text Input

A text input that supports editable default values: Example Code


Custom validation is also supported: Example Code


The text input can also be used in hidden mode for password prompts: Example Code


Confirmation Prompt

A confirmation prompt for binary questions: Example Code

Widget

The prompts in this library can also be used as bubbletea widgets: Example Code

Acknowledgements

This library is built on top of many great libraries, especially the following:

  • https://github.com/charmbracelet/bubbletea
  • https://github.com/charmbracelet/bubbles
  • https://github.com/muesli/termenv
  • https://github.com/muesli/reflow

Extension points exported contracts — how you extend this code

WrapMode (FuncType)
WrapMode decides in which way text is wrapped.
promptkit.go

Core symbols most depended-on inside this repo

AssertGoldenView
called by 54
test/test.go
Update
called by 42
test/test.go
Run
called by 35
test/test.go
New
called by 16
selection/prompt.go
keyMatches
called by 16
textinput/keymap.go
NewModel
called by 15
selection/model.go
View
called by 15
textinput/model.go
New
called by 15
textinput/prompt.go

Shape

Function 108
Method 53
Struct 12
FuncType 1
TypeAlias 1

Languages

Go100%

Modules by API surface

selection/model.go27 symbols
textinput/model.go16 symbols
selection/model_test.go15 symbols
confirmation/model_test.go14 symbols
confirmation/model.go12 symbols
textinput/model_test.go11 symbols
textinput/autocomplete_test.go9 symbols
test/test.go7 symbols
selection/prompt.go7 symbols
textinput/keymap.go6 symbols
textinput/autocomplete.go6 symbols
examples/bubbletea_widget/main.go6 symbols

Used by 3 indexed graphs manifest dependencies, hub-wide

For agents

$ claude mcp add promptkit \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact