@fivetu53/soul-chat 1.0.1 → 1.0.2

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/bin/index.js +19 -0
  2. package/package.json +1 -1
package/bin/index.js CHANGED
@@ -1026,6 +1026,25 @@ async function showMemories() {
1026
1026
 
1027
1027
  // 主程序
1028
1028
  async function main() {
1029
+ // 处理命令行参数
1030
+ const args = process.argv.slice(2);
1031
+ if (args[0] === 'update') {
1032
+ console.log('\n 正在更新 Soul Chat...\n');
1033
+ try {
1034
+ execSync('npm update -g @fivetu53/soul-chat', { stdio: 'inherit' });
1035
+ console.log('\n 更新完成!\n');
1036
+ } catch (err) {
1037
+ console.log('\n 更新失败,请手动运行: npm update -g @fivetu53/soul-chat\n');
1038
+ }
1039
+ process.exit(0);
1040
+ }
1041
+
1042
+ if (args[0] === 'version' || args[0] === '-v' || args[0] === '--version') {
1043
+ const pkg = JSON.parse(fs.readFileSync(new URL('../package.json', import.meta.url), 'utf8'));
1044
+ console.log(`Soul Chat v${pkg.version}`);
1045
+ process.exit(0);
1046
+ }
1047
+
1029
1048
  process.on('SIGINT', () => {
1030
1049
  cleanup();
1031
1050
  process.exit();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fivetu53/soul-chat",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Soul Chat - 智能 AI 伴侣命令行客户端",
5
5
  "type": "module",
6
6
  "bin": {