relayax-cli 0.1.9 → 0.1.91
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/dist/commands/init.js +20 -2
- package/package.json +1 -1
package/dist/commands/init.js
CHANGED
|
@@ -59,6 +59,7 @@ function registerInit(program) {
|
|
|
59
59
|
.command('init')
|
|
60
60
|
.description('에이전트 CLI를 감지하고 relay 슬래시 커맨드를 설치합니다')
|
|
61
61
|
.option('--tools <tools>', '설치할 에이전트 CLI 지정 (all 또는 쉼표 구분)')
|
|
62
|
+
.option('--update', '이미 설치된 슬래시 커맨드를 최신 버전으로 업데이트')
|
|
62
63
|
.action(async (opts) => {
|
|
63
64
|
const json = program.opts().json ?? false;
|
|
64
65
|
const projectPath = process.cwd();
|
|
@@ -66,7 +67,24 @@ function registerInit(program) {
|
|
|
66
67
|
const detectedIds = new Set(detected.map((t) => t.value));
|
|
67
68
|
// 1. 도구 선택
|
|
68
69
|
let targetToolIds;
|
|
69
|
-
if (opts.
|
|
70
|
+
if (opts.update) {
|
|
71
|
+
// --update: 기존에 relay 커맨드가 설치된 CLI만 찾아서 덮어쓰기
|
|
72
|
+
const installed = detected.filter((tool) => {
|
|
73
|
+
const cmdDir = path_1.default.join(projectPath, tool.skillsDir, 'commands', 'relay');
|
|
74
|
+
return fs_1.default.existsSync(cmdDir);
|
|
75
|
+
});
|
|
76
|
+
if (installed.length === 0) {
|
|
77
|
+
if (json) {
|
|
78
|
+
console.error(JSON.stringify({ error: 'NO_RELAY_COMMANDS', message: '설치된 relay 슬래시 커맨드가 없습니다. relay init을 먼저 실행하세요.' }));
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
console.error('설치된 relay 슬래시 커맨드가 없습니다. relay init을 먼저 실행하세요.');
|
|
82
|
+
}
|
|
83
|
+
process.exit(1);
|
|
84
|
+
}
|
|
85
|
+
targetToolIds = installed.map((t) => t.value);
|
|
86
|
+
}
|
|
87
|
+
else if (opts.tools) {
|
|
70
88
|
// --tools 옵션: 비대화형
|
|
71
89
|
targetToolIds = resolveTools(opts.tools);
|
|
72
90
|
}
|
|
@@ -145,7 +163,7 @@ function registerInit(program) {
|
|
|
145
163
|
}));
|
|
146
164
|
}
|
|
147
165
|
else {
|
|
148
|
-
console.log(
|
|
166
|
+
console.log(`\n\x1b[32m✓ relay ${opts.update ? '슬래시 커맨드 업데이트' : '초기화'} 완료\x1b[0m\n`);
|
|
149
167
|
for (const r of results) {
|
|
150
168
|
console.log(` \x1b[36m${r.tool}\x1b[0m`);
|
|
151
169
|
for (const cmd of r.commands) {
|