oclif: The Open CLI Framework
  • Getting Started
  • API Reference
  • Blog
  • GitHub

›Getting Started

Getting Started

  • Introduction
  • Features
  • FAQs
  • Generator Commands

Architecture

  • Command Execution
  • Plugin Loading

API Reference

  • Commands
  • Command Arguments
  • Command Flags
  • Configuration
  • Topics
  • Topic Separators
  • Hooks
  • Plugins
  • Help Classes
  • Error Handling
  • JSON

How to

  • Release
  • Testing
  • Running Commands Programmatically
  • Aliases
  • Custom Base Class
  • Prompting
  • Spinner
  • Table
  • Notifications
  • Debugging
  • Flexible Taxonomy
  • Global Flags
  • Single Command CLI
  • ESM

Also See

  • Examples
  • External Links
  • Related Repositories
  • How We Work
  • Feedback
Edit

Generator Commands

  • oclif generate NAME
  • oclif generate command NAME
  • oclif generate hook NAME

oclif generate NAME

generate a new CLI

USAGE
  $ oclif generate [NAME]

ARGUMENTS
  NAME  directory name of new project

DESCRIPTION
  generate a new CLI

  This will clone the template repo 'oclif/hello-world' and update package properties

See code: src/commands/generate.ts

oclif generate command NAME

add a command to an existing CLI or plugin

USAGE
  $ oclif generate command [NAME] [--force]

ARGUMENTS
  NAME  name of command

FLAGS
  --force  overwrite existing files

DESCRIPTION
  add a command to an existing CLI or plugin

oclif generate hook NAME

add a hook to an existing CLI or plugin

USAGE
  $ oclif generate hook [NAME] [--force] [--event <value>]

ARGUMENTS
  NAME  name of hook (snake_case)

FLAGS
  --event=<value>  [default: init] event to run hook on
  --force          overwrite existing files

DESCRIPTION
  add a hook to an existing CLI or plugin
Last updated on 2/22/2023
← FAQsCommand Execution →
Made with 💜 by Salesforce — MIT License