Skip to content

Commit

Permalink
feat: add support for links plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
pviti committed Jun 28, 2024
1 parent 70870e6 commit bc60512
Show file tree
Hide file tree
Showing 8 changed files with 765 additions and 762 deletions.
31 changes: 18 additions & 13 deletions docs/applications.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ Show a list of all (logged in) available CLI applications.
```sh-session
USAGE
$ commercelayer applications [-k integration|sales_channel|user] [--live | -m test|live] [-a <value> | --id
<value>] [-A <value> | -o <value>] [-S]
<value>] [-A core|provisioning | -o <value>] [-S]

FLAGS
-A, --api=<value> specific API application
-A, --api=<option> specific API application
<options: core|provisioning>
-S, --sort sort applications by Organization and Application name
-a, --alias=<value> the alias associated to the application
-k, --kind=<option> application kind
Expand Down Expand Up @@ -57,7 +58,7 @@ Add a new Commerce Layer application to CLI config (application must be of kind

```sh-session
USAGE
$ commercelayer applications:add -a <value> [-o <value>] (-s <value> -i <value>) [-S <value> ] [-e <value> -p
$ commercelayer applications:add -a <value> [-o <value>] (-s <value> -i <value>) [-S <value>... ] [-e <value> -p
<value>]

FLAGS
Expand Down Expand Up @@ -115,10 +116,11 @@ Show application details.
```sh-session
USAGE
$ commercelayer applications:info [-k integration|sales_channel|user] [--live | -m test|live] [-a <value> | --id
<value>] [-A <value> | -o <value>] [-j]
<value>] [-A core|provisioning | -o <value>] [-j]

FLAGS
-A, --api=<value> specific API application
-A, --api=<option> specific API application
<options: core|provisioning>
-a, --alias=<value> the alias associated to the application
-j, --json show info in JSON format
-k, --kind=<option> application kind
Expand All @@ -144,7 +146,7 @@ Execute login to a Commerce Layer application (application must be of kind 'inte

```sh-session
USAGE
$ commercelayer applications:login -a <value> [-o <value>] (-s <value> -i <value>) [-S <value> ] [-e <value> -p
$ commercelayer applications:login -a <value> [-o <value>] (-s <value> -i <value>) [-S <value>... ] [-e <value> -p
<value>]

FLAGS
Expand Down Expand Up @@ -178,10 +180,11 @@ Remove an application from CLI local configuration.
```sh-session
USAGE
$ commercelayer applications:logout [-k integration|sales_channel|user] [--live | -m test|live] [-a <value> | --id
<value>] [-A <value> | -o <value>] [-r]
<value>] [-A core|provisioning | -o <value>] [-r]

FLAGS
-A, --api=<value> specific API application
-A, --api=<option> specific API application
<options: core|provisioning>
-a, --alias=<value> the alias associated to the application
-k, --kind=<option> application kind
<options: integration|sales_channel|user>
Expand Down Expand Up @@ -211,10 +214,11 @@ Show all Provisioning applications.
```sh-session
USAGE
$ commercelayer applications:provisioning [-k integration|sales_channel|user] [--live | -m test|live] [-a <value> | --id
<value>] [-A <value> | -o <value>] [-S]
<value>] [-A core|provisioning | -o <value>] [-S]

FLAGS
-A, --api=<value> specific API application
-A, --api=<option> specific API application
<options: core|provisioning>
-S, --sort sort applications by Organization and Application name
-a, --alias=<value> the alias associated to the application
-k, --kind=<option> application kind
Expand All @@ -229,7 +233,7 @@ DESCRIPTION
show all Provisioning applications

ALIASES
$ commercelayer prov:list
$ commercelayer app:prov
$ commercelayer app:provisioning
$ commercelayer prov:apps
$ commercelayer prov:applications
Expand Down Expand Up @@ -279,10 +283,11 @@ Switch applications.
```sh-session
USAGE
$ commercelayer applications:switch [-k integration|sales_channel|user] [--live | -m test|live] [-a <value> | --id
<value>] [-A <value> | -o <value>]
<value>] [-A core|provisioning | -o <value>]

FLAGS
-A, --api=<value> specific API application
-A, --api=<option> specific API application
<options: core|provisioning>
-a, --alias=<value> the alias associated to the application
-k, --kind=<option> application kind
<options: integration|sales_channel|user>
Expand Down
2 changes: 1 addition & 1 deletion docs/autocomplete.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ EXAMPLES
$ commercelayer autocomplete --refresh-cache
```

_See code: [@oclif/plugin-autocomplete](https://github.com/oclif/plugin-autocomplete/blob/v3.0.13/src/commands/autocomplete/index.ts)_
_See code: [@oclif/plugin-autocomplete](https://github.com/oclif/plugin-autocomplete/blob/v3.1.4/src/commands/autocomplete/index.ts)_
10 changes: 5 additions & 5 deletions docs/help.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

Display help for commercelayer.

* [`commercelayer help [COMMANDS]`](#commercelayer-help-commands)
* [`commercelayer help [COMMAND]`](#commercelayer-help-command)

### `commercelayer help [COMMANDS]`
### `commercelayer help [COMMAND]`

Display help for commercelayer.

```sh-session
USAGE
$ commercelayer help [COMMANDS...] [-n]
$ commercelayer help [COMMAND...] [-n]

ARGUMENTS
COMMANDS... Command to show help for.
COMMAND... Command to show help for.

FLAGS
-n, --nested-commands Include all nested commands in the output.
Expand All @@ -22,4 +22,4 @@ DESCRIPTION
Display help for commercelayer.
```

_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.0.12/src/commands/help.ts)_
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.0.21/src/commands/help.ts)_
63 changes: 34 additions & 29 deletions docs/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ Manage CLI plugins.
* [`commercelayer plugins`](#commercelayer-plugins)
* [`commercelayer plugins:available`](#commercelayer-pluginsavailable)
* [`commercelayer plugins:inspect PLUGIN...`](#commercelayer-pluginsinspect-plugin)
* [`commercelayer plugins:install PLUGIN...`](#commercelayer-pluginsinstall-plugin)
* [`commercelayer plugins:install PLUGIN`](#commercelayer-pluginsinstall-plugin)
* [`commercelayer plugins:latest [PLUGIN]`](#commercelayer-pluginslatest-plugin)
* [`commercelayer plugins:link PLUGIN`](#commercelayer-pluginslink-plugin)
* [`commercelayer plugins:link PATH`](#commercelayer-pluginslink-path)
* [`commercelayer plugins:reset`](#commercelayer-pluginsreset)
* [`commercelayer plugins:uninstall PLUGIN...`](#commercelayer-pluginsuninstall-plugin)
* [`commercelayer plugins:uninstall [PLUGIN]`](#commercelayer-pluginsuninstall-plugin)
* [`commercelayer plugins:update`](#commercelayer-pluginsupdate)

### `commercelayer plugins`
Expand All @@ -33,7 +33,7 @@ EXAMPLES
$ commercelayer plugins
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v4.3.10/src/commands/plugins/index.ts)_
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.3.2/src/commands/plugins/index.ts)_

### `commercelayer plugins:available`

Expand Down Expand Up @@ -77,51 +77,56 @@ EXAMPLES
$ commercelayer plugins:inspect myplugin
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v4.3.10/src/commands/plugins/inspect.ts)_
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.3.2/src/commands/plugins/inspect.ts)_

### `commercelayer plugins:install PLUGIN...`
### `commercelayer plugins:install PLUGIN`

Installs a plugin into the CLI.
Installs a plugin into commercelayer.

```sh-session
USAGE
$ commercelayer plugins:install PLUGIN...
$ commercelayer plugins:install PLUGIN... [--json] [-f] [-h] [-s | -v]

ARGUMENTS
PLUGIN... Plugin to install.

FLAGS
-f, --force Run yarn install with force flag.
-f, --force Force npm to fetch remote resources even if a local copy exists on disk.
-h, --help Show CLI help.
-s, --silent Silences yarn output.
-v, --verbose Show verbose yarn output.
-s, --silent Silences npm output.
-v, --verbose Show verbose npm output.

GLOBAL FLAGS
--json Format output as json.

DESCRIPTION
Installs a plugin into the CLI.
Can be installed from npm or a git url.
Installs a plugin into commercelayer.

Installation of a user-installed plugin will override a core plugin.
Uses npm to install plugins.

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.
Installation of a user-installed plugin will override a core plugin.

Use the COMMERCELAYER_NPM_LOG_LEVEL environment variable to set the npm loglevel.
Use the COMMERCELAYER_NPM_REGISTRY environment variable to set the npm registry.

ALIASES
$ commercelayer plugins:add

EXAMPLES
$ commercelayer plugins:install myplugin
Install a plugin from npm registry.

$ commercelayer plugins:install myplugin

Install a plugin from a github url.

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

$ commercelayer plugins:install https://github.com/someuser/someplugin
Install a plugin from a github slug.

$ commercelayer plugins:install someuser/someplugin
$ commercelayer plugins:install someuser/someplugin
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v4.3.10/src/commands/plugins/install.ts)_
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.3.2/src/commands/plugins/install.ts)_

### `commercelayer plugins:latest [PLUGIN]`

Expand All @@ -148,13 +153,13 @@ EXAMPLES

_See code: [src/commands/plugins/latest.ts](https://github.com/commercelayer/commercelayer-cli/blob/main/src/commands/plugins/latest.ts)_

### `commercelayer plugins:link PLUGIN`
### `commercelayer plugins:link PATH`

Links a plugin into the CLI for development.

```sh-session
USAGE
$ commercelayer plugins:link PLUGIN
$ commercelayer plugins:link PATH [-h] [--install] [-v]

ARGUMENTS
PATH [default: .] path to plugin
Expand All @@ -176,7 +181,7 @@ EXAMPLES
$ commercelayer plugins:link myplugin
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v4.3.10/src/commands/plugins/link.ts)_
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.3.2/src/commands/plugins/link.ts)_

### `commercelayer plugins:reset`

Expand All @@ -191,15 +196,15 @@ FLAGS
--reinstall Reinstall all plugins after uninstalling.
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v4.3.10/src/commands/plugins/reset.ts)_
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.3.2/src/commands/plugins/reset.ts)_

### `commercelayer plugins:uninstall PLUGIN...`
### `commercelayer plugins:uninstall [PLUGIN]`

Removes a plugin from the CLI.

```sh-session
USAGE
$ commercelayer plugins:uninstall PLUGIN...
$ commercelayer plugins:uninstall [PLUGIN...] [-h] [-v]

ARGUMENTS
PLUGIN... plugin to uninstall
Expand All @@ -219,7 +224,7 @@ EXAMPLES
$ commercelayer plugins:uninstall myplugin
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v4.3.10/src/commands/plugins/uninstall.ts)_
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.3.2/src/commands/plugins/uninstall.ts)_

### `commercelayer plugins:update`

Expand All @@ -237,4 +242,4 @@ DESCRIPTION
Update installed plugins.
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v4.3.10/src/commands/plugins/update.ts)_
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.3.2/src/commands/plugins/update.ts)_
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,29 +103,29 @@
"@types/configstore": "^4.0.0",
"@types/inquirer": "^8.2.10",
"@types/lodash.kebabcase": "^4.1.9",
"@types/mocha": "^10.0.6",
"@types/node": "^20.14.2",
"@types/mocha": "^10.0.7",
"@types/node": "^20.14.9",
"@types/update-notifier": "^5.1.0",
"@withfig/autocomplete-types": "^1.31.0",
"chai": "^4.4.1",
"dotenv": "^16.4.5",
"eslint": "^8.57.0",
"lodash.kebabcase": "^4.1.1",
"mocha": "^10.4.0",
"mocha": "^10.5.2",
"nyc": "^15.1.0",
"oclif": "^4.13.7",
"oclif": "^4.13.10",
"semantic-release": "^24.0.0",
"tsx": "^4.15.5",
"typescript": "^5.4.5"
"tsx": "^4.15.7",
"typescript": "^5.5.2"
},
"dependencies": {
"@commercelayer/cli-core": "^5.0.5",
"@commercelayer/provisioning-sdk": "^2.0.2",
"@commercelayer/sdk": "^6.8.0",
"@commercelayer/cli-core": "^5.1.0",
"@commercelayer/provisioning-sdk": "^2.1.0",
"@commercelayer/sdk": "^6.9.1",
"@oclif/core": "^3.27.0",
"@oclif/plugin-autocomplete": "^3.1.4",
"@oclif/plugin-help": "6.0.21",
"@oclif/plugin-not-found": "^3.2.5",
"@oclif/plugin-not-found": "^3.2.6",
"@oclif/plugin-plugins": "^5.3.2",
"configstore": "^5.0.1",
"inquirer": "^8.2.6",
Expand Down
Loading

0 comments on commit bc60512

Please sign in to comment.