Skip to content

sugarcraft/candy-shell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

30 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

candy-shell

CandyShell

CI codecov Packagist Version License PHP

demo

PHP port of charmbracelet/gum β€” a composer-installable CLI of CandyCore TUI primitives, useful for shell scripts.

# Apply styling.
candyshell style --foreground "#ff5f87" --bold "Hello, candy!"

# Pick one item.
choice=$(candyshell choose Pizza Burger Salad)

# Read a single line.
name=$(candyshell input --placeholder "Your name?")

# Confirm a destructive action.
candyshell confirm "Really delete $file?" && rm "$file"

Subcommands (MVP)

  • style β€” apply Sprinkles styling to its argv (or stdin) and print.
  • choose β€” select one item from a list; prints the selection.
  • input β€” read a single line from the user.
  • confirm β€” yes/no; exit code 0 on yes, 1 on no.

Roadmap (post-v0)

  • spin β€” show a spinner while running an external command.
  • filter β€” fuzzy filter over stdin lines.
  • format β€” render Markdown / templates.
  • pager β€” scroll long input.
  • table β€” render a CSV / TSV table.
  • write β€” multi-line text editor.
  • file β€” file picker.
  • log β€” leveled logging output.
  • join β€” string join.

Test

cd candy-shell && composer install && vendor/bin/phpunit

Demos

choose

choose

Confirm

confirm

file

file

filter

filter

format

format

Input

input

join

join

log

log

pager

pager

spin

spin

Style

style

Table

table

write

write

About

🐚 PHP port of 🍬 gum β€” 13 CLI primitives: choose, confirm, file, filter, format, input, join, log, pager, spin, style, table, write.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages