@appthen/cli 1.2.1 → 1.2.3

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/bin/main.js CHANGED
@@ -574,6 +574,47 @@ program
574
574
  }
575
575
  });
576
576
 
577
+ // init-space 命令
578
+ program
579
+ .command('init-space')
580
+ .description('初始化 Agent+ Space 配置')
581
+ .option(
582
+ '-t, --tool <tool>',
583
+ 'AI 编码工具 (claude-code|cursor|windsurf|coder|augment|other)'
584
+ )
585
+ .option('--project-name <name>', '项目名称(可选,默认使用目录名)')
586
+ .option('--project-id <id>', '关联的项目ID(可选)')
587
+ .option('-f, --force', '覆盖已存在的配置')
588
+ .option('-v, --verbose', '显示详细输出')
589
+ .option('-c, --cwd <cwd>', '工作目录', process.cwd())
590
+ .option('--skip-prompts', '跳过提示词文件生成')
591
+ .option('--skip-hooks', '跳过 hooks 配置(仅 Claude Code)')
592
+ .action(async function doInitSpace(command) {
593
+ const options = command.opts();
594
+
595
+ try {
596
+ const { initSpace } = require('../dist/index.js');
597
+
598
+ const result = await initSpace({
599
+ tool: options.tool,
600
+ name: options.projectName,
601
+ projectId: options.projectId,
602
+ force: options.force,
603
+ verbose: options.verbose,
604
+ cwd: options.cwd,
605
+ skipPrompts: options.skipPrompts,
606
+ skipHooks: options.skipHooks,
607
+ });
608
+
609
+ if (!result.success) {
610
+ process.exit(1);
611
+ }
612
+ } catch (error) {
613
+ console.error('❌ 初始化失败:', error.message);
614
+ process.exit(1);
615
+ }
616
+ });
617
+
577
618
  // init-claude-hooks 命令
578
619
  program
579
620
  .command('init-claude-hooks')