bnb / cli-cheatsheet

helpful libraries for *building* CLIs. Not a list of CLIs.

Home Page:https://mobile.twitter.com/swyx/status/1127431451559985152

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cli-cheatsheet

helpful libraries and resources for building Node.js CLIs. Not a list of CLIs.

CLI Design Thinking

  • 12 Factor CLI Apps (Blogpost, Talk): Jeff Dickey's list of requirements for UX.

  • Heroku CLI Style Guide (Guide, Talk, Talk): Heroku's CLI Style Guide.

  • CLI State Machines (Gist): My little thoughts on state management

Frameworks

  • Commander: Built by TJ, used in create-react-app, vue-cli, and many others. Key feature: pluggability. Vorpal is another framework inspired by Commander and is seeking maintainers
  • Oclif: Built by Heroku, used in Heroku and Salesforce CLI's. Key feature: pluggability.
  • Sade: Built by lukeed, used in tsdx. Key feature: lightweight?
  • Gluegun: Built by Infinite Red, used in Ignite and AWS Amplify. Key feature: templating/filesystem
  • Ink: Built by Vadim & Sindre. Key Feature: React Components and Yoga Layout.
  • Scritch: Built by Jamie, used at Eventbrite. Key Feature: compose multiple scripts regardless of language into one CLI.

Utility Libraries

Update Management/Nagging

Context/Config

Context from filesystem/PATH

Loading/Storing config

⚠️ Be aware of the XDG spec. Sindre's libraries use env-paths to get paths compliant with this.

🌟Input

Argument Parsing

⚠️ Your framework may come with parsing built in

Command execution

Spinners

Templating

🌟Output

Coloring

Boxing

Tables

*Debug Logging

Plugin/Release Management

⚠️ None of these are offline-first. Keen on finding one that respects offline first.

Misc

Beginner Tutorials

About

helpful libraries for *building* CLIs. Not a list of CLIs.

https://mobile.twitter.com/swyx/status/1127431451559985152

License:MIT License