https://github.com/commercelayer/commercelayer-cli-plugin-provisioning
https://github.com/commercelayer/commercelayer-cli-plugin-provisioning
commercelayer
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/commercelayer/commercelayer-cli-plugin-provisioning
- Owner: commercelayer
- License: mit
- Created: 2023-10-26T18:26:00.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2026-04-14T16:50:58.000Z (about 2 months ago)
- Last Synced: 2026-04-14T18:27:38.315Z (about 2 months ago)
- Topics: commercelayer
- Language: TypeScript
- Homepage:
- Size: 1.05 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# @commercelayer/cli-plugin-provisioning
Commerce Layer CLI Provisioning plugin
[](https://oclif.io)
[](https://npmjs.org/package/@commercelayer/cli-plugin-provisioning)
[](https://npmjs.org/package/@commercelayer/cli-plugin-provisioning)
[](https://github.com/@commercelayer/cli-plugin-provisioning/blob/master/package.json)
* [Usage](#usage)
* [Commands](#commands)
## Usage
```sh-session
commercelayer COMMAND
commercelayer [COMMAND] (--help | -h) for detailed information about plugin commands.
```
## Commands
* [`commercelayer provisioning:create RESOURCE`](#commercelayer-provisioningcreate-resource)
* [`commercelayer provisioning:delete RESOURCE [ID]`](#commercelayer-provisioningdelete-resource-id)
* [`commercelayer provisioning:exec RESOURCE [ID] [ACTION]`](#commercelayer-provisioningexec-resource-id-action)
* [`commercelayer provisioning:fetch RESOURCE PATH [ID]`](#commercelayer-provisioningfetch-resource-path-id)
* [`commercelayer provisioning:get RESOURCE [ID]`](#commercelayer-provisioningget-resource-id)
* [`commercelayer provisioning:list RESOURCE`](#commercelayer-provisioninglist-resource)
* [`commercelayer provisioning:resources`](#commercelayer-provisioningresources)
* [`commercelayer provisioning:retrieve RESOURCE [ID]`](#commercelayer-provisioningretrieve-resource-id)
* [`commercelayer provisioning:update RESOURCE [ID]`](#commercelayer-provisioningupdate-resource-id)
### `commercelayer provisioning:create RESOURCE`
Create a new resource.
```sh-session
USAGE
$ commercelayer provisioning:create RESOURCE [-i ...] [-f ...] [-u -j] [-l curl|node [--doc | -R]]
[--curl ] [--node ] [-H ] [-Y ] [-O ...] [-D | -a ... | -r ... | -m ... | ]
ARGUMENTS
RESOURCE the resource type
FLAGS
-D, --data= the data file to use as request body
-H, --headers show response headers
-O, --object=... define a resource object attribute
-R, --raw print out the raw API response
-Y, --headers-only show only response headers
-a, --attribute=... define a resource attribute
-f, --fields=... comma separeted list of fields in the format [resourceType/]field1,field2,field3
-i, --include=... comma separated resources to include
-j, --json convert output in standard JSON format
-m, --metadata=... define a metadata attribute or a set of metadata attributes
-r, --relationship=... define a relationship with another resource
-u, --unformatted print unformatted JSON output
DOCUMENTATION FLAGS
-l, --lang= show the CLI command in the specified language syntax
--curl show the equivalent cURL command of the CLI command
--doc show the CLI command in a specific language
--node show the equivalent Node SDK source code of the CLI command
DESCRIPTION
create a new resource
ALIASES
$ commercelayer prov:create
$ commercelayer pc
$ commercelayer pcreate
EXAMPLES
$ commercelayer provisioning:create organizations -a name=MyOrg
$ clayer prov:create subscriptions -r plan=plans/
$ cl prov:create organization -a name=MyOrg -m meta_key="meta value"
$ cl pc roles -D /path/to/data/file/data.json
```
_See code: [src/commands/provisioning/create.ts](https://github.com/commercelayer/commercelayer-cli-plugin-provisioning/blob/main/src/commands/provisioning/create.ts)_
### `commercelayer provisioning:delete RESOURCE [ID]`
Delete an existing resource.
```sh-session
USAGE
$ commercelayer provisioning:delete RESOURCE [ID] [-l curl|node [--doc | -R]] [--curl ] [--node ] [-H ] [-Y ]
ARGUMENTS
RESOURCE the resource type
ID id of the resource to delete
FLAGS
-H, --headers show response headers
-R, --raw print out the raw API response
-Y, --headers-only show only response headers
DOCUMENTATION FLAGS
-l, --lang= show the CLI command in the specified language syntax
--curl show the equivalent cURL command of the CLI command
--doc show the CLI command in a specific language
--node show the equivalent Node SDK source code of the CLI command
DESCRIPTION
delete an existing resource
ALIASES
$ commercelayer prov:delete
$ commercelayer pd
$ commercelayer pdelete
$ commercelayer pdel
EXAMPLES
$ commercelayer provisioning:delete api_credentials/
$ cl prov:delete api_credentials
```
_See code: [src/commands/provisioning/delete.ts](https://github.com/commercelayer/commercelayer-cli-plugin-provisioning/blob/main/src/commands/provisioning/delete.ts)_
### `commercelayer provisioning:exec RESOURCE [ID] [ACTION]`
Execute an action on a resource.
```sh-session
USAGE
$ commercelayer provisioning:exec RESOURCE [ID] [ACTION] [-a ...]
ARGUMENTS
RESOURCE the resource type
ID id of the resource on which to execute the action
ACTION action to execute on resource
FLAGS
-a, --attribute=... define a resource attribute
DESCRIPTION
execute an action on a resource
ALIASES
$ commercelayer prov:exec
$ commercelayer pe
$ commercelayer pexec
EXAMPLES
$ commercelayer provisioning:exec organizations transfer_ownership
$ cl prov:exec memberships resend
```
_See code: [src/commands/provisioning/exec.ts](https://github.com/commercelayer/commercelayer-cli-plugin-provisioning/blob/main/src/commands/provisioning/exec.ts)_
### `commercelayer provisioning:fetch RESOURCE PATH [ID]`
Retrieve a resource or list a set of resources.
```sh-session
USAGE
$ commercelayer provisioning:fetch RESOURCE... PATH... [ID...] [-i ...] [-f ...] [-u -j] [-l curl|node
[--doc | -R]] [--curl ] [--node ] [-H ] [-Y ] [-e ... | ] [-w ...] [-p ] [-n ] [-s
...]
ARGUMENTS
RESOURCE... the resource type
PATH... path (or URL) of the resource(s) to fetch
ID... resource id
FLAGS
-H, --headers show response headers
-R, --raw print out the raw API response
-Y, --headers-only show only response headers
-e, --extract=... extract subfields from object attributes
-f, --fields=... comma separeted list of fields in the format [resourceType/]field1,field2,field3
-i, --include=... comma separated resources to include
-j, --json convert output in standard JSON format
-n, --pageSize= number of elements per page
-p, --page= page number
-s, --sort=... define results ordering
-u, --unformatted print unformatted JSON output
-w, --where=... comma separated list of query filters
DOCUMENTATION FLAGS
-l, --lang= show the CLI command in the specified language syntax
--curl show the equivalent cURL command of the CLI command
--doc show the CLI command in a specific language
--node show the equivalent Node SDK source code of the CLI command
DESCRIPTION
retrieve a resource or list a set of resources
ALIASES
$ commercelayer prov:fetch
$ commercelayer pf
EXAMPLES
$ commercelayer provisioning:fetch roles
$ commercelayer prov:fetch roles
$ clayer prov:fetch roles/
$ cl prov:fetch roles//
$ cl pf roles/{roleId}/permissions aBcdEkYWx
```
_See code: [src/commands/provisioning/fetch.ts](https://github.com/commercelayer/commercelayer-cli-plugin-provisioning/blob/main/src/commands/provisioning/fetch.ts)_
### `commercelayer provisioning:get RESOURCE [ID]`
Retrieve a resource or list a set of resources.
```sh-session
USAGE
$ commercelayer provisioning:get RESOURCE... [ID...] [-i ...] [-f ...] [-u -j] [-l curl|node [--doc |
-R]] [--curl ] [--node ] [-H ] [-Y ] [-e ... | ] [-w ...] [-p ] [-n ] [-s ...]
ARGUMENTS
RESOURCE... the resource type
ID... id of the resource to retrieve
FLAGS
-H, --headers show response headers
-R, --raw print out the raw API response
-Y, --headers-only show only response headers
-e, --extract=... extract subfields from object attributes
-f, --fields=... comma separeted list of fields in the format [resourceType/]field1,field2,field3
-i, --include=... comma separated resources to include
-j, --json convert output in standard JSON format
-n, --pageSize= number of elements per page
-p, --page= page number
-s, --sort=... define results ordering
-u, --unformatted print unformatted JSON output
-w, --where=... comma separated list of query filters
DOCUMENTATION FLAGS
-l, --lang= show the CLI command in the specified language syntax
--curl show the equivalent cURL command of the CLI command
--doc show the CLI command in a specific language
--node show the equivalent Node SDK source code of the CLI command
DESCRIPTION
retrieve a resource or list a set of resources
ALIASES
$ commercelayer prov:get
$ commercelayer pg
$ commercelayer pget
EXAMPLES
$ commercelayer provisioning:get roles
$ commercelayer prov:get roles
$ clayer prov:get roles/
$ cl prov:get roles
```
_See code: [src/commands/provisioning/get.ts](https://github.com/commercelayer/commercelayer-cli-plugin-provisioning/blob/main/src/commands/provisioning/get.ts)_
### `commercelayer provisioning:list RESOURCE`
Fetch a collection of resources.
```sh-session
USAGE
$ commercelayer provisioning:list RESOURCE [-i ...] [-f ...] [-u -j] [-l curl|node [--doc | -R]]
[--curl ] [--node ] [-H ] [-Y ] [-w ...] [-p ] [-n ] [-s ...] [-e ... | ]
ARGUMENTS
RESOURCE the resource type
FLAGS
-H, --headers show response headers
-R, --raw print out the raw API response
-Y, --headers-only show only response headers
-e, --extract=... extract subfields from object attributes
-f, --fields=... comma separeted list of fields in the format [resourceType/]field1,field2,field3
-i, --include=... comma separated resources to include
-j, --json convert output in standard JSON format
-n, --pageSize= number of elements per page
-p, --page= page number
-s, --sort=... define results ordering
-u, --unformatted print unformatted JSON output
-w, --where=... comma separated list of query filters
DOCUMENTATION FLAGS
-l, --lang= show the CLI command in the specified language syntax
--curl show the equivalent cURL command of the CLI command
--doc show the CLI command in a specific language
--node show the equivalent Node SDK source code of the CLI command
DESCRIPTION
fetch a collection of resources
ALIASES
$ commercelayer pl
$ commercelayer prov:list
$ commercelayer plist
$ commercelayer pls
EXAMPLES
$ commercelayer provisioning:list roles -f id,name -i organization -s updated_at
$ cl prov:list roles -i organization -f name -f organizations/name -w organization_name_eq="ORG NAME"
$ cl prov:list roles -p 5 -n 10 -s -created_at --raw
```
_See code: [src/commands/provisioning/list.ts](https://github.com/commercelayer/commercelayer-cli-plugin-provisioning/blob/main/src/commands/provisioning/list.ts)_
### `commercelayer provisioning:resources`
List all the available Provisioning API resources.
```sh-session
USAGE
$ commercelayer provisioning:resources [-h]
FLAGS
-h, --help Show CLI help.
DESCRIPTION
list all the available Provisioning API resources
ALIASES
$ commercelayer prov:resources
$ commercelayer pres
EXAMPLES
$ commercelayer provisioning:resources
$ cl prov:resources
```
_See code: [src/commands/provisioning/resources.ts](https://github.com/commercelayer/commercelayer-cli-plugin-provisioning/blob/main/src/commands/provisioning/resources.ts)_
### `commercelayer provisioning:retrieve RESOURCE [ID]`
Fetch a single resource.
```sh-session
USAGE
$ commercelayer provisioning:retrieve RESOURCE [ID] [-i ...] [-f ...] [-u -j] [-l curl|node [--doc | -R]]
[--curl ] [--node ] [-H ] [-Y ] [-e ... | ]
ARGUMENTS
RESOURCE the resource type
ID id of the resource to retrieve
FLAGS
-H, --headers show response headers
-R, --raw print out the raw API response
-Y, --headers-only show only response headers
-e, --extract=... extract subfields from object attributes
-f, --fields=... comma separeted list of fields in the format [resourceType/]field1,field2,field3
-i, --include=... comma separated resources to include
-j, --json convert output in standard JSON format
-u, --unformatted print unformatted JSON output
DOCUMENTATION FLAGS
-l, --lang= show the CLI command in the specified language syntax
--curl show the equivalent cURL command of the CLI command
--doc show the CLI command in a specific language
--node show the equivalent Node SDK source code of the CLI command
DESCRIPTION
fetch a single resource
ALIASES
$ commercelayer prov:retrieve
$ commercelayer pr
$ commercelayer pretrieve
EXAMPLES
$ commercelayer provisioning:retrieve roles/
$ commercelayer prov:retrieve roles
$ cl prov:retrieve roles
$ clayer pr roles/
```
_See code: [src/commands/provisioning/retrieve.ts](https://github.com/commercelayer/commercelayer-cli-plugin-provisioning/blob/main/src/commands/provisioning/retrieve.ts)_
### `commercelayer provisioning:update RESOURCE [ID]`
Update an existing resource.
```sh-session
USAGE
$ commercelayer provisioning:update RESOURCE [ID] [-i ...] [-f ...] [-u -j] [-l curl|node [--doc | -R]]
[--curl ] [--node ] [-H ] [-Y ] [-O ...] [-D | -a ... | -r ... | [-m ... | -M
...] | | ]
ARGUMENTS
RESOURCE the resource type
ID id of the resource to update
FLAGS
-D, --data= the data file to use as request body
-H, --headers show response headers
-M, --metadata-replace=... define a metadata attribute and replace every item already present in the remote
resource
-O, --object=... define a resource object attribute
-R, --raw print out the raw API response
-Y, --headers-only show only response headers
-a, --attribute=... define a resource attribute
-f, --fields=... comma separeted list of fields in the format [resourceType/]field1,field2,field3
-i, --include=... comma separated resources to include
-j, --json convert output in standard JSON format
-m, --metadata=... define a metadata attribute and merge it with the metadata already present in the
remote resource
-r, --relationship=... define a relationship with another resource
-u, --unformatted print unformatted JSON output
DOCUMENTATION FLAGS
-l, --lang= show the CLI command in the specified language syntax
--curl show the equivalent cURL command of the CLI command
--doc show the CLI command in a specific language
--node show the equivalent Node SDK source code of the CLI command
DESCRIPTION
update an existing resource
ALIASES
$ commercelayer prov:update
$ commercelayer pu
$ commercelayer pupdate
$ commercelayer pupd
EXAMPLES
$ commercelayer provisioning:update roles/ -a reference=referenceId
$ commercelayer prov:update roles -a reference_origin="Ref Origin"
$ cl prov:update roles/ -m meta_key="meta value"
$ cl pu roles -M meta_key="metadata overwrite
$ clayer prov:update roles -D /path/to/data/file/data.json
```
_See code: [src/commands/provisioning/update.ts](https://github.com/commercelayer/commercelayer-cli-plugin-provisioning/blob/main/src/commands/provisioning/update.ts)_