Liking cljdoc? Tell your friends :D

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.

Can you improve this documentation?Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close