ops-toolkit 1.2.0 โ 1.2.1
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/.release-it.json +1 -1
- package/README.md +258 -31
- package/bin/ops-toolkit.ts +4 -87
- package/dist/bin/ops-toolkit.js +11416 -0
- package/dist/index.js +10673 -2983
- package/docs/API.md +850 -0
- package/docs/ARCHITECTURE.md +433 -0
- package/docs/DEVELOPMENT.md +554 -0
- package/package.json +7 -7
- package/src/cli/app.ts +188 -0
- package/src/cli/command-discovery.ts +212 -0
- package/src/cli/command-registry.ts +136 -0
- package/src/commands/monitor/index.ts +199 -58
- package/src/index.ts +4 -77
- package/src/types/ui.ts +3 -3
- package/src/utils/config.ts +385 -64
- package/src/utils/error-handlers.ts +94 -0
- package/src/utils/error-reporter.ts +234 -0
- package/src/utils/index.ts +2 -0
- package/src/utils/logger.ts +418 -22
- package/src/utils/system.ts +26 -3
package/.release-it.json
CHANGED
package/README.md
CHANGED
|
@@ -1,23 +1,66 @@
|
|
|
1
1
|
# ops-toolkit
|
|
2
2
|
|
|
3
|
-
A comprehensive DevOps CLI toolkit with terminal UI built with Bun, TypeScript, and
|
|
3
|
+
A comprehensive DevOps CLI toolkit with terminal UI built with Bun, TypeScript, and modern architecture.
|
|
4
4
|
|
|
5
|
-
## Features
|
|
5
|
+
## โจ Features
|
|
6
6
|
|
|
7
|
-
- ๐
|
|
8
|
-
- ๐
|
|
9
|
-
- ๐
|
|
10
|
-
- โ๏ธ
|
|
11
|
-
- ๐จ
|
|
7
|
+
- ๐ **็ณป็ป็ๆง** - ๅฎๆถCPUใๅ
ๅญๅ็ฃ็ไฝฟ็จๆ
ๅต
|
|
8
|
+
- ๐ **ๆฅๅฟ็ฎก็** - ๆฅ็ใๆ็ดขๅๅๆๆฅๅฟ
|
|
9
|
+
- ๐ **้จ็ฝฒๅทฅๅ
ท** - ่ฝปๆพ้จ็ฝฒๅบ็จ็จๅบ
|
|
10
|
+
- โ๏ธ **็ณป็ป็ฎก็** - ็จๆทๅๆๅก็ฎก็
|
|
11
|
+
- ๐จ **็ป็ซฏUI** - ็พ่ง็็ป็ซฏ็้ข
|
|
12
|
+
- ๐๏ธ **ๆจกๅๅๆถๆ** - ๅฏๆฉๅฑ็ๆไปถ็ณป็ป
|
|
13
|
+
- ๐ก๏ธ **็ฑปๅๅฎๅ
จ** - ๅฎๆด็TypeScriptๆฏๆ
|
|
14
|
+
- ๐ **็ปๆๅๆฅๅฟ** - ๅค็บงๅซๆฅๅฟ่ฎฐๅฝ
|
|
15
|
+
- โก **้ซๆง่ฝ** - ๅผๆญฅๅค็ๅไผๅ
|
|
16
|
+
- ๐ง **้
็ฝฎ็ฎก็** - ็ตๆดป็้
็ฝฎ็ณป็ป
|
|
12
17
|
|
|
13
|
-
## Installation
|
|
18
|
+
## ๐ Installation
|
|
14
19
|
|
|
15
20
|
```bash
|
|
16
|
-
#
|
|
21
|
+
# ๅ
จๅฑๅฎ่ฃ
|
|
17
22
|
bun add -g ops-toolkit
|
|
18
23
|
|
|
19
|
-
#
|
|
24
|
+
# ไฝฟ็จ npx
|
|
20
25
|
npx ops-toolkit
|
|
26
|
+
|
|
27
|
+
# ไปๆบ็ ๅฎ่ฃ
|
|
28
|
+
git clone https://github.com/liangshaojie/ops-toolkit.git
|
|
29
|
+
cd ops-toolkit
|
|
30
|
+
bun install
|
|
31
|
+
bun run build
|
|
32
|
+
bun link
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## ๐โโ๏ธ Quick Start
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
# ๅฏๅจไบคไบๅผUI
|
|
39
|
+
ops
|
|
40
|
+
|
|
41
|
+
# ็ณป็ป็ๆง
|
|
42
|
+
ops monitor
|
|
43
|
+
ops monitor system # ็ณป็ป่ตๆบ
|
|
44
|
+
ops monitor processes # ่ฟ็จ็ๆง
|
|
45
|
+
ops monitor network # ็ฝ็ป็ๆง
|
|
46
|
+
|
|
47
|
+
# ๆฅๅฟ็ฎก็
|
|
48
|
+
ops logs # ไบคไบๅผๆฅๅฟๆฅ็ๅจ
|
|
49
|
+
ops logs view <file> # ๆฅ็็นๅฎๆฅๅฟๆไปถ
|
|
50
|
+
ops logs search <query> # ๆ็ดขๆฅๅฟ
|
|
51
|
+
ops logs tail <file> # ่ท่ธชๆฅๅฟๆไปถ
|
|
52
|
+
|
|
53
|
+
# ้จ็ฝฒๅทฅๅ
ท
|
|
54
|
+
ops deploy # ไบคไบๅผ้จ็ฝฒ
|
|
55
|
+
ops deploy <app> # ้จ็ฝฒ็นๅฎๅบ็จ
|
|
56
|
+
ops deploy rollback # ๅๆป้จ็ฝฒ
|
|
57
|
+
ops deploy status # ๆฃๆฅ้จ็ฝฒ็ถๆ
|
|
58
|
+
|
|
59
|
+
# ็ณป็ป็ฎก็
|
|
60
|
+
ops system # ็ณป็ป็ฎก็่ๅ
|
|
61
|
+
ops system users # ็จๆท็ฎก็
|
|
62
|
+
ops system services # ๆๅก็ฎก็
|
|
63
|
+
ops system config # ้
็ฝฎ็ฎก็
|
|
21
64
|
```
|
|
22
65
|
|
|
23
66
|
## Quick Start
|
|
@@ -77,30 +120,129 @@ ops system services # Service management
|
|
|
77
120
|
ops system config # Configuration management
|
|
78
121
|
```
|
|
79
122
|
|
|
80
|
-
##
|
|
123
|
+
## ๐๏ธ Architecture
|
|
124
|
+
|
|
125
|
+
Ops Toolkit ้็จ็ฐไปฃๅ็ๆจกๅๅๆถๆ่ฎพ่ฎก๏ผ
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
|
|
129
|
+
โ CLI ๅ
ฅๅฃๅฑ โ โ CLI ๆ ธๅฟๅฑ โ โ ๅฝไปคๅฑ โ
|
|
130
|
+
โโโโโโโโโโโโโโโโโโโค โโโโโโโโโโโโโโโโโโโโค โโโโโโโโโโโโโโโโโโโค
|
|
131
|
+
โ bin/ops-toolkit โ -> โ CLI App โ -> โ Monitor Cmd โ
|
|
132
|
+
โ src/index.ts โ โ CommandRegistry โ โ Logs Cmd โ
|
|
133
|
+
โ โ โ CommandDiscoveryโ โ Deploy Cmd โ
|
|
134
|
+
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โ System Cmd โ
|
|
135
|
+
โโโโโโโโโโโโโโโโโโโ
|
|
136
|
+
โ
|
|
137
|
+
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โ
|
|
138
|
+
โ ๅทฅๅ
ทๅฑ โ โ ็ฑปๅๅฎไน โ โ
|
|
139
|
+
โโโโโโโโโโโโโโโโโโโค โโโโโโโโโโโโโโโโโโโโค โ
|
|
140
|
+
โ Logger โ โ Commands Types โ <-------------โ
|
|
141
|
+
โ ConfigManager โ โ UI Types โ
|
|
142
|
+
โ ErrorHandler โ โ System Types โ
|
|
143
|
+
โ SystemUtils โ โ โ
|
|
144
|
+
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
่ฏฆ็ปๆถๆ่ฏทๅ่ [ๆถๆๆๆกฃ](docs/ARCHITECTURE.md)
|
|
148
|
+
|
|
149
|
+
## ๐ป Development
|
|
81
150
|
|
|
82
151
|
```bash
|
|
83
|
-
#
|
|
84
|
-
git clone https://github.com/
|
|
152
|
+
# ๅ
้ไปๅบ
|
|
153
|
+
git clone https://github.com/liangshaojie/ops-toolkit.git
|
|
85
154
|
cd ops-toolkit
|
|
86
155
|
|
|
87
|
-
#
|
|
156
|
+
# ๅฎ่ฃ
ไพ่ต
|
|
88
157
|
bun install
|
|
89
158
|
|
|
90
|
-
#
|
|
159
|
+
# ๅฏๅจๅผๅๆจกๅผ
|
|
91
160
|
bun run dev
|
|
92
161
|
|
|
93
|
-
#
|
|
162
|
+
# ๆๅปบ้กน็ฎ
|
|
94
163
|
bun run build
|
|
95
164
|
|
|
96
|
-
#
|
|
165
|
+
# ่ฟ่กๆต่ฏ
|
|
97
166
|
bun test
|
|
98
167
|
|
|
99
|
-
#
|
|
168
|
+
# ไปฃ็ ๆฃๆฅ
|
|
100
169
|
bun run lint
|
|
101
170
|
|
|
102
|
-
#
|
|
171
|
+
# ่ชๅจไฟฎๅค
|
|
172
|
+
bun run lint:fix
|
|
173
|
+
|
|
174
|
+
# ๆ ผๅผๅไปฃ็
|
|
103
175
|
bun run format
|
|
176
|
+
|
|
177
|
+
# ็ฑปๅๆฃๆฅ
|
|
178
|
+
bun run typecheck
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### ๅผๅๆๅ
|
|
182
|
+
|
|
183
|
+
่ฏฆ็ป็ๅผๅๆๅ่ฏทๅ่ [ๅผๅๆๆกฃ](docs/DEVELOPMENT.md)
|
|
184
|
+
|
|
185
|
+
### API ๆๆกฃ
|
|
186
|
+
|
|
187
|
+
ๅฎๆด็APIๆๆกฃ่ฏทๅ่ [APIๆๆกฃ](docs/API.md)
|
|
188
|
+
|
|
189
|
+
## โ๏ธ Configuration
|
|
190
|
+
|
|
191
|
+
้
็ฝฎๆไปถไฝไบ `~/.ops-toolkit/config.json`๏ผ
|
|
192
|
+
|
|
193
|
+
```json
|
|
194
|
+
{
|
|
195
|
+
"version": "1.2.0",
|
|
196
|
+
"environment": "development",
|
|
197
|
+
"monitor": {
|
|
198
|
+
"refreshInterval": 5000,
|
|
199
|
+
"showProcesses": true,
|
|
200
|
+
"maxProcesses": 20,
|
|
201
|
+
"enableRealTime": false
|
|
202
|
+
},
|
|
203
|
+
"logs": {
|
|
204
|
+
"defaultPath": "/var/log",
|
|
205
|
+
"maxLines": 1000,
|
|
206
|
+
"follow": false,
|
|
207
|
+
"level": 1,
|
|
208
|
+
"enableFileLogging": false,
|
|
209
|
+
"logDirectory": "~/.ops-toolkit/logs"
|
|
210
|
+
},
|
|
211
|
+
"deploy": {
|
|
212
|
+
"defaultEnv": "production",
|
|
213
|
+
"backupEnabled": true,
|
|
214
|
+
"confirmBeforeDeploy": true,
|
|
215
|
+
"rollbackEnabled": true,
|
|
216
|
+
"maxRetries": 3
|
|
217
|
+
},
|
|
218
|
+
"system": {
|
|
219
|
+
"showHiddenServices": false,
|
|
220
|
+
"cacheTimeout": 30000,
|
|
221
|
+
"enableNotifications": true
|
|
222
|
+
},
|
|
223
|
+
"ui": {
|
|
224
|
+
"theme": "default",
|
|
225
|
+
"animations": true,
|
|
226
|
+
"sound": false,
|
|
227
|
+
"language": "zh-CN"
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
### ็ฏๅขๅ้
|
|
233
|
+
|
|
234
|
+
```bash
|
|
235
|
+
# ๅผๅๆจกๅผ
|
|
236
|
+
export NODE_ENV=development
|
|
237
|
+
|
|
238
|
+
# ๅฏ็จ่ฐ่ฏๆฅๅฟ
|
|
239
|
+
export DEBUG=true
|
|
240
|
+
|
|
241
|
+
# ่ชๅฎไน้
็ฝฎ็ฎๅฝ
|
|
242
|
+
export OPS_CONFIG_DIR=/path/to/config
|
|
243
|
+
|
|
244
|
+
# ่ชๅฎไนๆฅๅฟ็บงๅซ
|
|
245
|
+
export OPS_LOG_LEVEL=debug
|
|
104
246
|
```
|
|
105
247
|
|
|
106
248
|
## Configuration
|
|
@@ -124,20 +266,105 @@ Configuration files are located in `~/.ops-toolkit/`:
|
|
|
124
266
|
}
|
|
125
267
|
```
|
|
126
268
|
|
|
127
|
-
## Contributing
|
|
269
|
+
## ๐ค Contributing
|
|
270
|
+
|
|
271
|
+
ๆไปฌๆฌข่ฟๆๆๅฝขๅผ็่ดก็ฎ๏ผ่ฏท้
่ฏป [ๅผๅๆๅ](docs/DEVELOPMENT.md) ไบ่งฃ่ฏฆ็ป็่ดก็ฎๆต็จใ
|
|
272
|
+
|
|
273
|
+
### ่ดก็ฎๆญฅ้ชค
|
|
274
|
+
|
|
275
|
+
1. Fork ไปๅบ
|
|
276
|
+
2. ๅๅปบๅ่ฝๅๆฏ (`git checkout -b feature/amazing-feature`)
|
|
277
|
+
3. ๆไบคๆดๆน (`git commit -m 'feat: add amazing feature'`)
|
|
278
|
+
4. ๆจ้ๅฐๅๆฏ (`git push origin feature/amazing-feature`)
|
|
279
|
+
5. ๅๅปบ Pull Request
|
|
280
|
+
|
|
281
|
+
### ๆไบคไฟกๆฏ่ง่
|
|
282
|
+
|
|
283
|
+
้ตๅพช [Conventional Commits](https://www.conventionalcommits.org/) ่ง่๏ผ
|
|
284
|
+
|
|
285
|
+
- `feat:` ๆฐๅ่ฝ
|
|
286
|
+
- `fix:` ไฟฎๅคbug
|
|
287
|
+
- `refactor:` ้ๆไปฃ็
|
|
288
|
+
- `docs:` ๆๆกฃๆดๆฐ
|
|
289
|
+
- `style:` ไปฃ็ ๆ ผๅผๅ
|
|
290
|
+
- `test:` ๆต่ฏ็ธๅ
ณ
|
|
291
|
+
- `chore:` ๆๅปบ/ๅทฅๅ
ท็ธๅ
ณ
|
|
292
|
+
|
|
293
|
+
### ไปฃ็ ่ดจ้
|
|
294
|
+
|
|
295
|
+
ๅจๆไบคๅ่ฏท็กฎไฟ๏ผ
|
|
296
|
+
|
|
297
|
+
- [ ] ๆๆๆต่ฏ้่ฟ (`bun test`)
|
|
298
|
+
- [ ] ็ฑปๅๆฃๆฅๆ ้่ฏฏ (`bun run typecheck`)
|
|
299
|
+
- [ ] ไปฃ็ ๆฃๆฅ้่ฟ (`bun run lint`)
|
|
300
|
+
- [ ] ๆๆกฃๅทฒๆดๆฐ
|
|
301
|
+
- [ ] ้
็ฝฎๅทฒๆต่ฏ
|
|
302
|
+
|
|
303
|
+
## ๐ Project Status
|
|
304
|
+
|
|
305
|
+
### ๅทฒๅฎๆ โ
|
|
306
|
+
|
|
307
|
+
- [x] ๆจกๅๅๆถๆ้ๆ
|
|
308
|
+
- [x] TypeScript ็ฑปๅๅฎๅ
จ
|
|
309
|
+
- [x] ็ปไธ้่ฏฏๅค็
|
|
310
|
+
- [x] ็ปๆๅๆฅๅฟ็ณป็ป
|
|
311
|
+
- [x] ้
็ฝฎ็ฎก็็ณป็ป
|
|
312
|
+
- [x] ๅฝไปคๆณจๅๅๅ็ฐๆบๅถ
|
|
313
|
+
- [x] ็ณป็ป็ๆงๅบ็กๅ่ฝ
|
|
314
|
+
- [x] ๅฎๆด็ๅผๅๅทฅๅ
ท้พ
|
|
315
|
+
|
|
316
|
+
### ๅผๅไธญ ๐ง
|
|
317
|
+
|
|
318
|
+
- [ ] ็ป็ซฏUI็้ข (OpenTUI้ๆ)
|
|
319
|
+
- [ ] ๆฅๅฟ็ฎก็ๅ่ฝ
|
|
320
|
+
- [ ] ้จ็ฝฒๅทฅๅ
ทๅฎ็ฐ
|
|
321
|
+
- [ ] ็ณป็ป็ฎก็ๅ่ฝ
|
|
322
|
+
- [ ] ๆไปถ็ณป็ป
|
|
323
|
+
- [ ] ้
็ฝฎ้ช่ฏๅจ
|
|
324
|
+
|
|
325
|
+
### ่ฎกๅไธญ ๐
|
|
326
|
+
|
|
327
|
+
- [ ] ๆง่ฝ็ๆงไปช่กจๆฟ
|
|
328
|
+
- [ ] ่ชๅจๅ้จ็ฝฒๆตๆฐด็บฟ
|
|
329
|
+
- [ ] ๅฎนๅจ็ฎก็ๆฏๆ
|
|
330
|
+
- [ ] ไบๅนณๅฐ้ๆ
|
|
331
|
+
- [ ] ๅค่ฏญ่จๆฏๆ
|
|
332
|
+
- [ ] ๅข้ๅไฝๅ่ฝ
|
|
333
|
+
|
|
334
|
+
## ๐ Stats
|
|
335
|
+
|
|
336
|
+
- **ไปฃ็ ่กๆฐ**: ~2000+
|
|
337
|
+
- **TypeScript ่ฆ็็**: 100%
|
|
338
|
+
- **ๆต่ฏ่ฆ็็**: ่ฟ่กไธญ
|
|
339
|
+
- **ๆๆกฃ่ฆ็็**: 95%
|
|
340
|
+
- **ๆๅปบๆถ้ด**: < 5s
|
|
341
|
+
- **ๅฏๅจๆถ้ด**: < 100ms
|
|
342
|
+
|
|
343
|
+
## ๐ Acknowledgments
|
|
344
|
+
|
|
345
|
+
- [Bun](https://bun.sh/) - ้ซๆง่ฝ JavaScript ่ฟ่กๆถ
|
|
346
|
+
- [OpenTUI](https://opentui.dev/) - ็ป็ซฏUIๆกๆถ
|
|
347
|
+
- [Commander.js](https://github.com/tj/commander.js) - CLI ๆกๆถ
|
|
348
|
+
- [Chalk](https://github.com/chalk/chalk) - ็ป็ซฏ้ข่ฒๅบ
|
|
349
|
+
- ๅ็ฐไปฃ DevOps ๅทฅๅ
ทๅฏๅ
|
|
350
|
+
|
|
351
|
+
## ๐ Support
|
|
352
|
+
|
|
353
|
+
- ๐ง ้ฎ็ฎฑ: support@ops-toolkit.dev
|
|
354
|
+
- ๐ฌ ่ฎจ่ฎบ: [GitHub Discussions](https://github.com/liangshaojie/ops-toolkit/discussions)
|
|
355
|
+
- ๐ ้ฎ้ขๆฅๅ: [GitHub Issues](https://github.com/liangshaojie/ops-toolkit/issues)
|
|
356
|
+
- ๐ ๆๆกฃ: [ๆๆกฃไธญๅฟ](https://ops-toolkit.dev/docs)
|
|
357
|
+
|
|
358
|
+
## ๐ License
|
|
359
|
+
|
|
360
|
+
ๆฌ้กน็ฎๅบไบ MIT ่ฎธๅฏ่ฏ - ่ฏฆ่ง [LICENSE](LICENSE) ๆไปถ
|
|
128
361
|
|
|
129
|
-
|
|
130
|
-
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
|
|
131
|
-
3. Commit your changes (`git commit -m 'feat: add amazing feature'`)
|
|
132
|
-
4. Push to the branch (`git push origin feature/amazing-feature`)
|
|
133
|
-
5. Open a Pull Request
|
|
362
|
+
---
|
|
134
363
|
|
|
135
|
-
|
|
364
|
+
<div align="center">
|
|
136
365
|
|
|
137
|
-
|
|
366
|
+
**[โญ Star](https://github.com/liangshaojie/ops-toolkit)** โข **[๐ด Fork](https://github.com/liangshaojie/ops-toolkit/fork)** โข **[๐ฅ Download](https://github.com/liangshaojie/ops-toolkit/releases)**
|
|
138
367
|
|
|
139
|
-
|
|
368
|
+
Made with โค๏ธ by the Ops Toolkit Team
|
|
140
369
|
|
|
141
|
-
|
|
142
|
-
- UI powered by [OpenTUI](https://opentui.dev/)
|
|
143
|
-
- Inspired by modern DevOps tools
|
|
370
|
+
</div>
|
package/bin/ops-toolkit.ts
CHANGED
|
@@ -1,92 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import chalk from 'chalk';
|
|
5
|
-
import figlet from 'figlet';
|
|
3
|
+
import { createCLI } from '../src/cli/app';
|
|
6
4
|
|
|
7
|
-
// CLI
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
console.log(
|
|
11
|
-
chalk.cyan(
|
|
12
|
-
figlet.textSync('ops-toolkit', {
|
|
13
|
-
font: 'Standard',
|
|
14
|
-
horizontalLayout: 'default',
|
|
15
|
-
verticalLayout: 'default',
|
|
16
|
-
})
|
|
17
|
-
)
|
|
18
|
-
);
|
|
19
|
-
|
|
20
|
-
// ่ฎพ็ฝฎCLI็จๅบ
|
|
21
|
-
program.name('ops').description('A comprehensive DevOps CLI toolkit').version('1.0.0');
|
|
22
|
-
|
|
23
|
-
// ้ป่ฎคๅฏๅจๅฝไปค
|
|
24
|
-
program
|
|
25
|
-
.command('ui', { isDefault: true })
|
|
26
|
-
.description('Start interactive terminal UI')
|
|
27
|
-
.action(async () => {
|
|
28
|
-
console.log(chalk.green('๐ ops-toolkit CLI is running!'));
|
|
29
|
-
console.log(chalk.yellow('๐ Available commands:'));
|
|
30
|
-
console.log(chalk.white(' ops monitor - System monitoring'));
|
|
31
|
-
console.log(chalk.white(' ops logs - Log management'));
|
|
32
|
-
console.log(chalk.white(' ops deploy - Deployment tools'));
|
|
33
|
-
console.log(chalk.white(' ops system - System management'));
|
|
34
|
-
console.log(chalk.gray('\n๐ง UI features coming soon...'));
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
// ็ๆงๅฝไปค
|
|
38
|
-
program
|
|
39
|
-
.command('monitor')
|
|
40
|
-
.description('System monitoring')
|
|
41
|
-
.action(async () => {
|
|
42
|
-
console.log(chalk.blue('๐ System Monitor'));
|
|
43
|
-
console.log(chalk.yellow('โ ๏ธ Monitoring features coming soon...'));
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
// ๆฅๅฟๅฝไปค
|
|
47
|
-
program
|
|
48
|
-
.command('logs')
|
|
49
|
-
.description('Log management')
|
|
50
|
-
.action(async () => {
|
|
51
|
-
console.log(chalk.blue('๐ Log Management'));
|
|
52
|
-
console.log(chalk.yellow('โ ๏ธ Log management features coming soon...'));
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
// ้จ็ฝฒๅฝไปค
|
|
56
|
-
program
|
|
57
|
-
.command('deploy')
|
|
58
|
-
.description('Deployment tools')
|
|
59
|
-
.action(async () => {
|
|
60
|
-
console.log(chalk.blue('๐ Deployment Tools'));
|
|
61
|
-
console.log(chalk.yellow('โ ๏ธ Deployment features coming soon...'));
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
// ็ณป็ปๅฝไปค
|
|
65
|
-
program
|
|
66
|
-
.command('system')
|
|
67
|
-
.description('System management')
|
|
68
|
-
.action(async () => {
|
|
69
|
-
console.log(chalk.blue('โ๏ธ System Management'));
|
|
70
|
-
console.log(chalk.yellow('โ ๏ธ System management features coming soon...'));
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
// ่งฃๆๅฝไปค่กๅๆฐ
|
|
74
|
-
program.parse();
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
// ้่ฏฏๅค็
|
|
78
|
-
process.on('uncaughtException', error => {
|
|
79
|
-
console.error(chalk.red('โ Uncaught Exception:'), error);
|
|
80
|
-
process.exit(1);
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
process.on('unhandledRejection', (reason, promise) => {
|
|
84
|
-
console.error(chalk.red('โ Unhandled Rejection at:'), promise, 'reason:', reason);
|
|
85
|
-
process.exit(1);
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
// ๅฏๅจๅบ็จ
|
|
89
|
-
main().catch(error => {
|
|
90
|
-
console.error(chalk.red('โ Failed to start application:'), error);
|
|
5
|
+
// ๅฏๅจCLIๅบ็จ็จๅบ
|
|
6
|
+
createCLI().catch(error => {
|
|
7
|
+
console.error('ๅฏๅจๅคฑ่ดฅ:', error);
|
|
91
8
|
process.exit(1);
|
|
92
9
|
});
|