relayax-cli 0.4.29 → 0.4.30
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/install.js +28 -29
- package/package.json +1 -1
package/dist/commands/install.js
CHANGED
|
@@ -199,41 +199,17 @@ function registerInstall(program) {
|
|
|
199
199
|
const isTTY = Boolean(process.stdin.isTTY);
|
|
200
200
|
const interactive = isTTY && !json;
|
|
201
201
|
const defaultScope = resolvedAgent.recommended_scope ?? (resolvedAgent.type === 'passive' ? 'local' : 'global');
|
|
202
|
-
// ──
|
|
203
|
-
let scope;
|
|
204
|
-
if (_opts.global) {
|
|
205
|
-
scope = 'global';
|
|
206
|
-
}
|
|
207
|
-
else if (_opts.local) {
|
|
208
|
-
scope = 'local';
|
|
209
|
-
}
|
|
210
|
-
else if (interactive) {
|
|
211
|
-
const { select } = await import('@inquirer/prompts');
|
|
212
|
-
scope = await select({
|
|
213
|
-
message: '설치 범위를 선택하세요',
|
|
214
|
-
choices: [
|
|
215
|
-
{ name: '글로벌 (~/.relay/agents/) — 모든 프로젝트에서 사용', value: 'global' },
|
|
216
|
-
{ name: '로컬 (./.relay/agents/) — 이 프로젝트에서만 사용', value: 'local' },
|
|
217
|
-
],
|
|
218
|
-
default: defaultScope,
|
|
219
|
-
});
|
|
220
|
-
}
|
|
221
|
-
else {
|
|
222
|
-
scope = defaultScope;
|
|
223
|
-
}
|
|
224
|
-
// ── AI tools 선택: 감지된 건 pre-checked, 나머지는 선택 가능 ──
|
|
202
|
+
// ── 1. AI tools 선택 (scope 무관, 항상 홈 디렉토리에서 감지) ──
|
|
225
203
|
let selectedTools;
|
|
226
204
|
if (interactive) {
|
|
227
|
-
const detected =
|
|
228
|
-
|
|
229
|
-
: (0, ai_tools_js_1.detectAgentCLIs)(projectPath);
|
|
230
|
-
if (scope === 'global' && !detected.some((t) => t.value === 'claude')) {
|
|
205
|
+
const detected = (0, ai_tools_js_1.detectGlobalCLIs)();
|
|
206
|
+
if (!detected.some((t) => t.value === 'claude')) {
|
|
231
207
|
detected.push({ name: 'Claude Code', value: 'claude', skillsDir: '.claude' });
|
|
232
208
|
}
|
|
233
209
|
const detectedValues = new Set(detected.map((t) => t.value));
|
|
234
210
|
const { checkbox } = await import('@inquirer/prompts');
|
|
235
211
|
selectedTools = await checkbox({
|
|
236
|
-
message: '설치할 AI 도구를
|
|
212
|
+
message: '설치할 AI 도구를 선택하��요 (감지된 도구는 자동 선���됨)',
|
|
237
213
|
choices: ai_tools_js_1.AI_TOOLS.map((t) => ({
|
|
238
214
|
name: t.name,
|
|
239
215
|
value: t,
|
|
@@ -241,7 +217,7 @@ function registerInstall(program) {
|
|
|
241
217
|
})),
|
|
242
218
|
});
|
|
243
219
|
}
|
|
244
|
-
// ──
|
|
220
|
+
// ── 2. 글로벌 slash commands 설치/업데이트 ──
|
|
245
221
|
if (selectedTools) {
|
|
246
222
|
(0, init_js_1.installGlobalUserCommands)(selectedTools);
|
|
247
223
|
}
|
|
@@ -251,6 +227,29 @@ function registerInstall(program) {
|
|
|
251
227
|
}
|
|
252
228
|
(0, init_js_1.installGlobalUserCommands)();
|
|
253
229
|
}
|
|
230
|
+
// ── 3. Scope 결정: 플래그 > TTY prompt > 자동결정 ──
|
|
231
|
+
let scope;
|
|
232
|
+
if (_opts.global) {
|
|
233
|
+
scope = 'global';
|
|
234
|
+
}
|
|
235
|
+
else if (_opts.local) {
|
|
236
|
+
scope = 'local';
|
|
237
|
+
}
|
|
238
|
+
else if (interactive) {
|
|
239
|
+
const { select } = await import('@inquirer/prompts');
|
|
240
|
+
const recommendLabel = defaultScope === 'global' ? '글로벌' : '로���';
|
|
241
|
+
scope = await select({
|
|
242
|
+
message: `설치 범위를 선택하세요 (제작자 권장: ${recommendLabel})`,
|
|
243
|
+
choices: [
|
|
244
|
+
{ name: '글로벌 (~/.relay/agents/) — 모든 프���젝트에서 사��', value: 'global' },
|
|
245
|
+
{ name: '로컬 (./.relay/agents/) — 이 프로젝트에서만 사���', value: 'local' },
|
|
246
|
+
],
|
|
247
|
+
default: defaultScope,
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
else {
|
|
251
|
+
scope = defaultScope;
|
|
252
|
+
}
|
|
254
253
|
const agentDir = scope === 'global'
|
|
255
254
|
? path_1.default.join(os_1.default.homedir(), '.relay', 'agents', parsed.owner, parsed.name)
|
|
256
255
|
: path_1.default.join(projectPath, '.relay', 'agents', parsed.owner, parsed.name);
|