Skip to content

Commit

Permalink
feat: export commands and hooks (#807)
Browse files Browse the repository at this point in the history
* feat: export commands and hooks

* chore(release): 4.2.6-dev.0 [skip ci]

* chore: bump oclif/core

* chore: readme

---------

Co-authored-by: svc-cli-bot <[email protected]>
  • Loading branch information
mdonnalley and svc-cli-bot authored Mar 4, 2024
1 parent 9dbe013 commit f1c1822
Show file tree
Hide file tree
Showing 4 changed files with 134 additions and 15 deletions.
115 changes: 106 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,14 @@ For removing plugins that are no longer needed (either because they're sunset or
<!-- commands -->

- [`mycli plugins`](#mycli-plugins)
- [`mycli plugins:inspect PLUGIN...`](#mycli-pluginsinspect-plugin)
- [`mycli plugins:install PLUGIN...`](#mycli-pluginsinstall-plugin)
- [`mycli plugins:inspect PLUGIN...`](#mycli-pluginsinspect-plugin)
- [`mycli plugins:install PLUGIN...`](#mycli-pluginsinstall-plugin-1)
- [`mycli plugins:link PLUGIN`](#mycli-pluginslink-plugin)
- [`mycli plugins reset`](#mycli-plugins-reset)
- [`mycli plugins:uninstall PLUGIN...`](#mycli-pluginsuninstall-plugin)
- [`mycli plugins reset`](#mycli-plugins-reset)
- [`mycli plugins:uninstall PLUGIN...`](#mycli-pluginsuninstall-plugin-1)
- [`mycli plugins:uninstall PLUGIN...`](#mycli-pluginsuninstall-plugin-2)
- [`mycli plugins update`](#mycli-plugins-update)

## `mycli plugins`
Expand All @@ -117,7 +120,49 @@ EXAMPLES
$ mycli plugins
```

_See code: [src/commands/plugins/index.ts](https://github.com/oclif/plugin-plugins/blob/4.2.8/src/commands/plugins/index.ts)_
_See code: [src/commands/plugins/index.ts](https://github.com/oclif/plugin-plugins/blob/v4.2.6-dev.0/src/commands/plugins/index.ts)_

## `mycli plugins:install PLUGIN...`

Installs a plugin into the CLI.

```
USAGE
$ mycli plugins add plugins:install PLUGIN...
ARGUMENTS
PLUGIN Plugin to install.
FLAGS
-f, --force Run yarn install with force flag.
-h, --help Show CLI help.
-s, --silent Silences yarn output.
-v, --verbose Show verbose yarn output.
GLOBAL FLAGS
--json Format output as json.
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
$ mycli plugins add
EXAMPLES
$ mycli plugins add myplugin
$ mycli plugins add https://github.com/someuser/someplugin
$ mycli plugins add someuser/someplugin
```

## `mycli plugins:inspect PLUGIN...`

Expand All @@ -144,7 +189,7 @@ EXAMPLES
$ mycli plugins inspect myplugin
```

_See code: [src/commands/plugins/inspect.ts](https://github.com/oclif/plugin-plugins/blob/4.2.8/src/commands/plugins/inspect.ts)_
_See code: [src/commands/plugins/inspect.ts](https://github.com/oclif/plugin-plugins/blob/v4.2.6-dev.0/src/commands/plugins/inspect.ts)_

## `mycli plugins:install PLUGIN...`

Expand Down Expand Up @@ -188,7 +233,7 @@ EXAMPLES
$ mycli plugins install someuser/someplugin
```

_See code: [src/commands/plugins/install.ts](https://github.com/oclif/plugin-plugins/blob/4.2.8/src/commands/plugins/install.ts)_
_See code: [src/commands/plugins/install.ts](https://github.com/oclif/plugin-plugins/blob/v4.2.6-dev.0/src/commands/plugins/install.ts)_

## `mycli plugins:link PLUGIN`

Expand Down Expand Up @@ -218,7 +263,33 @@ EXAMPLES
$ mycli plugins link myplugin
```

_See code: [src/commands/plugins/link.ts](https://github.com/oclif/plugin-plugins/blob/4.2.8/src/commands/plugins/link.ts)_
_See code: [src/commands/plugins/link.ts](https://github.com/oclif/plugin-plugins/blob/v4.2.6-dev.0/src/commands/plugins/link.ts)_

## `mycli plugins:uninstall PLUGIN...`

Removes a plugin from the CLI.

```
USAGE
$ mycli plugins remove plugins:uninstall PLUGIN...
ARGUMENTS
PLUGIN plugin to uninstall
FLAGS
-h, --help Show CLI help.
-v, --verbose
DESCRIPTION
Removes a plugin from the CLI.
ALIASES
$ mycli plugins unlink
$ mycli plugins remove
EXAMPLES
$ mycli plugins remove myplugin
```

## `mycli plugins reset`

Expand All @@ -233,7 +304,7 @@ FLAGS
--reinstall Reinstall all plugins after uninstalling.
```

_See code: [src/commands/plugins/reset.ts](https://github.com/oclif/plugin-plugins/blob/4.2.8/src/commands/plugins/reset.ts)_
_See code: [src/commands/plugins/reset.ts](https://github.com/oclif/plugin-plugins/blob/v4.2.6-dev.0/src/commands/plugins/reset.ts)_

## `mycli plugins:uninstall PLUGIN...`

Expand Down Expand Up @@ -261,7 +332,33 @@ EXAMPLES
$ mycli plugins uninstall myplugin
```

_See code: [src/commands/plugins/uninstall.ts](https://github.com/oclif/plugin-plugins/blob/4.2.8/src/commands/plugins/uninstall.ts)_
_See code: [src/commands/plugins/uninstall.ts](https://github.com/oclif/plugin-plugins/blob/v4.2.6-dev.0/src/commands/plugins/uninstall.ts)_

## `mycli plugins:uninstall PLUGIN...`

Removes a plugin from the CLI.

```
USAGE
$ mycli plugins unlink plugins:uninstall PLUGIN...
ARGUMENTS
PLUGIN plugin to uninstall
FLAGS
-h, --help Show CLI help.
-v, --verbose
DESCRIPTION
Removes a plugin from the CLI.
ALIASES
$ mycli plugins unlink
$ mycli plugins remove
EXAMPLES
$ mycli plugins unlink myplugin
```

## `mycli plugins update`

Expand All @@ -279,6 +376,6 @@ DESCRIPTION
Update installed plugins.
```

_See code: [src/commands/plugins/update.ts](https://github.com/oclif/plugin-plugins/blob/4.2.8/src/commands/plugins/update.ts)_
_See code: [src/commands/plugins/update.ts](https://github.com/oclif/plugin-plugins/blob/v4.2.6-dev.0/src/commands/plugins/update.ts)_

<!-- commandsstop -->
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "@oclif/plugin-plugins",
"description": "plugins plugin for oclif",
"version": "4.2.8",
"version": "4.2.6-dev.0",
"author": "Salesforce",
"bugs": "https://github.com/oclif/plugin-plugins/issues",
"dependencies": {
"@oclif/core": "^3.20.0",
"@oclif/core": "^3.21.0",
"chalk": "^5.3.0",
"debug": "^4.3.4",
"npm": "10.5.0",
Expand Down
22 changes: 22 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,23 @@
export {default} from './plugins.js'
import PluginsIndex from './commands/plugins/index.js'
import PluginsInspect from './commands/plugins/inspect.js'
import PluginsInstall from './commands/plugins/install.js'
import PluginsLink from './commands/plugins/link.js'
import PluginsReset from './commands/plugins/reset.js'
import PluginsUninstall from './commands/plugins/uninstall.js'
import PluginsUpdate from './commands/plugins/update.js'
import {update} from './hooks/update.js'

export const commands = {
plugins: PluginsIndex,
'plugins:inspect': PluginsInspect,
'plugins:install': PluginsInstall,
'plugins:link': PluginsLink,
'plugins:reset': PluginsReset,
'plugins:uninstall': PluginsUninstall,
'plugins:update': PluginsUpdate,
}

export const hooks = {
update,
}
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1710,10 +1710,10 @@
wordwrap "^1.0.0"
wrap-ansi "^7.0.0"

"@oclif/core@^3.20.0":
version "3.20.0"
resolved "https://registry.yarnpkg.com/@oclif/core/-/core-3.20.0.tgz#534458dc6e8c46d8f03906aaadaca079e16a6554"
integrity sha512-8BajhglY8frYGAS1whAukeouFZUN9MgQoLfNXtScPVEAjPlaD2BbSIAYQH2yF2qb/iVvbj/1DwYS3gqicYOq1A==
"@oclif/core@^3.21.0":
version "3.21.0"
resolved "https://registry.yarnpkg.com/@oclif/core/-/core-3.21.0.tgz#a235704e66589c8c104ccd616d0a8f1f36cf693e"
integrity sha512-xR7qGPOWtOnYmdYocSn6oEh2oTQLsPOXoj3HYGpb26V3WulwF8Cm33WPnMsSISv4ben3Rtc5i59u9O5NnuG42g==
dependencies:
"@types/cli-progress" "^3.11.5"
ansi-escapes "^4.3.2"
Expand Down

0 comments on commit f1c1822

Please sign in to comment.