Commit graph

249 commits

Author SHA1 Message Date
Maas Lalani 01404ef586
feat(choose): Ability to choose multiple choices --limit
This commit introduces the ability to choose multiple options from the list of choices in `gum choose` by adding a `--limit` flag.
2022-07-13 11:45:52 -04:00
Maas Lalani 5de4df66d2
refactor: add package comments describing behavior 2022-07-13 09:55:36 -04:00
Maas Lalani 67f923de35
docs: Add gifs to README 2022-07-12 23:47:07 -04:00
Maas Lalani 912157521c
docs: group style flags so that they appear at the bottom 2022-07-12 22:48:44 -04:00
Maas Lalani 7190822247
refactor(kong): Implement Run(...) error interface
Instead of needing to run the commands manually in main.go, we can implement the `Run(...) error` method to satisfy the command interface so that `kong` can Run our commands for us.
2022-07-12 22:33:52 -04:00
Maas Lalani bf8d9964df
feat: allow initial values of input and write to be set via stdin 2022-07-12 16:30:17 -04:00
Maas Lalani 02e925ea57
refactor: use embedded style struct for all lipgloss styling
This commit uses the embedded style struct for styling in all components. The most notable example is `gum write` where there are many styles that are used and composed for each component of the command.
2022-07-12 16:08:33 -04:00
Maas Lalani 569c2cc622
refactor: embed style struct for reusability in styling other components 2022-07-12 10:07:29 -04:00
Maas Lalani 89892f85e3
docs(magic): Add example of magic trick
The magic example shows the user a bash magic trick by asking them to choose a card and then showing them their card.

A script never reveals its secrets. (unless you look at ./examples/magic.sh)
2022-07-11 18:11:48 -04:00
Maas Lalani 3e8153e140
fix(write): Add CtrlD as a quitting key
Add tea.KeyCtrlD as a way to quit the write as it signifies EOF.
2022-07-11 17:18:06 -04:00
Maas Lalani 66ef277036
fix(write): Hide textarea when quitting
When the user is done editing the text in the textarea this change hides the textarea and prints only the value to not clutter the terminal.
2022-07-11 17:16:30 -04:00
Maas Lalani 11e7e18256
docs(examples): Add example of conventional commit script
This change adds an example script of how to prompt the user for the necessary information for a conventional commit.
2022-07-11 17:07:53 -04:00
Maas Lalani 593cf711be
feat: Allow setting initial value for input and write 2022-07-11 16:53:13 -04:00
Maas Lalani 46ddc28ae5
feat: gum choose, pick from a list of choices
gum choose allows the user to be prompted for a choice from a list of choices.

For example, let's ask the user to pick a card from a deck.
gum choose --height 15 {Ace,King,Queen,Jack,Ten,Nine,Eight,Seven,Six,Five,Four,Three,Two}" of "{Spades,Hearts,Clubs,Diamonds}
2022-07-11 16:26:23 -04:00
Maas Lalani dab3792d5f
docs: examples pick commit hash from history 2022-07-11 13:54:45 -04:00
Maas Lalani e72857b737
docs: Add some examples of how to use gum in workflows
This commit adds usage examples to the README.md on how users can use
gum in their workflows. In fact, this commit message is being created
through the `gum write` command as shown in the example!
2022-07-11 13:35:06 -04:00
Maas Lalani aca8dcbc89
docs: fix bubbles components links 2022-07-11 10:41:16 -04:00
Christian Rocha be4027ce28
fix(write): honor --height argument 2022-07-08 22:39:21 -04:00
Maas Lalani d760cf4048
docs: Arch Linux (btw) 2022-07-08 22:39:21 -04:00
Maas Lalani 901e367fe2
refactor: rename gum search to gum filter 2022-07-08 13:58:14 -04:00
Ayman Bagabas 432d6dd032
docs: add badges 2022-07-08 13:47:21 -04:00
Maas Lalani 62b7fe6ac0
Merge pull request #2 from charmbracelet/release
Prepare for release & add workflows and update readme
2022-07-08 13:45:00 -04:00
Maas Lalani 0cbe05030b
Merge pull request #3 from charmbracelet/demo
fix: example
2022-07-08 13:42:23 -04:00
Carlos A Becker 9db6389fec
fix: example
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-07-08 14:38:42 -03:00
Ayman Bagabas d0325fd2f9
feat: add Dockerfile 2022-07-08 13:37:13 -04:00
Ayman Bagabas 7d5333deb2
docs: add installation methods to readme 2022-07-08 13:31:54 -04:00
Maas Lalani 6273aa6138
fix: support arrow keys for searching 2022-07-08 13:29:56 -04:00
Ayman Bagabas 9c8ac09dc6
feat(ci): add ci build and goreleaser 2022-07-08 13:21:53 -04:00
Maas Lalani b58dc52fc8
docs: add join comment with example 2022-07-08 10:23:45 -04:00
Maas Lalani 9e483004fc
docs: show complex gum join layout 2022-07-07 23:29:18 -04:00
Maas Lalani 4557fe8406
docs: gum write, gum join 2022-07-07 23:21:33 -04:00
Maas Lalani ff1f02f470
fix(write): Placeholder color fix 2022-07-07 22:39:42 -04:00
Maas Lalani d8ac24bcc6
fix: ignore node_modules by default 2022-07-07 22:39:28 -04:00
Maas Lalani 66e01ac849
feat: list all files if gum search receives no input. 2022-07-07 22:10:31 -04:00
Maas Lalani 53aa5c6a90
feat: Add gum join command 2022-07-07 19:32:21 -04:00
Maas Lalani fa4f09a413
feat: Default accent color is 212 (Bubble Gum Pink) 2022-07-07 17:46:22 -04:00
Maas Lalani 0bf74df4fc
docs: add demo 2022-07-07 15:25:40 -04:00
Maas Lalani 9f4f9ecbf1
refactor: rename to gum 2022-07-07 14:59:27 -04:00
Maas Lalani 0b9efbda37
doc: flavors 2022-07-07 13:29:11 -04:00
Maas Lalani a0e2cda3cb
feat: Add gum write command
Write provides a shell script interface for the text area bubble. It can
be used to ask the user to write some long form of text (multi-line)
input. The text the user entered will be sent to stdout.

