@team-semicolon/semo-cli 1.0.0 → 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 (2) hide show
  1. package/dist/index.js +38 -8
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -53,10 +53,26 @@ Object.defineProperty(exports, "__esModule", { value: true });
53
53
  const commander_1 = require("commander");
54
54
  const chalk_1 = __importDefault(require("chalk"));
55
55
  const ora_1 = __importDefault(require("ora"));
56
+ const inquirer_1 = __importDefault(require("inquirer"));
56
57
  const child_process_1 = require("child_process");
57
58
  const fs = __importStar(require("fs"));
58
59
  const path = __importStar(require("path"));
59
- const VERSION = "1.0.0";
60
+ const VERSION = "1.1.0";
61
+ // === 유틸리티: 덮어쓰기 확인 ===
62
+ async function confirmOverwrite(itemName, itemPath) {
63
+ if (!fs.existsSync(itemPath)) {
64
+ return true; // 파일이 없으면 진행
65
+ }
66
+ const { shouldOverwrite } = await inquirer_1.default.prompt([
67
+ {
68
+ type: "confirm",
69
+ name: "shouldOverwrite",
70
+ message: chalk_1.default.yellow(`${itemName} 이미 존재합니다. SEMO 기준으로 덮어쓰시겠습니까?`),
71
+ default: false,
72
+ },
73
+ ]);
74
+ return shouldOverwrite;
75
+ }
60
76
  const SEMO_REPO = "https://github.com/semicolon-devteam/semo.git";
61
77
  const program = new commander_1.Command();
62
78
  program
@@ -113,10 +129,16 @@ async function setupWhiteBox(cwd, force) {
113
129
  const semoSystemDir = path.join(cwd, "semo-system");
114
130
  console.log(chalk_1.default.cyan("\n📚 White Box 설정 (Git Subtree)"));
115
131
  console.log(chalk_1.default.gray(" 에이전트가 읽고 학습할 지식 베이스\n"));
116
- // semo-system 디렉토리 확인
132
+ // semo-system 디렉토리 확인 - force가 아니면 사용자에게 확인
117
133
  if (fs.existsSync(semoSystemDir) && !force) {
118
- console.log(chalk_1.default.yellow("semo-system/ 이미 존재. --force로 덮어쓰기 가능"));
119
- return;
134
+ const shouldOverwrite = await confirmOverwrite("semo-system/", semoSystemDir);
135
+ if (!shouldOverwrite) {
136
+ console.log(chalk_1.default.gray(" → semo-system/ 건너뜀"));
137
+ return;
138
+ }
139
+ // 기존 디렉토리 삭제
140
+ (0, child_process_1.execSync)(`rm -rf ${semoSystemDir}`, { stdio: "pipe" });
141
+ console.log(chalk_1.default.green(" ✓ 기존 semo-system/ 삭제됨"));
120
142
  }
121
143
  const spinner = (0, ora_1.default)("semo-core, semo-skills 다운로드 중...").start();
122
144
  try {
@@ -166,9 +188,13 @@ async function setupBlackBox(cwd, force) {
166
188
  console.log(chalk_1.default.cyan("\n🔧 Black Box 설정 (MCP Server)"));
167
189
  console.log(chalk_1.default.gray(" 토큰이 격리된 외부 연동 도구\n"));
168
190
  const settingsPath = path.join(cwd, ".claude", "settings.json");
191
+ // 기존 설정 파일 확인 - force가 아니면 사용자에게 확인
169
192
  if (fs.existsSync(settingsPath) && !force) {
170
- console.log(chalk_1.default.yellow(".claude/settings.json 이미 존재. --force로 덮어쓰기 가능"));
171
- return;
193
+ const shouldOverwrite = await confirmOverwrite(".claude/settings.json", settingsPath);
194
+ if (!shouldOverwrite) {
195
+ console.log(chalk_1.default.gray(" → settings.json 건너뜀"));
196
+ return;
197
+ }
172
198
  }
173
199
  const settings = {
174
200
  mcpServers: {
@@ -289,9 +315,13 @@ _SEMO 기본 규칙의 예외 사항을 여기에 추가하세요._
289
315
  async function setupClaudeMd(cwd, force) {
290
316
  console.log(chalk_1.default.cyan("\n📄 CLAUDE.md 설정"));
291
317
  const claudeMdPath = path.join(cwd, ".claude", "CLAUDE.md");
318
+ // 기존 CLAUDE.md 확인 - force가 아니면 사용자에게 확인
292
319
  if (fs.existsSync(claudeMdPath) && !force) {
293
- console.log(chalk_1.default.yellow("CLAUDE.md 이미 존재. --force로 덮어쓰기 가능"));
294
- return;
320
+ const shouldOverwrite = await confirmOverwrite("CLAUDE.md", claudeMdPath);
321
+ if (!shouldOverwrite) {
322
+ console.log(chalk_1.default.gray(" → CLAUDE.md 건너뜀"));
323
+ return;
324
+ }
295
325
  }
296
326
  const claudeMdContent = `# SEMO Project Configuration
297
327
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@team-semicolon/semo-cli",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "SEMO CLI - AI Agent Orchestration Framework Installer",
5
5
  "main": "dist/index.js",
6
6
  "bin": {