https://github.com/commercelayer/commercelayer-cli-plugin-links
https://github.com/commercelayer/commercelayer-cli-plugin-links
commercelayer
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/commercelayer/commercelayer-cli-plugin-links
- Owner: commercelayer
- License: mit
- Created: 2024-06-06T16:43:13.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-01-31T16:18:20.000Z (over 1 year ago)
- Last Synced: 2025-03-20T00:18:26.233Z (about 1 year ago)
- Topics: commercelayer
- Language: TypeScript
- Homepage:
- Size: 772 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# @commercelayer/cli-plugin-links
Commerce Layer CLI Links plugin
[](https://oclif.io)
[](https://npmjs.org/package/@commercelayer/cli-plugin-links)
[](https://npmjs.org/package/@commercelayer/cli-plugin-links)
[](https://github.com/@commercelayer/cli-plugin-links/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 links [ID]`](#commercelayer-links-id)
* [`commercelayer links:create`](#commercelayer-linkscreate)
* [`commercelayer links:delete ID`](#commercelayer-linksdelete-id)
* [`commercelayer links:details ID`](#commercelayer-linksdetails-id)
* [`commercelayer links:disable ID`](#commercelayer-linksdisable-id)
* [`commercelayer links:enable ID`](#commercelayer-linksenable-id)
* [`commercelayer links:list`](#commercelayer-linkslist)
* [`commercelayer links:open ID`](#commercelayer-linksopen-id)
* [`commercelayer links:resources`](#commercelayer-linksresources)
* [`commercelayer links:update ID`](#commercelayer-linksupdate-id)
### `commercelayer links [ID]`
List all the links or the details of a single link.
```sh-session
USAGE
$ commercelayer links [ID] [-A | -l ] [-n ] [-S ] [-s ...] [-e ...]
[--sort ...] [-L] [-H]
ARGUMENTS
ID unique id of the link to get a single link
FLAGS
-A, --all show all links instead of first 25 only
-H, --hide-empty hide empty attributes
-L, --locale show dates in locale time zone and format
-S, --link_scope= the scope of the link
-e, --expires=... the link's expiration date and time
-l, --limit= limit number of links in output
-n, --name= the name of the link
-s, --starts=... the link's start date and time
--sort=... a comma separated list of fields to sort by
DESCRIPTION
list all the links or the details of a single link
FLAG DESCRIPTIONS
-e, --expires=... the link's expiration date and time
Use the standard ISO format with operators [gt, gteq, eq, lt, lteq].
A maximum of 2 parameters can be used for date filters.
If the operator is omitted the default operator 'eq' will be used.
If only one parameter is defined without an operator, it is interpreted as a range of values
Examples:
-s 2024 will be translated into -s gteq=2024-01-01T00:00:00Z lt=2025-01-01T00:00:00Z
-s 2024-04-10 will be translated into -s gteq=2024-04-10T00:00:00Z lt=2024-04-11T00:00:00Z
-s 2024-04-10T13:15:00 will be translated into -s gteq 2024-04-10T13:15:00Z lt=2024-04-10T13:16:00Z
-s, --starts=... the link's start date and time
Look at the description of flag 'expires' for details
```
_See code: [src/commands/links/index.ts](https://github.com/commercelayer/commercelayer-cli-plugin-links/blob/main/src/commands/links/index.ts)_
### `commercelayer links:create`
Create a new resource link.
```sh-session
USAGE
$ commercelayer links:create [-t orders|skus|sku_lists] [-i ] [-I ] [-S ...] [-n ]
[-s ] [-e ] [-D ] [--open]
FLAGS
-D, --link_domain= [default: c11r.link] the domain of the link
-I, --client_id= the client_id of the application of kind sales_channel to be used with the link
-S, --link_scope=... the scope of the link
-e, --expires= the link's expiration date and time
-i, --item_id= the id of the resource for which the link is created
-n, --name= the name associated to the the link
-s, --starts= the link's start date and time
-t, --item_type= the type of the resource for which the link is created
--open open link in default browser
DESCRIPTION
create a new resource link
ALIASES
$ commercelayer link
EXAMPLES
$ commercelayer links:create -t -i -S market: -n -e 2050-12-15 -I
FLAG DESCRIPTIONS
-e, --expires= the link's expiration date and time
Use the standard ISO format:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#date_time_string_format
-s, --starts= the link's start date and time
Use the standard ISO format:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#date_time_string_format
```
_See code: [src/commands/links/create.ts](https://github.com/commercelayer/commercelayer-cli-plugin-links/blob/main/src/commands/links/create.ts)_
### `commercelayer links:delete ID`
Delete an existent resource link.
```sh-session
USAGE
$ commercelayer links:delete ID
ARGUMENTS
ID the id of the link
DESCRIPTION
delete an existent resource link
EXAMPLES
$ commercelayer links:delete
```
_See code: [src/commands/links/delete.ts](https://github.com/commercelayer/commercelayer-cli-plugin-links/blob/main/src/commands/links/delete.ts)_
### `commercelayer links:details ID`
Show link details.
```sh-session
USAGE
$ commercelayer links:details ID [-H] [-L]
ARGUMENTS
ID the id of the link
FLAGS
-H, --hide-empty hide empty attributes
-L, --locale show dates in locale time zone and format
DESCRIPTION
show link details
ALIASES
$ commercelayer links:show
$ commercelayer links:get
EXAMPLES
$ commercelayer links:details
$ cl links:details -H
$ cl links:show
```
_See code: [src/commands/links/details.ts](https://github.com/commercelayer/commercelayer-cli-plugin-links/blob/main/src/commands/links/details.ts)_
### `commercelayer links:disable ID`
Disable an existent enabled link.
```sh-session
USAGE
$ commercelayer links:disable ID
ARGUMENTS
ID the id of the link
DESCRIPTION
disable an existent enabled link
EXAMPLES
$ commercelayer links:disable
```
_See code: [src/commands/links/disable.ts](https://github.com/commercelayer/commercelayer-cli-plugin-links/blob/main/src/commands/links/disable.ts)_
### `commercelayer links:enable ID`
Enable an existent disabled link.
```sh-session
USAGE
$ commercelayer links:enable ID
ARGUMENTS
ID the id of the link
DESCRIPTION
enable an existent disabled link
EXAMPLES
$ commercelayer links:enable
```
_See code: [src/commands/links/enable.ts](https://github.com/commercelayer/commercelayer-cli-plugin-links/blob/main/src/commands/links/enable.ts)_
### `commercelayer links:list`
List all the created links.
```sh-session
USAGE
$ commercelayer links:list [-A | -l ] [-n ] [-S ] [-s ...] [-e ...] [--sort
...] [-L]
FLAGS
-A, --all show all links instead of first 25 only
-L, --locale show dates in locale time zone and format
-S, --link_scope= the scope of the link
-e, --expires=... the link's expiration date and time
-l, --limit= limit number of links in output
-n, --name= the name of the link
-s, --starts=... the link's start date and time
--sort=... a comma separated list of fields to sort by
DESCRIPTION
list all the created links
EXAMPLES
$ commercelayer links
$ cl links:list -A
$ cl links --status=pending
FLAG DESCRIPTIONS
-e, --expires=... the link's expiration date and time
Use the standard ISO format with operators [gt, gteq, eq, lt, lteq].
A maximum of 2 parameters can be used for date filters.
If the operator is omitted the default operator 'eq' will be used.
If only one parameter is defined without an operator, it is interpreted as a range of values
Examples:
-s 2024 will be translated into -s gteq=2024-01-01T00:00:00Z lt=2025-01-01T00:00:00Z
-s 2024-04-10 will be translated into -s gteq=2024-04-10T00:00:00Z lt=2024-04-11T00:00:00Z
-s 2024-04-10T13:15:00 will be translated into -s gteq 2024-04-10T13:15:00Z lt=2024-04-10T13:16:00Z
-s, --starts=... the link's start date and time
Look at the description of flag 'expires' for details
```
_See code: [src/commands/links/list.ts](https://github.com/commercelayer/commercelayer-cli-plugin-links/blob/main/src/commands/links/list.ts)_
### `commercelayer links:open ID`
Open an existent resource link.
```sh-session
USAGE
$ commercelayer links:open ID
ARGUMENTS
ID the id of the link
DESCRIPTION
open an existent resource link
EXAMPLES
$ commercelayer links:open
```
_See code: [src/commands/links/open.ts](https://github.com/commercelayer/commercelayer-cli-plugin-links/blob/main/src/commands/links/open.ts)_
### `commercelayer links:resources`
Show linkable resources.
```sh-session
USAGE
$ commercelayer links:resources [-O]
FLAGS
-O, --open open online documentation page
DESCRIPTION
show linkable resources
EXAMPLES
$ commercelayer links:resources
```
_See code: [src/commands/links/resources.ts](https://github.com/commercelayer/commercelayer-cli-plugin-links/blob/main/src/commands/links/resources.ts)_
### `commercelayer links:update ID`
Create a new resource link.
```sh-session
USAGE
$ commercelayer links:update ID [-t orders|skus|sku_lists] [-i ] [-I ] [-S ...] [-n
] [-s ] [-e ] [-D ] [--open]
ARGUMENTS
ID the id of the link
FLAGS
-D, --link_domain= [default: c11r.link] the domain of the link
-I, --client_id= the client_id of the application of kind sales_channel to be used with the link
-S, --link_scope=... the scope of the link
-e, --expires= the link's expiration date and time
-i, --item_id= the id of the resource for which the link is created
-n, --name= the name associated to the the link
-s, --starts= the link's start date and time
-t, --item_type= the type of the resource for which the link is created
--open open link in default browser
DESCRIPTION
create a new resource link
EXAMPLES
$ commercelayer links:update -t -i -S market: -n -e 2050-12-15 -I
FLAG DESCRIPTIONS
-e, --expires= the link's expiration date and time
Use the standard ISO format:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#date_time_string_format
-s, --starts= the link's start date and time
Use the standard ISO format:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#date_time_string_format
```
_See code: [src/commands/links/update.ts](https://github.com/commercelayer/commercelayer-cli-plugin-links/blob/main/src/commands/links/update.ts)_