Makes your CLI demos 'appy
Instead of prototyping a CLI for your design proposal:
Fake it 'til you make it
Using a script to describe the interactions with a hypothetical CLI, you can demonstrate:
- How your CLI reponds on stdout to a command
- The files and directories your CLI creates/deletes/updates (so long as they're plain text)
Try this in a fresh terminal
# make the git binary be "appy" instead
alias git="./path/to/appy/executable"
# create a working dir for the appy demo.
mkdir demo
cd demo
# generate a config that points to the demo script
# you can place this in a directory above your demo dir
# if you dont anyone to see it in your directory during
# your demo
echo "./path/to/appy/demos/git.yaml" > .appy
Now when you type git
with unrecognized params, you will get a bell character
to warn you that your demo is off script.
You can append APPY_DEBUG=TRUE
to your command if you need more details on what
you got wrong.
When you type it with the right params, you'll get the scripted behaviour:
Try:
$ git init .
$ ls
$ cat git/never/does/this/readme.md
$ git status
$ git add .
$ git status
$ git commit -m "wip"
- make the 'appy' CLI respond with appy commands when it's not invoked as a different binary
-
appy help
-
appy version
-
appy describe
- let's you know what script is selected and tells you what is expected. -
appy line current
- whats the current line number, command and side effects -
appy line set <n>
- move the line
-
- make it possible to have extra lines that don't interact but produce a demo script
- parse arg string so it doesnt have to be broken into an array