What is CLI app • CLI stand for command-line interface • Some examples of CLI app Git $git log --UI --word-diff single line shell Grep $grep -c false /etc/passwd mysql-cli >mysql interactive ruby-irb shell 2.1.3 :001 > 1 + 1 #2
Why making CLI app • We are programmers, we live in terminal • Good CLI tool make our life easier • Using terminal make us feel like a god
Introduce Thor "Thor is a simple and erikhuda/thor efficient tool for building self-documenting command line utilities." Using thor, we can build single command line app with ease
Let's make a simple THOR app (live coding)
Single line shell app is somewhat boring~~~
Let's make interactive shell app using REPL • REPL stands for read–eval–print loop • REPL can simply be a loop while (line=gets) do ! #do something with line end ! • Using REPL makes our app more interactive
Writing complex interactive shell from the scratch is hard...