An open API service indexing awesome lists of open source software.

https://github.com/brianstrauch/cobra-shell

Generate an interactive, autocompleting shell for any Cobra CLI
https://github.com/brianstrauch/cobra-shell

cli cobra go-prompt

Last synced: 6 months ago
JSON representation

Generate an interactive, autocompleting shell for any Cobra CLI

Awesome Lists containing this project

README

        

# cobra-shell

![logo](https://cobra.dev/home/logo.png)

## Description

Leverages the Cobra completion API to generate an interactive shell for any [Cobra](https://github.com/spf13/cobra) CLI, powered by [go-prompt](https://github.com/c-bata/go-prompt).

* On-the-fly autocompletion for all commands
* Static and dynamic autocompletion for args and flags, as described [here](https://github.com/spf13/cobra/blob/master/shell_completions.md)
* Full prompt customizability

## Usage

## Download

```
go get github.com/brianstrauch/cobra-shell
```

## Example

```
package main

import (
shell "github.com/brianstrauch/cobra-shell"
"github.com/spf13/cobra"
)

func main() {
cmd := &cobra.Command{Use: "example"}
cmd.AddCommand(shell.New())
_ = cmd.Execute()
}
```