cciwon-code-review-cli 2.1.0 → 2.1.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/lib/chat-mode.js +34 -15
  2. package/package.json +1 -1
package/lib/chat-mode.js CHANGED
@@ -148,16 +148,27 @@ class ChatMode {
148
148
  return;
149
149
  }
150
150
 
151
+ let filePath;
152
+
151
153
  if (matchedFiles.length > 1) {
152
- console.log(chalk.yellow('\n⚠️ 여러 파일이 매칭됩니다. 하나를 선택해주세요:'));
153
- matchedFiles.forEach(file => {
154
- console.log(chalk.gray(` - ${file}`));
154
+ console.log(chalk.yellow('\n⚠️ 여러 파일이 매칭됩니다:'));
155
+ matchedFiles.forEach((file, index) => {
156
+ console.log(chalk.cyan(` ${index + 1}. ${file}`));
155
157
  });
156
158
  console.log('');
157
- return;
158
- }
159
159
 
160
- const filePath = matchedFiles[0];
160
+ const answer = await this.askQuestion(`선택 (1-${matchedFiles.length}): `);
161
+ const selection = parseInt(answer);
162
+
163
+ if (isNaN(selection) || selection < 1 || selection > matchedFiles.length) {
164
+ console.log(chalk.red('\n❌ 잘못된 선택입니다.\n'));
165
+ return;
166
+ }
167
+
168
+ filePath = matchedFiles[selection - 1];
169
+ } else {
170
+ filePath = matchedFiles[0];
171
+ }
161
172
 
162
173
  // 파일 내용 읽기
163
174
  try {
@@ -274,15 +285,23 @@ class ChatMode {
274
285
  */
275
286
  askQuestion(question) {
276
287
  return new Promise((resolve) => {
277
- const rl = readline.createInterface({
278
- input: process.stdin,
279
- output: process.stdout
280
- });
281
-
282
- rl.question(chalk.bold.cyan(question), (answer) => {
283
- rl.close();
284
- resolve(answer);
285
- });
288
+ // REPL이 실행 중이면 기존 interface 사용
289
+ if (this.rl) {
290
+ this.rl.question(chalk.bold.cyan(question), (answer) => {
291
+ resolve(answer);
292
+ });
293
+ } else {
294
+ // REPL 시작 전 (초기 질문용)
295
+ const rl = readline.createInterface({
296
+ input: process.stdin,
297
+ output: process.stdout
298
+ });
299
+
300
+ rl.question(chalk.bold.cyan(question), (answer) => {
301
+ rl.close();
302
+ resolve(answer);
303
+ });
304
+ }
286
305
  });
287
306
  }
288
307
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cciwon-code-review-cli",
3
- "version": "2.1.0",
3
+ "version": "2.1.2",
4
4
  "description": "AI-powered code review CLI tool using Qwen3-Coder-30B model with IP whitelist support",
5
5
  "main": "lib/api-client.js",
6
6
  "bin": {