Giter VIP home page Giter VIP logo

hello-world's Introduction

oclif-hello-world

oclif example Hello World CLI

oclif GitHub license

Usage

$ npm install -g oclif-hello-world
$ oex COMMAND
running command...
$ oex (--version)
oclif-hello-world/0.0.0 darwin-x64 node-v16.13.1
$ oex --help [COMMAND]
USAGE
  $ oex COMMAND
...

Commands

oex hello PERSON

Say hello

USAGE
  $ oex hello [PERSON] -f <value>

ARGUMENTS
  PERSON  Person to say hello to

FLAGS
  -f, --from=<value>  (required) Who is saying hello

DESCRIPTION
  Say hello

EXAMPLES
  $ oex hello friend --from oclif
  hello friend from oclif! (./src/commands/hello/index.ts)

See code: dist/commands/hello/index.ts

oex hello world

Say hello world

USAGE
  $ oex hello world

DESCRIPTION
  Say hello world

EXAMPLES
  $ oex hello world
  hello world! (./src/commands/hello/world.ts)

oex help [COMMAND]

Display help for oex.

USAGE
  $ oex help [COMMAND] [-n]

ARGUMENTS
  COMMAND  Command to show help for.

FLAGS
  -n, --nested-commands  Include all nested commands in the output.

DESCRIPTION
  Display help for oex.

See code: @oclif/plugin-help

oex plugins

List installed plugins.

USAGE
  $ oex plugins [--core]

FLAGS
  --core  Show core plugins.

DESCRIPTION
  List installed plugins.

EXAMPLES
  $ oex plugins

See code: @oclif/plugin-plugins

oex plugins:inspect PLUGIN...

Displays installation properties of a plugin.

USAGE
  $ oex plugins:inspect PLUGIN...

ARGUMENTS
  PLUGIN  [default: .] Plugin to inspect.

FLAGS
  -h, --help     Show CLI help.
  -v, --verbose

DESCRIPTION
  Displays installation properties of a plugin.

EXAMPLES
  $ oex plugins:inspect myplugin

oex plugins:install PLUGIN...

Installs a plugin into the CLI.

USAGE
  $ oex plugins:install PLUGIN...

ARGUMENTS
  PLUGIN  Plugin to install.

FLAGS
  -f, --force    Run yarn install with force flag.
  -h, --help     Show CLI help.
  -v, --verbose

DESCRIPTION
  Installs a plugin into the CLI.

  Can be installed from npm or a git url.

  Installation of a user-installed plugin will override a core plugin.

  e.g. If you have a core plugin that has a 'hello' command, installing a user-installed plugin with a 'hello' command
  will override the core plugin implementation. This is useful if a user needs to update core plugin functionality in
  the CLI without the need to patch and update the whole CLI.

ALIASES
  $ oex plugins add

EXAMPLES
  $ oex plugins:install myplugin 

  $ oex plugins:install https://github.com/someuser/someplugin

  $ oex plugins:install someuser/someplugin

oex plugins:link PLUGIN

Links a plugin into the CLI for development.

USAGE
  $ oex plugins:link PLUGIN

ARGUMENTS
  PATH  [default: .] path to plugin

FLAGS
  -h, --help     Show CLI help.
  -v, --verbose

DESCRIPTION
  Links a plugin into the CLI for development.

  Installation of a linked plugin will override a user-installed or core plugin.

  e.g. If you have a user-installed or core plugin that has a 'hello' command, installing a linked plugin with a 'hello'
  command will override the user-installed or core plugin implementation. This is useful for development work.

EXAMPLES
  $ oex plugins:link myplugin

oex plugins:uninstall PLUGIN...

Removes a plugin from the CLI.

USAGE
  $ oex plugins:uninstall PLUGIN...

ARGUMENTS
  PLUGIN  plugin to uninstall

FLAGS
  -h, --help     Show CLI help.
  -v, --verbose

DESCRIPTION
  Removes a plugin from the CLI.

ALIASES
  $ oex plugins unlink
  $ oex plugins remove

oex plugins update

Update installed plugins.

USAGE
  $ oex plugins update [-h] [-v]

FLAGS
  -h, --help     Show CLI help.
  -v, --verbose

