Convert a Single Command CLI into a Multi Command CLI with Oclif and TypeScript

InstructorShawn Wang

Share this video with your friends

Send Tweet

Heavy duty CLI's like gatsby and npm do more than one thing. The convention is to namespace them with a command name after the CLI name, like gatsby new or gatsby build or npm install or npm uninstall. We should be comfortable converting our single purpose CLI's into multi command CLI's as our needs grow, as well as understand how to share logic between commands to keep code DRY.

~ 2 years ago

I was running into an issue where the command was not found. This was because it wasn't present in my output directory. I need to run a yarn run build before it would work.

How is the project building in the background? Is it watching the project for changes?