oclif / core

Node.js Open CLI Framework. Built by Salesforce.

Home Page:https://oclif.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BaseCommand Documentation

JensAstrup opened this issue · comments

Describe the bug
Copying and pasting the exact example from the documentation on creating a BaseCommand does not result in a functional command that can be used.

To Reproduce

  1. Copy the code used in the example
  2. Attempt to start the CLI: ./bin/dev.js
  3. Note that said command does not appear

Expected behavior
I expected to be able to utilize a BaseCommand if I followed the instructions (or at least get some helpful debug output about why that didn't work :'( )

Environment (please complete the following information):

  • OS & version: [e.g. MacOS Monterey, Ubuntu 20.04.4 LTS, Windows 10]: MacOS 13.6.6
  • Shell/terminal & version [e.g. bash-3.2, bash-5.0, zsh 5.8, powershell 7.2.4, cmd.exe, Windows Terminal w/ powershell, etc... ]: zsh 5.9 (x86_64-apple-darwin22.0)

@JensAstrup I'm not able to reproduce this with the following:

  • oclif generate gh-1060 --yes
  • copy example into src/commands/hello/index.ts
  • bin/dev.js --name oclif

Is there anything I'm missing? Also you can get additional logs if you set the DEBUG=* in your environment

Nope, not missing anything 🤔 I used DEBUG, just felt wanting of more detail. Here's what I have using oclif/4.5.0 darwin-arm64 node-v21.7.1

Apologies if this is just me, my copy/paste job made it seem like an oclif issue - now I've got that sneaking feeling that I've overlooked something minor that'll have me 🤦

] +6ms
  config:espresso (import) /Users/jens/projects/espresso/src/commands/github/pending-review.ts +2s
Warning: Error
    at Plugin.warn (/Users/jens/projects/espresso/node_modules/@oclif/core/lib/config/plugin.js:372:17)
    at /Users/jens/projects/espresso/node_modules/@oclif/core/lib/config/plugin.js:276:30
    at async Promise.all (index 4)
    at async Plugin._manifest (/Users/jens/projects/espresso/node_modules/@oclif/core/lib/config/plugin.js:257:24)
    at async Plugin.load (/Users/jens/projects/espresso/node_modules/@oclif/core/lib/config/plugin.js:208:25)
    at async PluginLoader.loadRoot (/Users/jens/projects/espresso/node_modules/@oclif/core/lib/config/plugin-loader.js:67:13)
    at async Config.load (/Users/jens/projects/espresso/node_modules/@oclif/core/lib/config/config.js:267:27)
    at async Function.load (/Users/jens/projects/espresso/node_modules/@oclif/core/lib/config/config.js:157:9)
    at async run (/Users/jens/projects/espresso/node_modules/@oclif/core/lib/main.js:59:20)
    at async file:///Users/jens/projects/espresso/bin/dev.js:5:1
module: @oclif/core@3.26.0
task: findCommand (hello:hello)
plugin: espresso
root: /Users/jens/projects/espresso
See more details with DEBUG=*
Warning: Error
    at Plugin.warn (/Users/jens/projects/espresso/node_modules/@oclif/core/lib/config/plugin.js:372:17)
    at /Users/jens/projects/espresso/node_modules/@oclif/core/lib/config/plugin.js:276:30
    at async Promise.all (index 4)
    at async Plugin._manifest (/Users/jens/projects/espresso/node_modules/@oclif/core/lib/config/plugin.js:257:24)
    at async Plugin.load (/Users/jens/projects/espresso/node_modules/@oclif/core/lib/config/plugin.js:208:25)
    at async PluginLoader.loadRoot (/Users/jens/projects/espresso/node_modules/@oclif/core/lib/config/plugin-loader.js:67:13)
    at async Config.load (/Users/jens/projects/espresso/node_modules/@oclif/core/lib/config/config.js:267:27)
    at async Function.load (/Users/jens/projects/espresso/node_modules/@oclif/core/lib/config/config.js:157:9)
    at async run (/Users/jens/projects/espresso/node_modules/@oclif/core/lib/main.js:59:20)
    at async file:///Users/jens/projects/espresso/bin/dev.js:5:1
module: @oclif/core@3.26.0
task: findCommand (hello:hello)
plugin: espresso
root: /Users/jens/projects/espresso
See more details with DEBUG=*
  config:espresso (import) /Users/jens/projects/espresso/src/commands/shortcut/at-risk.ts +132ms
  config:espresso (import) /Users/jens/projects/espresso/src/commands/shortcut/missing-points.ts +0ms
  config:espresso (import) /Users/jens/projects/espresso/src/commands/shortcut/stalled-in-dev.ts +0ms

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.