@fontdo/5g-message 1.0.7 → 1.0.8

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 (2) hide show
  1. package/cli.ts +34 -2
  2. package/package.json +2 -2
package/cli.ts CHANGED
@@ -3,12 +3,33 @@ import inquirer from 'inquirer';
3
3
  import fs from 'fs-extra';
4
4
  import path from 'path';
5
5
  import chalk from 'chalk';
6
+ import { execSync } from 'child_process';
6
7
 
7
8
  // 配置文件路径
8
9
  const CONFIG_DIR = path.join(process.env.HOME || process.env.USERPROFILE || '', '.openclaw');
9
10
  const CONFIG_FILE = path.join(CONFIG_DIR, 'openclaw.json');
10
11
 
11
- async function main() {
12
+ async function install() {
13
+ console.log(chalk.cyan('📱 Fontdo 5G Message 插件安装向导'));
14
+ console.log(chalk.gray('=================================='));
15
+ console.log('');
16
+
17
+ try {
18
+ // 安装插件到 OpenClaw
19
+ console.log(chalk.blue('正在安装插件到 OpenClaw...'));
20
+ execSync('openclaw plugins install @fontdo/5g-message', { stdio: 'inherit' });
21
+ console.log(chalk.green('✅ 插件安装成功!'));
22
+ console.log('');
23
+
24
+ // 执行配置
25
+ await configure();
26
+ } catch (error) {
27
+ console.error(chalk.red('安装失败:', error.message));
28
+ process.exit(1);
29
+ }
30
+ }
31
+
32
+ async function configure() {
12
33
  console.log(chalk.cyan('📱 Fontdo 5G Message 插件配置向导'));
13
34
  console.log(chalk.gray('=================================='));
14
35
  console.log('');
@@ -130,7 +151,18 @@ async function main() {
130
151
  console.log(chalk.gray('命令: openclaw restart'));
131
152
  }
132
153
 
154
+ // 主函数
155
+ async function main() {
156
+ const args = process.argv.slice(2);
157
+
158
+ if (args.includes('install')) {
159
+ await install();
160
+ } else {
161
+ await configure();
162
+ }
163
+ }
164
+
133
165
  main().catch((error) => {
134
- console.error(chalk.red('配置失败:', error.message));
166
+ console.error(chalk.red('操作失败:', error.message));
135
167
  process.exit(1);
136
168
  });
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@fontdo/5g-message",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "OpenClaw 通道插件,用于连接 Fontdo 5G 消息平台",
5
5
  "main": "index.ts",
6
6
  "bin": {
7
- "fontdo-5g-message-onboard": "./cli.ts"
7
+ "fontdo-5g-message": "./cli.ts"
8
8
  },
9
9
  "scripts": {
10
10
  "build": "tsc",