question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Skeleton a basic CLI app in packages/flowershow and publish to npm

I want to run npx flowershow and get a help message

Acceptance

  • Can run flowershow or npx flowershow and it outputs a simple help message ✅ 2022-09-07 works
  • published to npm ✅ 2022-09-07 published
  • Test (?) - normally best approach is to split into a core lib and cli wrapper and you can test core lib I think I’ll add tests while working on the actual logic for the commands

Tasks

  • Research
  • Skeleton it out and have help message
  • Publish

Notes

Most popular tools for creating CLI tools seem to be:

  1. commander (alternatives: yargs, minimist, oclif, argh, and others)
  • tool for defining commands, parsing arguments, displaying errors, and help

    Commander looks after parsing the arguments into options and command-arguments, displays usage errors for problems, and implements a help system.

  1. inquirer
  • for inquiry sessions, possibly with fancy menus (e.g. like vue-cli)

provides the user interface and the inquiry session flow providing error feedback, asking questions, parsing input, validating answers, managing hierarchical prompts

  1. chalk
  • for cool terminal string styling
  1. winston

For consistent formatting of log output and ease of applying things like prefixes

commander vs yargs vs minimist vs oclif

  • it’s rather a matter of preference…
  • minimist is very…minimal - it only helps with arguments parsing (I’d rather choose sth more convenient/easier to use e.g. commander)
  • commander has no dependencies
  • vue-cli and datopian-cli are using minimist+inquirer+chalk

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
rufuspollockcommented, Sep 7, 2022

@olayway good work

  1. Ans: the tool should go into the existing https://github.com/flowershow/flowershow/tree/main/packages/flowershow (it is already what is publishing to flowershow on npm)
  2. Ans: no we publish to flowershow package for now so people can do npx flowershow ...
0reactions
rufuspollockcommented, Sep 7, 2022

@olayway great - let’s close. 👏

Read more comments on GitHub >

github_iconTop Results From Across the Web

Release Announcement · Render CLI v0.1.0
A command-line tool for working with Render has been high on our feedback page for quite a while; I've been using Render well...
Read more >
Releases · tektoncd/cli
1, Chains version v0.10.0 and Hub verion v0.8.0. With this release, the user can now set timeouts for pipeline, pipeline-tasks and finally-tasks via...
Read more >
Blog WerFault – command line switches v0.1
In my opinion werfault.exe accepts the most bizarre command line arguments combos on Windows platform ever. And despite werfault.exe process ...
Read more >
CLI v0.27.1
View this release on Github. Bug fixes. Track CLI version. Prior change: CLI v0.27.0. Following change: CLI v0.27.2. Was this page helpful?
Read more >
v0.1.0 · GitLab.org / release-cli
v0.1.0 Create Release CLI module.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found