civa86 / pretty.cli

Clojure utilities to create amazing Command Line Interfaces

Home Page:https://civa86.github.io/pretty.cli/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pretty.cli

Clojure utilities to create amazing Command Line Interfaces

Build Status Clojars Project

Documentation

API Documentation

Examples

See it in action!

ANSI Escapes

ANSI Escapes codes for manipulating the terminal:
clear the screen, move the cursor, delete lines and many more

(use 'pretty.cli.ansi-escapes)
(println "Here")
(println "First")
(println (cursor-up 2))
(println "Second")
(println (clear-screen))

ANSI Escapes

Colors

Enrich your text with colors, background and styles

(use 'pretty.cli.colors)
(println (txt-bold "Bold"))
(println (yellow "Yellow"))
(println (cyan-bg (txt-bold "Bold with Cyan Background")))
(println (txt-underscore (red "Underlined Red")))

Colors

Figlet

Print ASCII banners on your terminal

(use 'pretty.cli.figlet)
(println (figlet "Hello world"))

hello world

(use 'pretty.cli.colors)
(use 'pretty.cli.figlet)
(println (yellow (figlet "STAR" "starwars")))
(println (cyan (figlet "WARS" "starwars")))

star wars

Prompt User Input

Ask user input with many possibilities:
free input with validation, confirmation, select list and checkbox options

(use 'pretty.cli.prompt)
(input "What's your name" (fn [x] (if (= "" x) "Sorry?")))
(list-select "Choose your meal" ["Pasta" "Pizza" "Hamburger" "Salad"])
(list-checkbox "Add toppings" ["Bacon" "Cheese" "Onions" "Eggs"])
(confirm "Are you sure")

Prompt User Input

License

MIT.

About

Clojure utilities to create amazing Command Line Interfaces

https://civa86.github.io/pretty.cli/

License:MIT License


Languages

Language:Clojure 99.0%Language:Shell 1.0%