```
gum write > output.text
```
2022-07-07 13:29:11 -04:00
Maas Lalani 25a12fbbc6
feat: gum style can take multiple arguments 2022-07-07 13:29:10 -04:00
Maas Lalani e2854d5b23
feat: add example/demo.sh to showcase functionality 2022-07-07 13:29:10 -04:00
Maas Lalani 12cde525ee
fix: searching should clear options when selected 2022-07-07 13:29:10 -04:00
Maas Lalani 09feddcc61
feat: Add gum style command
Style provides a shell script interface for Lip Gloss. It allows you to
use Lip Gloss to style text without needing to use Go. All of the
styling options are available as flags.

Let's make some text glamorous using bash:

```
gum style \
    --foreground "#FF06B7" --border "double" \
    --margin 2 --padding "2 4" --width 50 \
    "And oh gosh, how delicious the fabulous frizzy frobscottle" \
    "was! It was sweet and refreshing. It tasted of vanilla and" \
    "cream, with just the faintest trace of raspberries on the" \
    "edge of the flavour. And the bubbles were wonderful."
```

Output:

```
╔══════════════════════════════════════════════════╗
║                                                  ║
║                                                  ║
║    And oh gosh, how delicious the fabulous       ║
║    frizzy frobscottle was It was sweet and       ║
║    refreshing. It tasted of vanilla and          ║
║    cream, with just the faintest trace of        ║
║    raspberries on the edge of the flavour.       ║
║    And the bubbles were wonderful.               ║
║                                                  ║
║                                                  ║
╚══════════════════════════════════════════════════╝
```
2022-07-07 13:29:10 -04:00
Maas Lalani 2320f10278
feat: add stdin input handling and logging helpers 2022-07-07 13:29:10 -04:00
Maas Lalani 454040cf4d
feat: Add gum spin command
Spin provides a shell script interface for the spinner bubble. It is
useful for displaying that some task is running in the background while
consuming it's output so that it is not shown to the user.

For example, let's do a long running task:
```
sleep 5
```

We can simply prepend a spinner to this task to show it to the user,
while performing the task / command in the background.

```
gum spin -t "Taking a nap..." -- sleep 5
```

The spinner will automatically exit when the task is complete.
2022-07-07 13:29:10 -04:00
Maas Lalani c906d1904d
feat: Add gum search command
Search provides a fuzzy searching text input to allow filtering a list
of options to select one option.

i.e. Let's pick from a list of gum flavors:

```
cat flavors.text | gum search
```
2022-07-07 13:29:10 -04:00
Maas Lalani 2f07eacf50
feat: Add gum input command
Input provides a shell script interface for the text input bubble. It
can be used to prompt the user for some input. The text the user entered
will be sent to `stdout`.

```
gum input --placeholder "What's your Bubble Gum flavor?" > answer.text
````
2022-07-07 13:28:52 -04:00
Maas Lalani 92a2d31291
Initial commit 2022-07-06 12:05:45 -04:00