Skip to content

Simple tools for building CLI apps, interacting with the CLI, and building a consistent CLI experience across projects.

License

Notifications You must be signed in to change notification settings

SparkFund/tools-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tools-cli

Clojars Project CircleCI

Simple tools for building CLI apps and interacting with the CLI, and building a consistent CLI experience across projects.

Although the source code for this library is now open source, it is offered as a demonstration, not as a promise of continued development or support.

Click the Clojars badge above to see available versions and to get Lein/Boot/deps.edn information.

Usage

sparkfund.cli.prompts

sparkfund.cli.prompts> (choice "please pick a flavor" {"vanilla" 1 "chocolate" 2})
please pick a flavor ✏️  raspberry
expecting one of: (vanilla chocolate)
please pick a flavor ✏️  chocolate
2

sparkfund.cli.shell

sparkfund.cli.shell> (sh! "cowsay" "-f" "flaming-sheep" "example")
[sh!] cowsay -f flaming-sheep example
 _________ 
< example >
 --------- 
  \            .    .     .   
   \      .  . .     `  ,     
    \    .; .  : .' :  :  : . 
     \   i..`: i` i.i.,i  i . 
      \   `,--.|i |i|ii|ii|i: 
           UooU\.'@@@@@@`.||' 
           \__/(@@@@@@@@@@)'  
                (@@@@@@@@)    
                `YY~~~~YY'    
                 ||    ||     
{:out
 " _________ \n< example >\n --------- \n  \\            .    .     .   \n   \\      .  . .     `  ,     \n    \\    .; .  : .' :  :  : . \n     \\   i..`: i` i.i.,i  i . \n      \\   `,--.|i |i|ii|ii|i: \n           UooU\\.'@@@@@@`.||' \n           \\__/(@@@@@@@@@@)'  \n                (@@@@@@@@)    \n                `YY~~~~YY'    \n                 ||    ||     \n",
 :err "",
 :exit 0}
sparkfund.cli.shell> (sh! "echo" "secret" {:print-cmd? false :print-out? false})
{:out "secret\n", :err "", :exit 0}

sparkfund.cli.style

sparkfund.cli.style> (git-branch-ok "feature/good")
"�[1m�[35mfeature/good�[0m" ;; magenta color
sparkfund.cli.style> (wrap-with-emoji <tada> "finished")
"🎉 🎉 🎉  finished 🎉 🎉 🎉 "

License

Copyright © Sparkfund 2020

Distributed under the Apache License, Version 2.0. See LICENSE for details.

About

Simple tools for building CLI apps, interacting with the CLI, and building a consistent CLI experience across projects.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published