@highlightxyz/cli 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +72 -81
- package/lib/index.js +67 -7
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -1,30 +1,55 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Highlight CLI
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
Use `hl` to manage Highlight from a terminal, script, CI job, or agent. It
|
|
4
|
+
covers collections, deployment, sales, gates, media, tokens, contracts, and
|
|
5
|
+
chain configuration.
|
|
6
|
+
|
|
7
|
+
The CLI is built on `@highlightxyz/sdk`. It calls the same API and follows the
|
|
8
|
+
same validation rules as the SDK and REST API.
|
|
9
|
+
|
|
10
|
+
[Read the CLI documentation](https://docs.highlight.xyz/cli/setup/).
|
|
6
11
|
|
|
7
12
|
## Install
|
|
8
13
|
|
|
14
|
+
```sh
|
|
15
|
+
npm install --global @highlightxyz/cli
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Or use Bun:
|
|
19
|
+
|
|
9
20
|
```sh
|
|
10
21
|
bun add --global @highlightxyz/cli
|
|
11
22
|
```
|
|
12
23
|
|
|
13
|
-
Node.js 20 or later
|
|
24
|
+
The CLI requires Node.js 20 or later.
|
|
25
|
+
|
|
26
|
+
Verify the installation:
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
hl --version
|
|
30
|
+
hl --help
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
You can run public commands before signing in:
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
hl chains list --testnet
|
|
37
|
+
```
|
|
14
38
|
|
|
15
39
|
## Authenticate
|
|
16
40
|
|
|
17
|
-
Create an API key in Highlight, then
|
|
41
|
+
Create an API key in Highlight, then save and verify it:
|
|
18
42
|
|
|
19
43
|
```sh
|
|
20
44
|
hl auth login
|
|
45
|
+
hl auth status
|
|
21
46
|
```
|
|
22
47
|
|
|
23
|
-
For CI and agents,
|
|
48
|
+
For CI and agents, set the key in the process environment:
|
|
24
49
|
|
|
25
50
|
```sh
|
|
26
51
|
export HIGHLIGHT_API_KEY="hl_live_..."
|
|
27
|
-
hl auth status
|
|
52
|
+
hl auth status --json
|
|
28
53
|
```
|
|
29
54
|
|
|
30
55
|
Named profiles and custom API URLs are supported:
|
|
@@ -34,11 +59,11 @@ hl auth login --profile staging --api-url http://localhost:8787
|
|
|
34
59
|
hl collections list --profile staging
|
|
35
60
|
```
|
|
36
61
|
|
|
37
|
-
|
|
38
|
-
`
|
|
39
|
-
saved configuration.
|
|
62
|
+
On macOS and Linux, saved keys live in
|
|
63
|
+
`~/.config/highlight/config.json` with mode `0600`. `HIGHLIGHT_API_KEY`,
|
|
64
|
+
`HIGHLIGHT_API_URL`, and `HIGHLIGHT_CONFIG_DIR` override saved configuration.
|
|
40
65
|
|
|
41
|
-
##
|
|
66
|
+
## Core commands
|
|
42
67
|
|
|
43
68
|
```sh
|
|
44
69
|
hl collections list
|
|
@@ -47,75 +72,23 @@ hl collections create --input collection.json
|
|
|
47
72
|
hl collections deploy <highlight-id> --wait
|
|
48
73
|
hl collections deploy-status <highlight-id>
|
|
49
74
|
hl collections deploy-cancel <highlight-id>
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
Creation input uses the SDK's `collection.create` shape:
|
|
53
|
-
|
|
54
|
-
```json
|
|
55
|
-
{
|
|
56
|
-
"name": "My Drop",
|
|
57
|
-
"description": "Created with the Highlight CLI",
|
|
58
|
-
"type": "OpenEdition",
|
|
59
|
-
"logoMediaId": "00000000-0000-0000-0000-000000000000",
|
|
60
|
-
"image": "https://assets.example/art.png",
|
|
61
|
-
"contract": {
|
|
62
|
-
"chainId": 84532,
|
|
63
|
-
"name": "My Drop",
|
|
64
|
-
"symbol": "DROP",
|
|
65
|
-
"standard": "ERC721"
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
Use `--input -` to read JSON from stdin.
|
|
71
|
-
|
|
72
|
-
## Sales
|
|
73
75
|
|
|
74
|
-
```sh
|
|
75
76
|
hl sales list <highlight-id>
|
|
76
77
|
hl sales create <highlight-id> --input sale.json
|
|
77
78
|
hl sales update <highlight-id> <sale-id> --input sale-update.json
|
|
78
79
|
hl sales delete <highlight-id> <sale-id>
|
|
79
|
-
```
|
|
80
80
|
|
|
81
|
-
Sale input uses the SDK's `collection.addSale` body shape:
|
|
82
|
-
|
|
83
|
-
```json
|
|
84
|
-
{
|
|
85
|
-
"type": "FIXED_PRICE",
|
|
86
|
-
"accessMode": "PUBLIC",
|
|
87
|
-
"startAt": "2026-01-01T00:00:00.000Z",
|
|
88
|
-
"price": "0.01",
|
|
89
|
-
"currency": "ETH",
|
|
90
|
-
"maxPerTransaction": 5,
|
|
91
|
-
"maxPerWallet": 10,
|
|
92
|
-
"maxTotal": 100,
|
|
93
|
-
"paymentRecipient": "0x0000000000000000000000000000000000000001"
|
|
94
|
-
}
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
The API enforces the collection functionality matrices. Unsupported
|
|
98
|
-
combinations, such as gated ranked auctions, return the canonical domain error.
|
|
99
|
-
Live public sale changes can return a transaction payload that requires a
|
|
100
|
-
wallet signature.
|
|
101
|
-
|
|
102
|
-
## Gates
|
|
103
|
-
|
|
104
|
-
```sh
|
|
105
81
|
hl gates list
|
|
106
82
|
hl gates get <gate-id>
|
|
107
83
|
hl gates create --input gate.json
|
|
108
84
|
hl gates update <gate-id> --input gate-update.json
|
|
109
85
|
hl gates delete <gate-id>
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
Gate JSON uses the SDK `gate.create` or `gate.update` body shape and supports
|
|
113
|
-
allowlists, token ownership, specific tokens, token attributes, currency
|
|
114
|
-
balances, and Farcaster follows.
|
|
115
86
|
|
|
116
|
-
|
|
87
|
+
hl media upload ./art.png
|
|
88
|
+
hl media upload ./generative-code.zip --kind directory
|
|
89
|
+
hl media get <media-id>
|
|
90
|
+
hl media publish <media-id>
|
|
117
91
|
|
|
118
|
-
```sh
|
|
119
92
|
hl contracts list
|
|
120
93
|
hl contracts get <contract-id>
|
|
121
94
|
|
|
@@ -129,30 +102,48 @@ hl chains list --testnet
|
|
|
129
102
|
hl chains system-contract 84532 MintManager
|
|
130
103
|
```
|
|
131
104
|
|
|
132
|
-
|
|
133
|
-
Contract queries and token reveal redrives require authentication.
|
|
134
|
-
|
|
135
|
-
## Media
|
|
105
|
+
Run group help for every option:
|
|
136
106
|
|
|
137
107
|
```sh
|
|
138
|
-
hl
|
|
139
|
-
hl
|
|
140
|
-
hl media
|
|
141
|
-
hl media publish <media-id>
|
|
108
|
+
hl collections --help
|
|
109
|
+
hl sales --help
|
|
110
|
+
hl media --help
|
|
142
111
|
```
|
|
143
112
|
|
|
144
|
-
|
|
113
|
+
Collection, sale, and gate writes accept JSON with `--input <file>`. Use
|
|
114
|
+
`--input -` to read it from stdin.
|
|
115
|
+
|
|
116
|
+
## Current boundaries
|
|
117
|
+
|
|
118
|
+
`hl collections create` creates the base draft. Version `0.1.0` does not
|
|
119
|
+
configure edition, series, or generative details, so complete those fields in
|
|
120
|
+
the dashboard, SDK, or REST API before deployment.
|
|
121
|
+
|
|
122
|
+
The CLI does not read or store wallet keys. When deployment or a live sale
|
|
123
|
+
change needs an on-chain transaction, it prints the payload for a wallet to
|
|
124
|
+
sign. It does not broadcast that transaction or submit its hash for tracking.
|
|
125
|
+
|
|
126
|
+
Auction configuration is available through the generic sale commands. Bids,
|
|
127
|
+
claims, standings, settlement, and earnings actions remain SDK or REST
|
|
128
|
+
operations.
|
|
145
129
|
|
|
146
130
|
## Automation
|
|
147
131
|
|
|
148
|
-
Pass `--json` anywhere in
|
|
149
|
-
output:
|
|
132
|
+
Pass `--json` anywhere in a command for machine-readable output:
|
|
150
133
|
|
|
151
134
|
```sh
|
|
152
135
|
hl collections list --json
|
|
153
136
|
hl media upload ./art.png --json
|
|
154
137
|
```
|
|
155
138
|
|
|
156
|
-
|
|
139
|
+
Successful JSON goes to stdout. Errors go to stderr. Commands return:
|
|
140
|
+
|
|
141
|
+
- `0` on success
|
|
142
|
+
- `1` for API, authentication, filesystem, timeout, or processing failures
|
|
143
|
+
- `2` for invalid commands, options, arguments, or JSON input
|
|
157
144
|
|
|
158
|
-
|
|
145
|
+
Pin the package version in production automation:
|
|
146
|
+
|
|
147
|
+
```sh
|
|
148
|
+
npm install --global @highlightxyz/cli@0.1.0
|
|
149
|
+
```
|
package/lib/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// package.json
|
|
3
3
|
var package_default = {
|
|
4
4
|
name: "@highlightxyz/cli",
|
|
5
|
-
version: "0.
|
|
5
|
+
version: "0.2.0",
|
|
6
6
|
description: "Official command-line interface for the Highlight API",
|
|
7
7
|
keywords: [
|
|
8
8
|
"cli",
|
|
@@ -18,13 +18,16 @@ var package_default = {
|
|
|
18
18
|
url: "https://github.com/highlight-xyz/highlight-app.git",
|
|
19
19
|
directory: "packages/cli"
|
|
20
20
|
},
|
|
21
|
+
bin: {
|
|
22
|
+
hl: "./lib/index.js"
|
|
23
|
+
},
|
|
21
24
|
files: [
|
|
22
25
|
"lib",
|
|
23
26
|
"README.md"
|
|
24
27
|
],
|
|
25
28
|
type: "module",
|
|
26
|
-
|
|
27
|
-
|
|
29
|
+
publishConfig: {
|
|
30
|
+
access: "public"
|
|
28
31
|
},
|
|
29
32
|
scripts: {
|
|
30
33
|
build: "bun build ./src/index.ts --outfile ./lib/index.js --target node --format esm",
|
|
@@ -45,9 +48,6 @@ var package_default = {
|
|
|
45
48
|
},
|
|
46
49
|
engines: {
|
|
47
50
|
node: ">=20"
|
|
48
|
-
},
|
|
49
|
-
publishConfig: {
|
|
50
|
-
access: "public"
|
|
51
51
|
}
|
|
52
52
|
};
|
|
53
53
|
|
|
@@ -2096,6 +2096,62 @@ class Tx extends HeyApiClient {
|
|
|
2096
2096
|
}
|
|
2097
2097
|
}
|
|
2098
2098
|
|
|
2099
|
+
class Profile extends HeyApiClient {
|
|
2100
|
+
get(options) {
|
|
2101
|
+
return (options?.client ?? this.client).get({ url: "/user/profile", ...options });
|
|
2102
|
+
}
|
|
2103
|
+
update(parameters, options) {
|
|
2104
|
+
const params = buildClientParams([parameters], [
|
|
2105
|
+
{
|
|
2106
|
+
args: [
|
|
2107
|
+
{ in: "body", key: "displayName" },
|
|
2108
|
+
{ in: "body", key: "bio" },
|
|
2109
|
+
{ in: "body", key: "website" },
|
|
2110
|
+
{ in: "body", key: "avatarMediaId" }
|
|
2111
|
+
]
|
|
2112
|
+
}
|
|
2113
|
+
]);
|
|
2114
|
+
return (options?.client ?? this.client).patch({
|
|
2115
|
+
url: "/user/profile",
|
|
2116
|
+
...options,
|
|
2117
|
+
...params,
|
|
2118
|
+
headers: {
|
|
2119
|
+
"Content-Type": "application/json",
|
|
2120
|
+
...options?.headers,
|
|
2121
|
+
...params.headers
|
|
2122
|
+
}
|
|
2123
|
+
});
|
|
2124
|
+
}
|
|
2125
|
+
public(parameters, options) {
|
|
2126
|
+
const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "walletAddress" }] }]);
|
|
2127
|
+
return (options?.client ?? this.client).get({
|
|
2128
|
+
url: "/user/{walletAddress}/profile",
|
|
2129
|
+
...options,
|
|
2130
|
+
...params
|
|
2131
|
+
});
|
|
2132
|
+
}
|
|
2133
|
+
tokens(parameters, options) {
|
|
2134
|
+
const params = buildClientParams([parameters], [
|
|
2135
|
+
{
|
|
2136
|
+
args: [
|
|
2137
|
+
{ in: "path", key: "walletAddress" },
|
|
2138
|
+
{ in: "query", key: "page" },
|
|
2139
|
+
{ in: "query", key: "limit" },
|
|
2140
|
+
{ in: "query", key: "sort" },
|
|
2141
|
+
{ in: "query", key: "order" },
|
|
2142
|
+
{ in: "query", key: "collectionId" },
|
|
2143
|
+
{ in: "query", key: "search" }
|
|
2144
|
+
]
|
|
2145
|
+
}
|
|
2146
|
+
]);
|
|
2147
|
+
return (options?.client ?? this.client).get({
|
|
2148
|
+
url: "/user/{walletAddress}/tokens",
|
|
2149
|
+
...options,
|
|
2150
|
+
...params
|
|
2151
|
+
});
|
|
2152
|
+
}
|
|
2153
|
+
}
|
|
2154
|
+
|
|
2099
2155
|
class Siwe extends HeyApiClient {
|
|
2100
2156
|
nonce(options) {
|
|
2101
2157
|
return (options?.client ?? this.client).post({ url: "/user/signin/siwe/nonce", ...options });
|
|
@@ -2239,6 +2295,10 @@ class HighlightClient extends HeyApiClient {
|
|
|
2239
2295
|
get tx() {
|
|
2240
2296
|
return this._tx ??= new Tx({ client: this.client });
|
|
2241
2297
|
}
|
|
2298
|
+
_profile;
|
|
2299
|
+
get profile() {
|
|
2300
|
+
return this._profile ??= new Profile({ client: this.client });
|
|
2301
|
+
}
|
|
2242
2302
|
_user;
|
|
2243
2303
|
get user() {
|
|
2244
2304
|
return this._user ??= new User({ client: this.client });
|
|
@@ -2286,7 +2346,7 @@ var resolveMediaUrl = (media, options) => {
|
|
|
2286
2346
|
// src/config.ts
|
|
2287
2347
|
import { chmod, mkdir, readFile, rename, writeFile } from "node:fs/promises";
|
|
2288
2348
|
import path from "node:path";
|
|
2289
|
-
var DEFAULT_API_URL = "https://api.
|
|
2349
|
+
var DEFAULT_API_URL = "https://api.highlight.xyz";
|
|
2290
2350
|
var CONFIG_VERSION = 1;
|
|
2291
2351
|
var defaultConfig = () => ({
|
|
2292
2352
|
currentProfile: "default",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@highlightxyz/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Official command-line interface for the Highlight API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -16,13 +16,16 @@
|
|
|
16
16
|
"url": "https://github.com/highlight-xyz/highlight-app.git",
|
|
17
17
|
"directory": "packages/cli"
|
|
18
18
|
},
|
|
19
|
+
"bin": {
|
|
20
|
+
"hl": "./lib/index.js"
|
|
21
|
+
},
|
|
19
22
|
"files": [
|
|
20
23
|
"lib",
|
|
21
24
|
"README.md"
|
|
22
25
|
],
|
|
23
26
|
"type": "module",
|
|
24
|
-
"
|
|
25
|
-
"
|
|
27
|
+
"publishConfig": {
|
|
28
|
+
"access": "public"
|
|
26
29
|
},
|
|
27
30
|
"scripts": {
|
|
28
31
|
"build": "bun build ./src/index.ts --outfile ./lib/index.js --target node --format esm",
|
|
@@ -43,8 +46,5 @@
|
|
|
43
46
|
},
|
|
44
47
|
"engines": {
|
|
45
48
|
"node": ">=20"
|
|
46
|
-
},
|
|
47
|
-
"publishConfig": {
|
|
48
|
-
"access": "public"
|
|
49
49
|
}
|
|
50
50
|
}
|