@hostlink/hostlink-cli 1.0.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 +235 -0
- package/dist/bundle.js +32587 -0
- package/index.js +34 -0
- package/package.json +38 -0
package/README.md
ADDED
|
@@ -0,0 +1,235 @@
|
|
|
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)
|