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

›How to

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

Single Command CLI

Sometimes you may want your CLI's executable to also be the only command, similar to many bash utilities like ls or cat.

To support this, you will need to put your command logic into src/index.ts and add the following to the oclif section of your package.json:

oclif: {
  default: ".",
  commands: "./dist"
}
Last updated on 2/22/2023
← Global FlagsESM →
Made with 💜 by Salesforce — MIT License