Blitz: Add `-h` help for blitz CLI subcommands

Created on 19 Sep 2020  ยท  8Comments  ยท  Source: blitz-js/blitz

What do you want and why?

I'd love to get help for blitz cli subcommands. i.e. run blitz db --help and see help output for the db subcommand.

Possible implementation(s)

I personally love https://github.com/cli/cli as it has the nicest help output of any CLI command. Works for subcommands too. Example:

โฏ gh gist -h
Work with GitHub gists.

USAGE
  gh gist [flags]

CORE COMMANDS
  create:     Create a new gist
  edit:       Edit one of your gists
  list:       List your gists
  view:       View a gist

INHERITED FLAGS
  --help   Show help for command

ARGUMENTS
  A gist can be supplied as argument in either of the following formats:
  - by ID, e.g. 5b0e0062eb8e9654adad7bb1d81cc75f
  - by URL, e.g. "https://gist.github.com/OWNER/5b0e0062eb8e9654adad7bb1d81cc75f"

LEARN MORE
  Use 'gh <command> <subcommand> --help' for more information about a command.
  Read the manual at https://cli.github.com/manual
good first issue hacktoberfest kinfeature-change statudone

All 8 comments

For whoever works on this, here's the db command file: https://github.com/blitz-js/blitz/blob/canary/packages/cli/src/commands/db.ts

I'm happy to help with this one :)

@maciekgrzybek all yours! (btw you don't have to wait on confirmation to start working on something :)

Awesome, thanks mate :) I didn't ask once (don't remember what project was that) and when I created a PR it turned out someone already fixed it :D So, learn by experience... :)

@flybayer sorry I can't find it anywhere, is there a slack or a discord channel where I could look for any help? :)

I'm just working on this and I think I know how to fix it, but I do have one question. Do we want to command with--help be accessible from outside of the project?

@maciekgrzybek yeah we have slack: https://slack.blitzjs.com

And yeah, it's fine to have --help available outside a project

Hey, I've added a PR for this ticket -> https://github.com/blitz-js/blitz/pull/1257

Was this page helpful?
0 / 5 - 0 ratings