DESCRIPTION
  Update installed plugins.

hello-world's People

Contributors

carrotfarmer avatar cristiand391 avatar dependabot[bot] avatar markjaquith avatar mdonnalley avatar mshanemc avatar pythoncoderas avatar rasphilco avatar rodesp avatar svc-cli-bot avatar tylerbutler avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

hello-world's Issues

Make ESM friendly template

Current template is specifically for CJS and requires modifications by the user to convert it to ESM. There are issues even after following the docs, like the tests don't pass.

We need to add a template that supports ESM without any modifications by the user and with tests that pass

The new template should be accessible through oclif's generator

build script throws TypeScript errors in environments with jest

I've generated a CLI inside my mono-repository, and it seems like @types/mocha type declarations conflict with jest ones I use in another package. It only happens because of my environment, but it could be avoided by using the skipLibCheck option in tsconfig.json.

skipLibCheck also saves compilation time by skipping type checking dependencies.

../../../node_modules/@types/mocha/index.d.ts(2642,13): error TS2403: Subsequent variable declarations must have the same type.  Variable 'beforeEach' must be of type 'Lifecycle', but here has type 'HookFunction'.
../../../node_modules/@types/mocha/index.d.ts(2660,13): error TS2403: Subsequent variable declarations must have the same type.  Variable 'afterEach' must be of type 'Lifecycle', but here has type 'HookFunction'.
../../../node_modules/@types/mocha/index.d.ts(2676,13): error TS2403: Subsequent variable declarations must have the same type.  Variable 'describe' must be of type 'Describe', but here has type 'SuiteFunction'.
../../../node_modules/@types/mocha/index.d.ts(2697,13): error TS2403: Subsequent variable declarations must have the same type.  Variable 'xdescribe' must be of type 'Describe', but here has type 'PendingSuiteFunction'.
../../../node_modules/@types/mocha/index.d.ts(2711,13): error TS2403: Subsequent variable declarations must have the same type.  Variable 'it' must be of type 'It', but here has type 'TestFunction'.
../../../node_modules/@types/mocha/index.d.ts(2725,13): error TS2403: Subsequent variable declarations must have the same type.  Variable 'test' must be of type 'It', but here has type 'TestFunction'.
../../../node_modules/@types/mocha/index.d.ts(2732,13): error TS2403: Subsequent variable declarations must have the same type.  Variable 'xit' must be of type 'It', but here has type 'PendingTestFunction'.
../../../node_modules/@types/sass-loader/interfaces.d.ts(410,43): error TS2314: Generic type 'Options<sync>' requires 1 type argument(s).

VSCode warns about using referenced projects without been composite

Screen Shot 2022-02-08 at 22 54 02

Every time a open the CLI package the VSCode warns me about an incorrect tsconfig.json that uses project references without having composite enabled. After looking at the docs I've confirmed that VSCode is right.

Link of TS's project references docs:
https://www.typescriptlang.org/docs/handbook/project-references.html#composite

Since tests/tsconfig.json is only used by test runner we don't see any error in the console, but for long term this may cause some troube.

Debugging in vscode not working with hello-world

I did the following:

  1. checkout of hello-world
  2. npm install
  3. npm run build
  4. /bin/run to verify everything

So far works fine.

Now I added launch.json:

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "node",
            "request": "launch",
            "name": "Launch Program",
            "skipFiles": [
                "<node_internals>/**"
            ],
            "program": "${workspaceFolder}\\bin\\run",
            "args": [
              "hello",
              "world",
            ],
        }
    ]
}

and set a breakpoint in world.ts:17 (run()).
The debugger never hits the breakpoint in the TS file.

How can I debug oclif projects in vs code?

Error: command hello:world not found

Do you want to request a feature or report a bug?

This is a bug.

What is the current behavior?

Command ./bin/run hello:world not working.

Steps to reproduce -

Commands fired -

$ oclif generate stream
$ ./bin/run hello:world
Error: command hello:world not found

generate command pulls oclif/hello-world repo as a template.

What is the expected behavior?

hello world! (./src/commands/hello/world.ts)

versions-
oclif: 2.1.0
oclif/core: 1.1.0
OS: OSX 11.5.2
Node: 14.17.1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.