Skip to content

Commit 7e56d57

Browse files
committed
docs: update install instructions
closes #474
1 parent d722a2f commit 7e56d57

File tree

1 file changed

+47
-34
lines changed

1 file changed

+47
-34
lines changed

README.md

Lines changed: 47 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
Gum
2-
===
1+
# Gum
32

43
<p>
54
<a href="https://stuff.charm.sh/gum/nutritional-information.png" target="_blank"><img src="https://stuff.charm.sh/gum/gum.png" alt="Gum Image" width="450" /></a>
@@ -22,10 +21,12 @@ The above example is running from a single shell script ([source](./examples/dem
2221

2322
Gum provides highly configurable, ready-to-use utilities to help you write
2423
useful shell scripts and dotfiles aliases with just a few lines of code.
25-
Let's build a simple script to help you write [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/#summary)
24+
Let's build a simple script to help you write
25+
[Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/#summary)
2626
for your dotfiles.
2727

2828
Ask for the commit type with gum choose:
29+
2930
```bash
3031
gum choose "fix" "feat" "docs" "style" "refactor" "test" "chore" "revert"
3132
```
@@ -34,17 +35,20 @@ gum choose "fix" "feat" "docs" "style" "refactor" "test" "chore" "revert"
3435
> This command itself will print to stdout which is not all that useful. To make use of the command later on you can save the stdout to a `$VARIABLE` or `file.txt`.
3536
3637
Prompt for the scope of these changes:
38+
3739
```bash
3840
gum input --placeholder "scope"
3941
```
4042

4143
Prompt for the summary and description of changes:
44+
4245
```bash
4346
gum input --value "$TYPE$SCOPE: " --placeholder "Summary of this change"
4447
gum write --placeholder "Details of this change"
4548
```
4649

4750
Confirm before committing:
51+
4852
```bash
4953
gum confirm "Commit changes?" && git commit -m "$SUMMARY" -m "$DESCRIPTION"
5054
```
@@ -84,10 +88,11 @@ curl -fsSL https://repo.charm.sh/apt/gpg.key | sudo gpg --dearmor -o /etc/apt/ke
8488
echo "deb [signed-by=/etc/apt/keyrings/charm.gpg] https://repo.charm.sh/apt/ * *" | sudo tee /etc/apt/sources.list.d/charm.list
8589
sudo apt update && sudo apt install gum
8690
```
91+
8792
</details>
8893

8994
<details>
90-
<summary>Fedora/RHEL</summary>
95+
<summary>Fedora/RHEL/OpenSuse</summary>
9196

9297
```bash
9398
echo '[charm]
@@ -96,14 +101,22 @@ baseurl=https://repo.charm.sh/yum/
96101
enabled=1
97102
gpgcheck=1
98103
gpgkey=https://repo.charm.sh/yum/gpg.key' | sudo tee /etc/yum.repos.d/charm.repo
104+
sudo rpm --import https://repo.charm.sh/yum/gpg.key
105+
106+
# yum
99107
sudo yum install gum
108+
109+
# zypper
110+
sudo zypper refresh
111+
sudo zypper install gum
100112
```
113+
101114
</details>
102115

103116
Or download it:
104117

105-
* [Packages][releases] are available in Debian, RPM, and Alpine formats
106-
* [Binaries][releases] are available for Linux, macOS, Windows, FreeBSD, OpenBSD, and NetBSD
118+
- [Packages][releases] are available in Debian, RPM, and Alpine formats
119+
- [Binaries][releases] are available for Linux, macOS, Windows, FreeBSD, OpenBSD, and NetBSD
107120

108121
Or just install it with `go`:
109122

@@ -115,27 +128,27 @@ go install github.com/charmbracelet/gum@latest
115128

116129
## Commands
117130

118-
* [`choose`](#choose): Choose an option from a list of choices
119-
* [`confirm`](#confirm): Ask a user to confirm an action
120-
* [`file`](#file): Pick a file from a folder
121-
* [`filter`](#filter): Filter items from a list
122-
* [`format`](#format): Format a string using a template
123-
* [`input`](#input): Prompt for some input
124-
* [`join`](#join): Join text vertically or horizontally
125-
* [`pager`](#pager): Scroll through a file
126-
* [`spin`](#spin): Display spinner while running a command
127-
* [`style`](#style): Apply coloring, borders, spacing to text
128-
* [`table`](#table): Render a table of data
129-
* [`write`](#write): Prompt for long-form text
130-
* [`log`](#log): Log messages to output
131-
131+
- [`choose`](#choose): Choose an option from a list of choices
132+
- [`confirm`](#confirm): Ask a user to confirm an action
133+
- [`file`](#file): Pick a file from a folder
134+
- [`filter`](#filter): Filter items from a list
135+
- [`format`](#format): Format a string using a template
136+
- [`input`](#input): Prompt for some input
137+
- [`join`](#join): Join text vertically or horizontally
138+
- [`pager`](#pager): Scroll through a file
139+
- [`spin`](#spin): Display spinner while running a command
140+
- [`style`](#style): Apply coloring, borders, spacing to text
141+
- [`table`](#table): Render a table of data
142+
- [`write`](#write): Prompt for long-form text
143+
- [`log`](#log): Log messages to output
132144

133145
## Customization
134146

135147
You can customize `gum` options and styles with `--flags` and `$ENVIRONMENT_VARIABLES`.
136148
See `gum <command> --help` for a full view of each command's customization and configuration options.
137149

138150
Customize with `--flags`:
151+
139152
```bash
140153

141154
gum input --cursor.foreground "#FF0" \
@@ -369,63 +382,63 @@ How to use `gum` in your daily workflows:
369382

370383
See the [examples](./examples/) directory for more real world use cases.
371384

372-
* Write a commit message:
385+
- Write a commit message:
373386

374387
```bash
375388
git commit -m "$(gum input --width 50 --placeholder "Summary of changes")" \
376389
-m "$(gum write --width 80 --placeholder "Details of changes")"
377390
```
378391

379-
* Open files in your `$EDITOR`
392+
- Open files in your `$EDITOR`
380393

381394
```bash
382395
$EDITOR $(gum filter)
383396
```
384397

385-
* Connect to a `tmux` session
398+
- Connect to a `tmux` session
386399

387400
```bash
388401
SESSION=$(tmux list-sessions -F \#S | gum filter --placeholder "Pick session...")
389402
tmux switch-client -t $SESSION || tmux attach -t $SESSION
390403
```
391404

392-
* Pick a commit hash from `git` history
405+
- Pick a commit hash from `git` history
393406

394407
```bash
395408
git log --oneline | gum filter | cut -d' ' -f1 # | copy
396409
```
397410

398-
* Simple [`skate`](https://github.com/charmbracelet/skate) password selector.
411+
- Simple [`skate`](https://github.com/charmbracelet/skate) password selector.
399412

400413
```
401414
skate list -k | gum filter | xargs skate get
402415
```
403416

404-
* Uninstall packages
417+
- Uninstall packages
405418

406419
```bash
407420
brew list | gum choose --no-limit | xargs brew uninstall
408421
```
409422

410-
* Clean up `git` branches
423+
- Clean up `git` branches
411424

412425
```bash
413426
git branch | cut -c 3- | gum choose --no-limit | xargs git branch -D
414427
```
415428

416-
* Checkout GitHub pull requests with [`gh`](https://cli.github.com/)
429+
- Checkout GitHub pull requests with [`gh`](https://cli.github.com/)
417430

418431
```bash
419432
gh pr list | cut -f1,2 | gum choose | cut -f1 | xargs gh pr checkout
420433
```
421434

422-
* Copy command from shell history
435+
- Copy command from shell history
423436

424437
```bash
425438
gum filter < $HISTFILE --height 20
426439
```
427440

428-
* `sudo` replacement
441+
- `sudo` replacement
429442

430443
```bash
431444
alias please="gum input --password | sudo -nS"
@@ -435,15 +448,15 @@ alias please="gum input --password | sudo -nS"
435448

436449
We’d love to hear your thoughts on this project. Feel free to drop us a note!
437450

438-
* [Twitter](https://twitter.com/charmcli)
439-
* [The Fediverse](https://mastodon.social/@charmcli)
440-
* [Discord](https://charm.sh/chat)
451+
- [Twitter](https://twitter.com/charmcli)
452+
- [The Fediverse](https://mastodon.social/@charmcli)
453+
- [Discord](https://charm.sh/chat)
441454

442455
## License
443456

444457
[MIT](https://github.com/charmbracelet/gum/raw/main/LICENSE)
445458

446-
***
459+
---
447460

448461
Part of [Charm](https://charm.sh).
449462

0 commit comments

Comments
 (0)