atm-droid 1.0.5 → 1.0.6

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/package.json +1 -1
  2. package/src/commands.js +12 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "atm-droid",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "ATM Token Manager CLI - 跨平台 Factory Token 管理工具",
5
5
  "main": "src/index.js",
6
6
  "bin": {
package/src/commands.js CHANGED
@@ -33,6 +33,18 @@ async function login(code) {
33
33
  console.log(chalk.cyan(' 自动切换: 已启用'));
34
34
  }
35
35
 
36
+ // 自动启动后台服务
37
+ const daemonStatus = daemon.getDaemonStatus();
38
+ if (!daemonStatus.running) {
39
+ console.log(chalk.gray(' 正在启动后台服务...'));
40
+ const { spawn } = require('child_process');
41
+ const child = spawn(process.execPath, [
42
+ path.join(__dirname, 'daemon-runner.js')
43
+ ], { detached: true, stdio: 'ignore' });
44
+ child.unref();
45
+ console.log(chalk.green(' ✓ 后台服务已启动'));
46
+ }
47
+
36
48
  console.log(chalk.yellow('\n 提示: 使用 atm list 查看账号列表'));
37
49
  } else {
38
50
  spinner.fail(chalk.red('激活失败: ' + (result.error || '未知错误')));