12 Factor CLI Apps
medium.com
12 Factor CLI Apps
1–10 of 253 posts
Re: 12 Factor CLI Apps
#2Re: 12 Factor CLI Apps
#3Instead of failing then spitting out --help or manpage style info, the program just ask the user enter the needed argument or flag to continue. Having more ways to learn usage is always good IMO.
Re: 12 Factor CLI Apps
#4Or if they specify `NO_COLOR`[1]!
Re: 12 Factor CLI Apps
#5In regards to 7, prompts are great for teaching new users how the program should be used. Instead of failing then spitting out --help or manpage style info, the program just ask the user enter the needed argument or flag to continue. Having more ways to learn usage is always good IMO.
Re: 12 Factor CLI Apps
#6> The user may have reasons for just not wanting this fancy output. Respect this if TERM=dumb or if they specify --no-color. Or if they specify `NO_COLOR`[1]! [1]: https://no-color.org/
Re: 12 Factor CLI Apps
#7Re: 12 Factor CLI Apps
#8An oldie but goodie here: https://eng.localytics.com/exploring-cli-best-practices/
Re: 12 Factor CLI Apps
#9I understand that man pages might represent a minority, but I cannot express enough how wonderful it is to get the full manual of a program without interfacing with the web. Not to mention how powerful that is, since most apps have short names that are difficult to search for, but how accessible that makes the application.
Re: 12 Factor CLI Apps
#10The one thing this does miss is distribution, which is a HUGE part of offering a great CLI app. Specifically, I'd say:
1. Make your OFFICIAL distribution channel the primary package manager on each platform (ex: on Mac, homebrew. Ubuntu, apt/snap). Beyond that, support as many as you have capacity to.
2. Also offer an official docker image which fully encapsulates the CLI tool and all of its dependencies. This can be a great way to get a CLI tool loaded into a bespoke CI environment.