Package Exports
- @commercelayer/cli-plugin-resources
- @commercelayer/cli-plugin-resources/lib/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@commercelayer/cli-plugin-resources) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@commercelayer/cli-plugin-resources
Commerce Layer CLI Resources plugin
Usage
To install as a Commerce Layer CLI plugin run the following command:
$ commercelayer plugins:install resourcesCommands
commercelayer resourcescommercelayer resources:argscommercelayer resources:create RESOURCEcommercelayer resources:delete RESOURCE [ID]commercelayer resources:doc RESOURCEcommercelayer resources:filterscommercelayer resources:get RESOURCE [ID]commercelayer resources:list RESOURCEcommercelayer resources:retrieve RESOURCE [ID]commercelayer resources:update RESOURCE [ID]
commercelayer resources
List all the available Commerce Layer API resources.
USAGE
$ commercelayer resources
OPTIONS
-h, --help Show CLI help.
EXAMPLES
$ cl-resources resources
$ cl-res resources
$ commercelayer resources
$ cl resourcesSee code: src/commands/resources/index.ts
commercelayer resources:args
Show all the saved command arguments.
USAGE
$ commercelayer resources:args
OPTIONS
-D, --delete delete saved arguments associated to the alias
-a, --alias=alias the alias associated to saved command arguments
-o, --operation=list|retrieve|create|update the resource operation
-r, --resource=resource the resource type
ALIASES
$ commercelayer res:argsSee code: src/commands/resources/args.ts
commercelayer resources:create RESOURCE
Create a new resource.
USAGE
$ commercelayer resources:create RESOURCE
ARGUMENTS
RESOURCE the resource type
OPTIONS
-D, --data=data the data file to use as request body
-D, --doc shows the CLI command in a specific language
-O, --object=object define a resource object attribute
-R, --raw print out the raw API response
-a, --attribute=attribute define a resource attribute
-f, --fields=fields comma separeted list of fields in the format [resource]=field1,field2...
-i, --include=include comma separated resources to include
-j, --json convert output in standard JSON format
-l, --lang=curl|node show the CLI command in the specified language syntax
-m, --metadata=metadata define a metadata attribute or a set of metadata attributes
-o, --organization=organization (required) the slug of your organization
-r, --relationship=relationship define a relationship with another resource
-u, --unformatted print unformatted JSON output
--curl show the equivalent cURL command of the CLI command
--load-args=load-args load previously saved command arguments
--node show the equivalent Node SDK source code of the CLI command
--save-args=save-args save command data to file for future use
ALIASES
$ commercelayer create
$ commercelayer rc
$ commercelayer res:create
$ commercelayer post
EXAMPLES
$ commercelayer resources:create customers -a email=user@test.com
$ clayer res:create customers -a email="user@test-com" -r customer_group=customer_groups/<customerGroupId>
$ cl create customers -a email=user@test.com -m meta_key="meta value"
$ cl rc customers -D /path/to/data/file/data.jsonSee code: src/commands/resources/create.ts
commercelayer resources:delete RESOURCE [ID]
Delete an existing resource.
USAGE
$ commercelayer resources:delete RESOURCE [ID]
ARGUMENTS
RESOURCE the resource type
ID id of the resource to retrieve
OPTIONS
-D, --doc shows the CLI command in a specific language
-R, --raw print out the raw API response
-f, --fields=fields comma separeted list of fields in the format [resource]=field1,field2...
-i, --include=include comma separated resources to include
-j, --json convert output in standard JSON format
-l, --lang=curl|node show the CLI command in the specified language syntax
-o, --organization=organization (required) the slug of your organization
-u, --unformatted print unformatted JSON output
--curl show the equivalent cURL command of the CLI command
--load-args=load-args load previously saved command arguments
--node show the equivalent Node SDK source code of the CLI command
--save-args=save-args save command data to file for future use
ALIASES
$ commercelayer delete
$ commercelayer rd
$ commercelayer res:delete
EXAMPLES
$ commercelayer resources:delete customers/<customerId>
$ cl delete customers <customerId>See code: src/commands/resources/delete.ts
commercelayer resources:doc RESOURCE
Open the default browser and show the online documentation for the resource.
USAGE
$ commercelayer resources:doc RESOURCE
ARGUMENTS
RESOURCE the resource for which you want to access the online documentation
ALIASES
$ commercelayer res:doc
EXAMPLES
$ commercelayer rdoc customers
$ cl res:doc cusatomersSee code: src/commands/resources/doc.ts
commercelayer resources:filters
Show a list of all available filter predicates.
USAGE
$ commercelayer resources:filters
ALIASES
$ commercelayer res:filters
EXAMPLES
$ commercelayer resources:filters
$ cl res:filtersSee code: src/commands/resources/filters.ts
commercelayer resources:get RESOURCE [ID]
Retrieve a resource or list a set of resources.
USAGE
$ commercelayer resources:get RESOURCE [ID]
ARGUMENTS
RESOURCE the resource type
ID id of the resource to retrieve
OPTIONS
-D, --doc shows the CLI command in a specific language
-R, --raw print out the raw API response
-X, --save-path=save-path save command output to file and create missing path directories
-e, --extract=extract extract subfields from object attributes
-f, --fields=fields comma separeted list of fields in the format [resource]=field1,field2...
-i, --include=include comma separated resources to include
-j, --json convert output in standard JSON format
-l, --lang=curl|node show the CLI command in the specified language syntax
-n, --pageSize=pageSize number of elements per page
-o, --organization=organization (required) the slug of your organization
-p, --page=page page number
-s, --sort=sort defines results ordering
-u, --unformatted print unformatted JSON output
-w, --where=where comma separated list of query filters
-x, --save=save save command output to file
--curl show the equivalent cURL command of the CLI command
--load-args=load-args load previously saved command arguments
--node show the equivalent Node SDK source code of the CLI command
--save-args=save-args save command data to file for future use
ALIASES
$ commercelayer get
$ commercelayer res:get
EXAMPLES
$ commercelayer resources:get customers
$ commercelayer res:get customers
$ clayer res:get customers/<customerId>
$ cl get customers <customerId>See code: src/commands/resources/get.ts
commercelayer resources:list RESOURCE
Fetch a collection of resources.
USAGE
$ commercelayer resources:list RESOURCE
ARGUMENTS
RESOURCE the resource type
OPTIONS
-D, --doc shows the CLI command in a specific language
-R, --raw print out the raw API response
-X, --save-path=save-path save command output to file and create missing path directories
-e, --extract=extract extract subfields from object attributes
-f, --fields=fields comma separeted list of fields in the format [resource]=field1,field2...
-i, --include=include comma separated resources to include
-j, --json convert output in standard JSON format
-l, --lang=curl|node show the CLI command in the specified language syntax
-n, --pageSize=pageSize number of elements per page
-o, --organization=organization (required) the slug of your organization
-p, --page=page page number
-s, --sort=sort defines results ordering
-u, --unformatted print unformatted JSON output
-w, --where=where comma separated list of query filters
-x, --save=save save command output to file
--curl show the equivalent cURL command of the CLI command
--load-args=load-args load previously saved command arguments
--node show the equivalent Node SDK source code of the CLI command
--save-args=save-args save command data to file for future use
ALIASES
$ commercelayer list
$ commercelayer rl
$ commercelayer res:list
EXAMPLES
$ commercelayer resources:list customers -f id,email -i customer_group -s updated_at
$ cl res:list -i customer_group -f customer_groups/name -w customer_group_name_eq="GROUP NAME"
$ cl list -p 5 -n 10 -s -created_at --rawSee code: src/commands/resources/list.ts
commercelayer resources:retrieve RESOURCE [ID]
Fetch a single resource.
USAGE
$ commercelayer resources:retrieve RESOURCE [ID]
ARGUMENTS
RESOURCE the resource type
ID id of the resource to retrieve
OPTIONS
-D, --doc shows the CLI command in a specific language
-R, --raw print out the raw API response
-X, --save-path=save-path save command output to file and create missing path directories
-e, --extract=extract extract subfields from object attributes
-f, --fields=fields comma separeted list of fields in the format [resource]=field1,field2...
-i, --include=include comma separated resources to include
-j, --json convert output in standard JSON format
-l, --lang=curl|node show the CLI command in the specified language syntax
-o, --organization=organization (required) the slug of your organization
-u, --unformatted print unformatted JSON output
-x, --save=save save command output to file
--curl show the equivalent cURL command of the CLI command
--load-args=load-args load previously saved command arguments
--node show the equivalent Node SDK source code of the CLI command
--save-args=save-args save command data to file for future use
ALIASES
$ commercelayer retrieve
$ commercelayer rr
$ commercelayer res:retrieve
EXAMPLES
$ commercelayer resources:retrieve customers/<customerId>
$ commercelayer retrieve customers <customerId>
$ cl res:retrieve customers <customerId>
$ clayer rr customers/<customerId>See code: src/commands/resources/retrieve.ts
commercelayer resources:update RESOURCE [ID]
Update an existing resource.
USAGE
$ commercelayer resources:update RESOURCE [ID]
ARGUMENTS
RESOURCE the resource type
ID id of the resource to update
OPTIONS
-D, --data=data the data file to use as request body
-D, --doc shows the CLI command in a specific language
-M, --metadata-replace=metadata-replace define a metadata attribute and replace every item already presente in the
remote resource
-O, --object=object define a resource object attribute
-R, --raw print out the raw API response
-a, --attribute=attribute define a resource attribute
-f, --fields=fields comma separeted list of fields in the format [resource]=field1,field2...
-i, --include=include comma separated resources to include
-j, --json convert output in standard JSON format
-l, --lang=curl|node show the CLI command in the specified language syntax
-m, --metadata=metadata define a metadata attribute and merge it with the metadata already present in
the remote resource
-o, --organization=organization (required) the slug of your organization
-r, --relationship=relationship define a relationship with another resource
-u, --unformatted print unformatted JSON output
--curl show the equivalent cURL command of the CLI command
--load-args=load-args load previously saved command arguments
--node show the equivalent Node SDK source code of the CLI command
--save-args=save-args save command data to file for future use
ALIASES
$ commercelayer update
$ commercelayer ru
$ commercelayer res:update
$ commercelayer patch
EXAMPLES
$ commercelayer resources:update customers/<customerId> -a reference=referenceId
$ commercelayer res:update customers <customerId> -a reference_origin="Ref Origin"
$ cl update customers/<customerId> -m meta_key="meta value"
$ cl ru customers <customerId> -M mete_keu="metadata overwrite
$ clayer update customers <customerId> -D /path/to/data/file/data.jsonSee code: src/commands/resources/update.ts