Registry / cli / c-bata-go-prompt

c-bata-go-prompt

JSON →
library0.2.6gogounverified

A library for building interactive command-line prompts in Go, inspired by Python's prompt_toolkit.

go get github.com/c-bata/go-prompt
INSTALL
IMPORT
SIG · C-BATA-GO-PROMPT
C
c-bata-go-prompt
cligov0.2.6
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

prompt
github.com/c-bata/go-prompt

Minimal example showing a prompt with tab completion.

package main import ( "fmt" "github.com/c-bata/go-prompt" ) func completer(d prompt.Document) []prompt.Suggest { return []prompt.Suggest{ {Text: "hello", Description: "say hello"}, } } func main() { fmt.Println("Type something") p := prompt.New( func(in string) { fmt.Println("You typed:", in) }, completer, ) p.Run() }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
0.2.6latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
34 hits · last 30 days
node
32
Resources
c-bata-go-prompt — go get c-bata-go-prompt · libregistry