ops-toolkit 1.1.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.
Files changed (43) hide show
  1. package/.commitlintrc.js +25 -0
  2. package/.env.example +25 -0
  3. package/.husky/commit-msg +4 -0
  4. package/.husky/pre-commit +4 -0
  5. package/.opencode/README.md +320 -0
  6. package/.opencode/command/add-cmd.md +38 -0
  7. package/.opencode/command/add-pkg.md +28 -0
  8. package/.opencode/command/build.md +27 -0
  9. package/.opencode/command/debug.md +36 -0
  10. package/.opencode/command/fix.md +23 -0
  11. package/.opencode/command/release.md +28 -0
  12. package/.opencode/command/review.md +36 -0
  13. package/.opencode/command/test.md +25 -0
  14. package/.prettierrc +16 -0
  15. package/.release-it.json +29 -0
  16. package/.versionrc.js +18 -0
  17. package/.vscode/extensions.json +14 -0
  18. package/.vscode/launch.json +33 -0
  19. package/.vscode/typescript.code-snippets +61 -0
  20. package/AGENTS.md +277 -0
  21. package/CHANGELOG.md +24 -0
  22. package/QUICKSTART.md +136 -0
  23. package/README.md +143 -0
  24. package/bin/ops-toolkit.ts +92 -0
  25. package/bun.lock +1921 -0
  26. package/dist/index.js +3726 -0
  27. package/docs/DEBUGGING.md +255 -0
  28. package/docs/DEVELOPMENT_GUIDE.md +538 -0
  29. package/eslint.config.js +64 -0
  30. package/package.json +90 -0
  31. package/src/commands/deploy/index.ts +97 -0
  32. package/src/commands/monitor/index.ts +60 -0
  33. package/src/commands/system/index.ts +120 -0
  34. package/src/index.ts +82 -0
  35. package/src/types/commands.ts +41 -0
  36. package/src/types/index.ts +3 -0
  37. package/src/types/system.ts +65 -0
  38. package/src/types/ui.ts +61 -0
  39. package/src/utils/config.ts +146 -0
  40. package/src/utils/index.ts +3 -0
  41. package/src/utils/logger.ts +62 -0
  42. package/src/utils/system.ts +183 -0
  43. package/tsconfig.json +48 -0
@@ -0,0 +1,92 @@
1
+ #!/usr/bin/env bun
2
+
3
+ import { program } from 'commander';
4
+ import chalk from 'chalk';
5
+ import figlet from 'figlet';
6
+
7
+ // CLI入口点
8
+ async function main() {
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);
91
+ process.exit(1);
92
+ });