Skip to content

amilajack/dark

 
 

Repository files navigation

Dark

Build Status

🛠 Status: In Development

Dark is currently in development. It's on the fast track to a 1.0 release, so we encourage you to use it and give us your feedback, but there are things that haven't been finalized yet and you can expect some changes.

The Idea: Easy and Beautiful CLI's

Goals

Dark is a fork of commander.js with the following goals:

  • Customizability: Users can override the built in templates (.i.e default help prompt template) by importing templates
  • Type Safe: Improved compatibility with type systems
  • Improved Documentation: Provide a plethora of examples along with high quality API docs
  • Coloring: Built in support for colored output

Installation

npm install dark

A Taste

  1. Build your CLI app:
// index.js
const { default: dark } = require('dark');

const program = dark()
  .version('0.1.0')
  .option('-p, --peppers', 'Add peppers')
  .option('-P, --pineapple', 'Add pineapple')
  .option('-b, --bbq-sauce', 'Add bbq sauce')
  .option('-c, --cheese [type]', 'Add the specified type of cheese [marble]', 'marble')
  .init();

console.log('you ordered a pizza with:');
if (program.get('peppers')) console.log('  - peppers');
if (program.get('pineapple')) console.log('  - pineapple');
if (program.get('bbqSauce')) console.log('  - bbq');
console.log('  - %s cheese', program.get('cheese'));
  1. Run it:
node index.js -c                  # cheese
node index.js -c -p               # cheese and peppers
node index.js --cheese --peppers  # cheese and peppers

Docs

See the API docs

Support

Do you like this project? Star the repository, spread the word - it really helps. You may want to follow me on Twitter and GitHub. Thanks!

If this project is saving you (or your team) time, please consider supporting it on Patreon 👍 thank you!

Prior Art

Related

  • joker: A modern and intuitive testing library for command-line apps
  • ink: React for interactive command-line apps

About

A modern fork of commander.js

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 100.0%