PackageTrack

npm · #3845

@oclif/core

4.14.0oclif/core

base library for oclif CLIs

Release timeline

478 releases since 2020
202120222023202420252026

Releases

  1. 4.0.0-beta.222 Apr 2024pre-release
    Release notes

    Features

    Open source →
  2. 4.0.0-beta.118 Apr 2024pre-release

    Nothing published for this version

  3. 3.27.04 Jun 2024
    Release notes

    Features

    • added option to specify example flag value in docopts (#1095) (0345ac3), closes #1091
    Open source →
  4. 3.26.93 Jun 2024
    Release notes2 sources agree

    Bug Fixes

    • only replace command id in usage if it's at beginning of string (#1090) (3916945)
    Open source →
  5. 3.26.83 Jun 2024
    Release notes2 sources agree

    Bug Fixes

    Open source →
  6. 3.26.73 Jun 2024
    Release notes2 sources agree

    Bug Fixes

    Open source →
  7. 3.26.66 May 2024
    Release notes2 sources agree

    Bug Fixes

    • new "dont check npm" option for plugin-update (#1071) (9ccc797)
    Open source →
  8. 3.26.530 Apr 2024
    Release notes2 sources agree

    Bug Fixes

    Open source →
  9. 3.26.418 Apr 2024
    Release notes2 sources agree

    Bug Fixes

    Open source →
  10. 3.26.313 Apr 2024
    Release notes2 sources agree

    Bug Fixes

    • deps: bump ejs from 3.1.9 to 3.1.10 (72dd869)
    Open source →
  11. 3.26.28 Apr 2024
    Release notes2 sources agree

    Bug Fixes

    • do not throw an error if a flag with allowStdin='only' is immediately followed by another flag (#1046) (#1047) (f05b0c8)
    Open source →
  12. 3.26.18 Apr 2024
    Release notes

    Bug Fixes

    • deps: bump minimatch from 9.0.3 to 9.0.4 (#1041) (87cd0e6)
    Open source →
    Additional notes

    Bug Fixes

    • deps: bump minimatch from 9.0.3 to 9.0.4 (#1041) (87cd0e6)

    3.26.0 (2024-03-22)

    Features

    Open source →
  13. 3.26.022 Mar 2024
    Release notes

    Features

    Open source →
  14. 3.25.319 Mar 2024
    Release notes2 sources agree

    Bug Fixes

    • show options when required flag or arg is not given a value (#1017) (003ad6f)
    Open source →
  15. 3.25.215 Mar 2024
    Release notes2 sources agree

    Bug Fixes

    Open source →
  16. 3.25.114 Mar 2024
    Release notes

    Bug Fixes

    • ensure string is passed to process.emitWarning (#1015) (47081db)
    Open source →
    Additional notes

    Bug Fixes

    • ensure string is passed to process.emitWarning (#1015) (47081db)

    3.25.0 (2024-03-12)

    Features

    3.24.0 (2024-03-11)

    Bug Fixes

    Features

    • print ellipsis on arg if static is false (7a71524)
    Open source →
  17. 3.25.012 Mar 2024
    Release notes

    Features

    Open source →
  18. 3.24.011 Mar 2024
    Release notes

    Bug Fixes

    Features

    • print ellipsis on arg if static is false (7a71524)
    Open source →
  19. 3.23.111 Mar 2024
    Release notes

    Bug Fixes

    • remove configured id from usage override (#1012) (a8efedd)
    Open source →
    Additional notes

    Bug Fixes

    • remove configured id from usage override (#1012) (a8efedd)

    3.23.0 (2024-03-05)

    Features

    3.22.0 (2024-03-05)

    Features

    • support plugins with wildcards (966db94)
    Open source →
  20. 3.23.05 Mar 2024
    Release notes

    Features

    Open source →
  21. 3.22.05 Mar 2024
    Release notes

    Features

    • support plugins with wildcards (966db94)
    Open source →
  22. 3.21.24 Mar 2024
    Release notes2 sources agree

    Bug Fixes

    Open source →
  23. 3.21.14 Mar 2024
    Release notes

    Bug Fixes

    • allow arg to be empty string (629d482)
    Open source →
    Additional notes

    Bug Fixes

    • allow arg to be empty string (629d482)

    3.21.0 (2024-03-04)

    Features

    • add strategies for command discovery (#945) (eaf5a86)

    3.20.0 (2024-02-27)

    Features

    • add enableAutoTranspile setting (ae66106)
    • support bun and tsx for development (17ad3e6)
    Open source →
  24. 3.21.04 Mar 2024
    Release notes

    Features

    • add strategies for command discovery (#945) (eaf5a86)

    Command Discovery Strategies

    Support three strategies for command discovery:

    1. pattern - this is the current behavior that finds commands based on glob patterns
    2. explicit - find commands that are exported from a specified file. This is to support developers who wish to bundle their CLI into a single file.
    3. single - CLI contains a single command executed by top-level bin
    pattern Strategy

    For pattern, plugins could continue to do this:

    {
      "oclif": {
        "commands": "./dist/commands",
      }
    }
    

    which will tell oclif to look for commands in that directory (this is skipped if an oclif.manifest.json is present)

    Alternatively, plugins could set this configuration:

    {
      "oclif": {
        "commands": {
          "strategy": "pattern",
          "target": "./dist/commands"
        }
      }
    }
    

    And they could even add globPatterns to override the glob patterns that oclif uses when searching for command files:

    {
      "oclif": {
        "commands": {
          "strategy": "pattern",
          "target": "./dist/commands",
          "globPatterns": [
             "**/*.+(js|cjs|mjs|ts|tsx|mts|cts)",
            "!**/*.+(d.*|test.*|spec.*|helpers.*)?(x)"
          ]
        }
      }
    }
    
    explicit Strategy

    For explicit, plugins would add a new file (e.g. src/commands.ts) and then add this configuration to the package.json

    {
      "oclif": {
        "commands": {
          "strategy": "explicit",
          "target": "./dist/index.js",
          "identifier": "COMMANDS",
        }
      }
    }
    

    src/index.ts would then need to have an export with the same name as the identifier (if not set, it defaults to default) that's an object of command names to command classes, e.g.

    import Hello from './commands/hello'
    import HelloWorld from './commands/hello/world'
    
    export const COMMANDS = {
      hello: Hello,
      'hello:world': HelloWorld,
      howdy: Hello, // alias the `hello` command to `howdy`
    }
    

    The explicit strategy is useful to those who can't rely on file paths because they've bundled their code (https://github.com/oclif/oclif/issues/653) but it can also be used if you simply prefer to be more explicit about your commands instead of relying on oclif "magically" finding commands from the file system.

    It can also be leveraged to create or modify commands at runtime (e.g. add flags to a command based on an API spec - see oclif + dynamic commands section below).

    Unfortunately, there is no notable performance improvement for development since most of the time is spent auto-transpiling typescript with ts-node

    single Strategy

    This strategy is for single command CLIs, i.e. CLIs whose bin invokes a single command.

    The current way to achieve this to set this in the package.json

    {
      "oclif": {
        "default": ".",
        "commands": "./dist",
      }
    }
    

    The default tells oclif to use . as the command id when no command is found and commands tells oclif where to find the command file. In the example, ./dist will resolve to to ./dist/index.js

    The default property has always been a less-than-ideal workaround and will be deprecated in favor of these settings:

    {
      "oclif": {
        "commands": {
          "strategy": "single",
          "target": "./dist"
        }
      }
    }
    
    Note about oclif.manifest.json

    For all strategies, the oclif.manifest.json will be used to load the commands instead of the default behavior of the strategy.

    Open source →
  25. 3.20.1-dev.11 Mar 2024pre-release
    Release notes

    Bug Fixes

    • make dir optional for execute (394cbc6)

    Features

    • allow pjson to be provided to Config (57fec8c)
    Open source →
  26. 3.20.1-dev.027 Feb 2024pre-release
    Release notes

    Bug Fixes

    • only register command ids if they have valid cmd (488d4e2)

    3.19.5-dev.0 (2024-02-21)

    3.19.3-dev.0 (2024-02-16)

    Bug Fixes

    3.19.2-dev.0 (2024-02-15)

    Features

    3.19.2-qa.0 (2024-02-14)

    Bug Fixes

    Features

    • add import strategy for command discovery (2ca6815)
    • add new strategy for single command CLIs (994bd0a)
    Open source →
  27. 3.20.027 Feb 2024
    Release notes

    Features

    • add enableAutoTranspile setting (ae66106)
    • support bun and tsx for development (17ad3e6)
    Open source →
  28. 3.19.726 Feb 2024
    Release notes2 sources agree

    Bug Fixes

    • dont assume plugin-help is installed (35acf97)
    Open source →
  29. 3.19.623 Feb 2024
    Release notes2 sources agree

    Bug Fixes

    • revert to original prompt implementation (a96e567)
    Open source →
  30. 3.19.522 Feb 2024
    Release notes2 sources agree

    Bug Fixes

    • only set timeout for TTY (8a97f20)
    Open source →
  31. 3.19.5-dev.021 Feb 2024pre-release
    Release notes

    3.19.3-dev.0 (2024-02-16)

    Bug Fixes

    3.19.2-dev.0 (2024-02-15)

    Features

    3.19.2-qa.0 (2024-02-14)

    Bug Fixes

    Features

    • add import strategy for command discovery (2ca6815)
    • add new strategy for single command CLIs (994bd0a)
    Open source →
  32. 3.19.421 Feb 2024
    Release notes2 sources agree

    Bug Fixes

    • deps: bump ip from 2.0.0 to 2.0.1 (c2dcb43)
    Open source →
  33. 3.19.319 Feb 2024
    Release notes2 sources agree

    Bug Fixes

    Open source →
  34. 3.19.3-dev.016 Feb 2024pre-release
    Release notes

    Bug Fixes

    3.19.2 (2024-02-14)

    Bug Fixes

    • allow long text in ux.prompt (7d521b2)
    Open source →
  35. 3.19.214 Feb 2024
    Release notes2 sources agree

    Bug Fixes

    • allow long text in ux.prompt (7d521b2)
    Open source →
  36. 3.19.2-qa.014 Feb 2024pre-release
    Release notes

    Bug Fixes

    Features

    • add import strategy for command discovery (2ca6815)
    • add new strategy for single command CLIs (994bd0a)
    Open source →
  37. 3.19.2-dev.015 Feb 2024pre-release
    Release notes

    Features

    Open source →
  38. 3.19.16 Feb 2024
    Release notes

    Bug Fixes

    • parser: cache stdin value in global scope (#935) (c8bf886)
    Open source →
    Additional notes

    Bug Fixes

    • parser: cache stdin value in global scope (#935) (c8bf886)

    3.19.0 (2024-02-05)

    Bug Fixes

    • dont indent when no shor char (03c597a)
    • merge default and user theme (3798f4c)
    • prefer user theme (5eaed66)
    • return undefined if no theme (3cb3373)

    Features

    • allow theme file to be configurable (ab502b4)
    Open source →
  39. 3.19.05 Feb 2024
    Release notes

    Bug Fixes

    • dont indent when no shor char (03c597a)
    • merge default and user theme (3798f4c)
    • prefer user theme (5eaed66)
    • return undefined if no theme (3cb3373)

    Features

    • allow theme file to be configurable (ab502b4)
    Open source →
  40. 3.18.231 Jan 2024
    Release notes2 sources agree

    Bug Fixes

    Open source →
  41. 3.18.110 Jan 2024
    Release notes

    Bug Fixes

    • make @types/cli-progress a dependency (#922) (6528850)
    Open source →
    Additional notes

    Bug Fixes

    • make @types/cli-progress a dependency (#922) (6528850)

    3.18.0 (2024-01-09)

    Features

    3.17.0 (2024-01-09)

    Features

    3.16.0 (2024-01-02)

    Features

    Open source →
  42. 3.18.09 Jan 2024
    Release notes

    Features

    Open source →
  43. 3.17.09 Jan 2024
    Release notes

    Features

    Open source →
  44. 3.16.02 Jan 2024
    Release notes

    Features

    Open source →
  45. 3.15.123 Dec 2023
    Release notes

    Bug Fixes

    • deps: bump password-prompt from 1.1.2 to 1.1.3 (39f8860)
    Open source →
    Additional notes

    Bug Fixes

    • deps: bump password-prompt from 1.1.2 to 1.1.3 (39f8860)

    3.15.0 (2023-12-15)

    Features

    Open source →
  46. 3.15.015 Dec 2023
    Release notes

    Features

    Open source →
  47. 3.14.18 Dec 2023
    Release notes

    Bug Fixes

    • peserve original error coming from failed flag parsing (#897) (a7a3bba)
    Open source →
    Additional notes

    Bug Fixes

    • peserve original error coming from failed flag parsing (#897) (a7a3bba)

    3.14.0 (2023-12-07)

    Features

    Open source →
  48. 3.14.07 Dec 2023
    Release notes

    Features

    Open source →
  49. 3.13.24 Dec 2023
    Release notes2 sources agree

    Bug Fixes

    • add exit codes to different flag validation errors (#861) (1c841bf)
    Open source →
  50. 3.13.130 Nov 2023
    Release notes

    Bug Fixes

    Open source →
    Additional notes

    Bug Fixes

    3.13.0 (2023-11-30)

    Features

    • add 'multipleNonGreedy' flag option to assign only one value per multiple flag (#880) (#889) (354cead)
    Open source →
  51. 3.13.030 Nov 2023
    Release notes

    Features

    • add 'multipleNonGreedy' flag option to assign only one value per multiple flag (#880) (#889) (354cead)
    Open source →
  52. 3.12.130 Nov 2023
    Release notes

    Bug Fixes

    Open source →
    Additional notes

    Bug Fixes

    3.12.0 (2023-11-20)

    Features

    3.11.0 (2023-11-13)

    Features

    Open source →
  53. 3.12.020 Nov 2023
    Release notes

    Features

    Open source →
  54. 3.11.1-dev.116 Nov 2023pre-release
    Release notes

    Bug Fixes

    Open source →
  55. 3.11.1-dev.016 Nov 2023pre-release
    Release notes

    Bug Fixes

    • change http to https in order to pass lockfile-check workflow (#869) (8cd05e4)
    • https in yarn.lock (418d124)
    • prepare for plugin-theme (31604f8)
    • remove standardized id from usage string (cd746a6)
    • streamline coloring (295dd30)
    • support more chalk standards (0194eaa)

    Features

    Open source →
  56. 3.11.013 Nov 2023
    Release notes

    Features

    Open source →
  57. 3.10.88 Nov 2023
    Release notes2 sources agree

    Bug Fixes

    Open source →
  58. 3.10.77 Nov 2023
    Release notes2 sources agree

    Bug Fixes

    • handle undefined flags in help (bd5a38f)
    Open source →
  59. 3.10.66 Nov 2023
    Release notes2 sources agree

    Bug Fixes

    Open source →
  60. 3.10.56 Nov 2023
    Release notes2 sources agree

    Bug Fixes

    • extra parens in debug logs (81c9efc)
    Open source →