← 返回命令列表

Linux command

gum 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Prompt for input

gum input --placeholder "Enter name"

Choose from options

gum choose "Option 1" "Option 2" "Option 3"

Confirm action

gum confirm "Delete file?" && rm file

Style text

gum style --foreground 212 "Styled text"

Spin while running

gum spin --title "Loading" -- sleep 5

Write multiline text

gum write --placeholder "Description"

说明

gum is a tool for creating glamorous shell scripts. It provides interactive prompts, styled output, and TUI components for building beautiful CLI applications. The tool offers pre-built components for input, selection, confirmation, and more. It's designed for easy integration in shell scripts.

参数

input
Single line text input.
choose
Select from list.
confirm
Yes/no confirmation.
style
Apply text styling.
spin
Show spinner during command.
write
Multi-line text editor.
filter
Fuzzy filter list.
--help
Display help information.

FAQ

What is the gum command used for?

gum is a tool for creating glamorous shell scripts. It provides interactive prompts, styled output, and TUI components for building beautiful CLI applications. The tool offers pre-built components for input, selection, confirmation, and more. It's designed for easy integration in shell scripts.

How do I run a basic gum example?

Run `gum input --placeholder "Enter name"` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does input do in gum?

Single line text input.