@hostlink/hostlink-cli 1.0.0 → 1.0.2

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.
Files changed (4) hide show
  1. package/README.md +258 -235
  2. package/dist/bundle.js +32839 -29
  3. package/index.js +36 -34
  4. package/package.json +39 -38
package/README.md CHANGED
@@ -1,235 +1,258 @@
1
- # hostlink-cli
2
-
3
- CLI tool for the [HostLink](https://www.hostlink.com.hk) platform, powered by the [isapi.hostlink.com.hk](https://isapi.hostlink.com.hk/) GraphQL API.
4
-
5
- ## Installation
6
-
7
- ```bash
8
- npm install -g @hostlink/hostlink-cli
9
- ```
10
-
11
- ## Getting Started
12
-
13
- Generate your API token from the HostLink portal, then save it:
14
-
15
- ```bash
16
- hostlink set-token YOUR_TOKEN
17
- ```
18
-
19
- ---
20
-
21
- ## Commands
22
-
23
- ### `hostlink me`
24
-
25
- Show the current logged-in user's profile.
26
-
27
- ```bash
28
- hostlink me
29
- hostlink me --json
30
- ```
31
-
32
- ---
33
-
34
- ### `hostlink clients`
35
-
36
- Manage clients.
37
-
38
- ```bash
39
- # List clients
40
- hostlink clients list
41
- hostlink clients list --limit 20 --offset 0
42
- hostlink clients list --search "HostLink"
43
- hostlink clients list --json
44
-
45
- # Get a client by ID
46
- hostlink clients get <id>
47
- hostlink clients get <id> --json
48
-
49
- # Update a client
50
- hostlink clients update <id> --client-name "New Name" --client-email "email@example.com"
51
-
52
- # Delete a client
53
- hostlink clients delete <id>
54
- ```
55
-
56
- **Update options:**
57
-
58
- | Option | Description |
59
- |---|---|
60
- | `--client-name` | Client name |
61
- | `--client-email` | Email |
62
- | `--client-phone` | Phone |
63
- | `--client-fax` | Fax |
64
- | `--client-addr1~3` | Address lines |
65
- | `--client-city` | City |
66
- | `--client-website` | Website |
67
- | `--br-no` | BR number |
68
- | `--br-expiry-date` | BR expiry date |
69
- | `--remark` | Remark |
70
- | `--join-date` | Join date |
71
- | `--suspend-date` | Suspend date |
72
- | `--termination-date` | Termination date |
73
- | `--bill-name` | Billing name |
74
- | `--bill-email` | Billing email |
75
- | `--bill-phone` | Billing phone |
76
-
77
- ---
78
-
79
- ### `hostlink domains`
80
-
81
- Manage domains.
82
-
83
- ```bash
84
- # List domains
85
- hostlink domains list
86
- hostlink domains list --client <client_id>
87
- hostlink domains list --search "example.com"
88
- hostlink domains list --json
89
-
90
- # Get a domain by ID
91
- hostlink domains get <id>
92
- hostlink domains get <id> --json
93
-
94
- # Add a domain
95
- hostlink domains add --client-id <id> --domain-name "example.com" --expiry-date "2027-01-01" --registrar "GoDaddy"
96
-
97
- # Update a domain
98
- hostlink domains update <id> --expiry-date "2028-01-01" --remark "renewed"
99
-
100
- # Delete a domain
101
- hostlink domains delete <id>
102
- ```
103
-
104
- **Add / Update options:**
105
-
106
- | Option | Description |
107
- |---|---|
108
- | `--client-id` | Client ID |
109
- | `--domain-name` | Domain name |
110
- | `--expiry-date` | Expiry date |
111
- | `--creation-date` | Creation date |
112
- | `--registrar` | Registrar |
113
- | `--primary-dns` | Primary DNS |
114
- | `--secondary-dns` | Secondary DNS |
115
- | `--domain-user-id` | Domain user ID |
116
- | `--domain-password` | Domain password |
117
- | `--domain-type` | Domain type |
118
- | `--remark` | Remark |
119
- | `--server-id` | Server ID |
120
- | `--status` | Status |
121
- | `--is-project` | Mark as project |
122
- | `--is-vm` | Mark as VM |
123
-
124
- ---
125
-
126
- ### `hostlink quotations`
127
-
128
- Manage quotations.
129
-
130
- ```bash
131
- # List quotations
132
- hostlink quotations list
133
- hostlink quotations list --client <client_id>
134
- hostlink quotations list --search "ABC Ltd"
135
- hostlink quotations list --status "pending"
136
- hostlink quotations list --json
137
-
138
- # Get a quotation by ID
139
- hostlink quotations get <id>
140
- hostlink quotations get <id> --json
141
-
142
- # Add a quotation
143
- hostlink quotations add --client-id <id> --client-name "ABC Ltd" --quotation-date "2026-03-20" --due-date "2026-04-20"
144
-
145
- # Update a quotation
146
- hostlink quotations update <id> --status "approved" --sign-date "2026-03-25"
147
-
148
- # Delete a quotation
149
- hostlink quotations delete <id>
150
- ```
151
-
152
- **Add / Update options:**
153
-
154
- | Option | Description |
155
- |---|---|
156
- | `--client-id` | Client ID |
157
- | `--client-name` | Client name |
158
- | `--quotation-date` | Quotation date (YYYY-MM-DD) |
159
- | `--due-date` | Due date (YYYY-MM-DD) |
160
- | `--sign-date` | Sign date (YYYY-MM-DD) |
161
- | `--email` | Email |
162
- | `--phone` | Phone |
163
- | `--addr1~3` | Address lines |
164
- | `--city` | City |
165
- | `--note` | Note |
166
- | `--remark` | Remark |
167
- | `--header` | Header text |
168
- | `--status` | Status |
169
- | `--service-type` | Service type |
170
- | `--quotation-type` | Quotation type |
171
- | `--renew` | Mark as renewal |
172
-
173
- ---
174
-
175
- ### `hostlink quotation-items`
176
-
177
- Manage items within a quotation. Each quotation can have multiple items.
178
-
179
- ```bash
180
- # List all items in a quotation
181
- hostlink quotation-items list <quotation_id>
182
- hostlink quotation-items list <quotation_id> --json
183
-
184
- # Get an item by ID
185
- hostlink quotation-items get <id>
186
- hostlink quotation-items get <id> --json
187
-
188
- # Add an item to a quotation
189
- hostlink quotation-items add --quotation-id <id> --name "Web Hosting" --unit-price 500 --unit-month 12 --unit-quantity 1
190
-
191
- # Update an item
192
- hostlink quotation-items update <id> --unit-price 600 --discount 10
193
-
194
- # Delete an item
195
- hostlink quotation-items delete <id>
196
- ```
197
-
198
- **Add / Update options:**
199
-
200
- | Option | Description |
201
- |---|---|
202
- | `--quotation-id` | Quotation ID *(required for add)* |
203
- | `--name` | Item name *(required for add)* |
204
- | `--unit-price` | Unit price |
205
- | `--unit-month` | Number of months (default: 1) |
206
- | `--unit-quantity` | Quantity |
207
- | `--discount` | Discount percentage |
208
- | `--remark` | Remark |
209
- | `--sequence` | Display sequence order |
210
- | `--service-id` | Service ID |
211
- | `--domain-id` | Domain ID |
212
- | `--optional` | Mark as optional item |
213
- | `--accept` | Mark as accepted |
214
- | `--hidden-price` | Hide price |
215
- | `--hidden-quantity` | Hide quantity |
216
- | `--hidden-number` | Hide number |
217
- | `--page-break` | Insert page break after item |
218
-
219
- ---
220
-
221
- ## Global Options
222
-
223
- All list commands support:
224
-
225
- | Option | Description |
226
- |---|---|
227
- | `-l, --limit <n>` | Max records to return (default: 50) |
228
- | `-o, --offset <n>` | Records to skip (default: 0) |
229
- | `--json` | Output as JSON |
230
-
231
- ---
232
-
233
- ## License
234
-
235
- MIT © [HostLink](https://www.hostlink.com.hk)
1
+ # hostlink-cli
2
+
3
+ **CLI for the [HostLink](https://www.hostlink.com.hk) platform built for humans and AI agents.**
4
+
5
+ <p>
6
+ <a href="https://www.npmjs.com/package/@hostlink/hostlink-cli"><img src="https://img.shields.io/npm/v/@hostlink/hostlink-cli" alt="npm version"></a>
7
+ <a href="https://github.com/HostLink/hostlink-cli/blob/main/LICENSE"><img src="https://img.shields.io/github/license/HostLink/hostlink-cli" alt="license"></a>
8
+ </p>
9
+
10
+ ## Installation
11
+
12
+ ```bash
13
+ npm install -g @hostlink/hostlink-cli
14
+ ```
15
+
16
+ ## Authentication
17
+
18
+ Obtain your access token from the HostLink portal, then save it:
19
+
20
+ ```bash
21
+ hostlink set-token YOUR_TOKEN
22
+ ```
23
+
24
+ ---
25
+
26
+ ## AI Agent Skills
27
+
28
+ This repo ships Agent Skills (`SKILL.md` files) for every command — ready to use with GitHub Copilot, Cursor, and any MCP-compatible AI agent.
29
+
30
+ ```bash
31
+ # Install all hostlink skills at once
32
+ npx skills add https://github.com/HostLink/hostlink-cli
33
+
34
+ # Or pick only what you need
35
+ npx skills add https://github.com/HostLink/hostlink-cli/tree/main/skills/hostlink-me
36
+ npx skills add https://github.com/HostLink/hostlink-cli/tree/main/skills/hostlink-clients
37
+ npx skills add https://github.com/HostLink/hostlink-cli/tree/main/skills/hostlink-domains
38
+ npx skills add https://github.com/HostLink/hostlink-cli/tree/main/skills/hostlink-quotations
39
+ npx skills add https://github.com/HostLink/hostlink-cli/tree/main/skills/hostlink-quotation-items
40
+ ```
41
+
42
+ ---
43
+
44
+ ## Commands
45
+
46
+ ### `hostlink me`
47
+
48
+ Show the current logged-in user's profile.
49
+
50
+ ```bash
51
+ hostlink me
52
+ hostlink me --json
53
+ ```
54
+
55
+ ---
56
+
57
+ ### `hostlink clients`
58
+
59
+ Manage clients.
60
+
61
+ ```bash
62
+ # List clients
63
+ hostlink clients list
64
+ hostlink clients list --limit 20 --offset 0
65
+ hostlink clients list --search "HostLink"
66
+ hostlink clients list --json
67
+
68
+ # Get a client by ID
69
+ hostlink clients get <id>
70
+ hostlink clients get <id> --json
71
+
72
+ # Update a client
73
+ hostlink clients update <id> --client-name "New Name" --client-email "email@example.com"
74
+
75
+ # Delete a client
76
+ hostlink clients delete <id>
77
+ ```
78
+
79
+ **Update options:**
80
+
81
+ | Option | Description |
82
+ |---|---|
83
+ | `--client-name` | Client name |
84
+ | `--client-email` | Email |
85
+ | `--client-phone` | Phone |
86
+ | `--client-fax` | Fax |
87
+ | `--client-addr1~3` | Address lines |
88
+ | `--client-city` | City |
89
+ | `--client-website` | Website |
90
+ | `--br-no` | BR number |
91
+ | `--br-expiry-date` | BR expiry date |
92
+ | `--remark` | Remark |
93
+ | `--join-date` | Join date |
94
+ | `--suspend-date` | Suspend date |
95
+ | `--termination-date` | Termination date |
96
+ | `--bill-name` | Billing name |
97
+ | `--bill-email` | Billing email |
98
+ | `--bill-phone` | Billing phone |
99
+
100
+ ---
101
+
102
+ ### `hostlink domains`
103
+
104
+ Manage domains.
105
+
106
+ ```bash
107
+ # List domains
108
+ hostlink domains list
109
+ hostlink domains list --client <client_id>
110
+ hostlink domains list --search "example.com"
111
+ hostlink domains list --json
112
+
113
+ # Get a domain by ID
114
+ hostlink domains get <id>
115
+ hostlink domains get <id> --json
116
+
117
+ # Add a domain
118
+ hostlink domains add --client-id <id> --domain-name "example.com" --expiry-date "2027-01-01" --registrar "GoDaddy"
119
+
120
+ # Update a domain
121
+ hostlink domains update <id> --expiry-date "2028-01-01" --remark "renewed"
122
+
123
+ # Delete a domain
124
+ hostlink domains delete <id>
125
+ ```
126
+
127
+ **Add / Update options:**
128
+
129
+ | Option | Description |
130
+ |---|---|
131
+ | `--client-id` | Client ID |
132
+ | `--domain-name` | Domain name |
133
+ | `--expiry-date` | Expiry date |
134
+ | `--creation-date` | Creation date |
135
+ | `--registrar` | Registrar |
136
+ | `--primary-dns` | Primary DNS |
137
+ | `--secondary-dns` | Secondary DNS |
138
+ | `--domain-user-id` | Domain user ID |
139
+ | `--domain-password` | Domain password |
140
+ | `--domain-type` | Domain type |
141
+ | `--remark` | Remark |
142
+ | `--server-id` | Server ID |
143
+ | `--status` | Status |
144
+ | `--is-project` | Mark as project |
145
+ | `--is-vm` | Mark as VM |
146
+
147
+ ---
148
+
149
+ ### `hostlink quotations`
150
+
151
+ Manage quotations.
152
+
153
+ ```bash
154
+ # List quotations
155
+ hostlink quotations list
156
+ hostlink quotations list --client <client_id>
157
+ hostlink quotations list --search "ABC Ltd"
158
+ hostlink quotations list --status "pending"
159
+ hostlink quotations list --json
160
+
161
+ # Get a quotation by ID
162
+ hostlink quotations get <id>
163
+ hostlink quotations get <id> --json
164
+
165
+ # Add a quotation
166
+ hostlink quotations add --client-id <id> --client-name "ABC Ltd" --quotation-date "2026-03-20" --due-date "2026-04-20"
167
+
168
+ # Update a quotation
169
+ hostlink quotations update <id> --status "approved" --sign-date "2026-03-25"
170
+
171
+ # Delete a quotation
172
+ hostlink quotations delete <id>
173
+ ```
174
+
175
+ **Add / Update options:**
176
+
177
+ | Option | Description |
178
+ |---|---|
179
+ | `--client-id` | Client ID |
180
+ | `--client-name` | Client name |
181
+ | `--quotation-date` | Quotation date (YYYY-MM-DD) |
182
+ | `--due-date` | Due date (YYYY-MM-DD) |
183
+ | `--sign-date` | Sign date (YYYY-MM-DD) |
184
+ | `--email` | Email |
185
+ | `--phone` | Phone |
186
+ | `--addr1~3` | Address lines |
187
+ | `--city` | City |
188
+ | `--note` | Note |
189
+ | `--remark` | Remark |
190
+ | `--header` | Header text |
191
+ | `--status` | Status |
192
+ | `--service-type` | Service type |
193
+ | `--quotation-type` | Quotation type |
194
+ | `--renew` | Mark as renewal |
195
+
196
+ ---
197
+
198
+ ### `hostlink quotation-items`
199
+
200
+ Manage items within a quotation. Each quotation can have multiple items.
201
+
202
+ ```bash
203
+ # List all items in a quotation
204
+ hostlink quotation-items list <quotation_id>
205
+ hostlink quotation-items list <quotation_id> --json
206
+
207
+ # Get an item by ID
208
+ hostlink quotation-items get <id>
209
+ hostlink quotation-items get <id> --json
210
+
211
+ # Add an item to a quotation
212
+ hostlink quotation-items add --quotation-id <id> --name "Web Hosting" --unit-price 500 --unit-month 12 --unit-quantity 1
213
+
214
+ # Update an item
215
+ hostlink quotation-items update <id> --unit-price 600 --discount 10
216
+
217
+ # Delete an item
218
+ hostlink quotation-items delete <id>
219
+ ```
220
+
221
+ **Add / Update options:**
222
+
223
+ | Option | Description |
224
+ |---|---|
225
+ | `--quotation-id` | Quotation ID *(required for add)* |
226
+ | `--name` | Item name *(required for add)* |
227
+ | `--unit-price` | Unit price |
228
+ | `--unit-month` | Number of months (default: 1) |
229
+ | `--unit-quantity` | Quantity |
230
+ | `--discount` | Discount percentage |
231
+ | `--remark` | Remark |
232
+ | `--sequence` | Display sequence order |
233
+ | `--service-id` | Service ID |
234
+ | `--domain-id` | Domain ID |
235
+ | `--optional` | Mark as optional item |
236
+ | `--accept` | Mark as accepted |
237
+ | `--hidden-price` | Hide price |
238
+ | `--hidden-quantity` | Hide quantity |
239
+ | `--hidden-number` | Hide number |
240
+ | `--page-break` | Insert page break after item |
241
+
242
+ ---
243
+
244
+ ## Global Options
245
+
246
+ All list commands support:
247
+
248
+ | Option | Description |
249
+ |---|---|
250
+ | `-l, --limit <n>` | Max records to return (default: 50) |
251
+ | `-o, --offset <n>` | Records to skip (default: 0) |
252
+ | `--json` | Output as JSON |
253
+
254
+ ---
255
+
256
+ ## License
257
+
258
+ MIT © [HostLink](https://www.hostlink.com.hk)