relayax-cli 0.1.9 → 0.1.92
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
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) {
|
|
@@ -19,11 +19,4 @@ export interface Requires {
|
|
|
19
19
|
env?: RequiresEnv[];
|
|
20
20
|
teams?: string[];
|
|
21
21
|
}
|
|
22
|
-
export interface ContactInfo {
|
|
23
|
-
email?: string;
|
|
24
|
-
kakao?: string;
|
|
25
|
-
x?: string;
|
|
26
|
-
linkedin?: string;
|
|
27
|
-
website?: string;
|
|
28
|
-
}
|
|
29
22
|
export declare function registerPublish(program: Command): void;
|
package/dist/commands/publish.js
CHANGED
|
@@ -40,8 +40,6 @@ function parseRelayYaml(content) {
|
|
|
40
40
|
tags,
|
|
41
41
|
portfolio,
|
|
42
42
|
requires,
|
|
43
|
-
welcome: raw.welcome ? String(raw.welcome) : undefined,
|
|
44
|
-
contact: raw.contact,
|
|
45
43
|
visibility,
|
|
46
44
|
invite_code: raw.invite_code ? String(raw.invite_code) : undefined,
|
|
47
45
|
};
|
|
@@ -194,7 +192,7 @@ function registerPublish(program) {
|
|
|
194
192
|
process.exit(1);
|
|
195
193
|
}
|
|
196
194
|
// Interactive onboarding: create relay.yaml
|
|
197
|
-
const { input: promptInput, select: promptSelect
|
|
195
|
+
const { input: promptInput, select: promptSelect } = await import('@inquirer/prompts');
|
|
198
196
|
const dirName = path_1.default.basename(teamDir);
|
|
199
197
|
const defaultSlug = dirName.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, '');
|
|
200
198
|
console.error('\n\x1b[36m릴레이 팀 패키지를 초기화합니다.\x1b[0m');
|
|
@@ -230,33 +228,7 @@ function registerPublish(program) {
|
|
|
230
228
|
validate: (v) => v.trim().length > 0 ? true : '초대 코드를 입력해주세요.',
|
|
231
229
|
});
|
|
232
230
|
}
|
|
233
|
-
|
|
234
|
-
console.error('\n\x1b[33m┌─────────────────────────────────────────────────────────────┐\x1b[0m');
|
|
235
|
-
console.error('\x1b[33m│ welcome 메시지란? │\x1b[0m');
|
|
236
|
-
console.error('\x1b[33m│ 설치할 때마다 이 메시지와 연락처가 설치자에게 전달됩니다. │\x1b[0m');
|
|
237
|
-
console.error('\x1b[33m│ (설치 = 명함 전달) │\x1b[0m');
|
|
238
|
-
console.error('\x1b[33m└─────────────────────────────────────────────────────────────┘\x1b[0m\n');
|
|
239
|
-
const wantsWelcome = await promptConfirm({
|
|
240
|
-
message: 'welcome 메시지를 작성하시겠습니까?',
|
|
241
|
-
default: false,
|
|
242
|
-
});
|
|
243
|
-
let welcome;
|
|
244
|
-
let contactEmail;
|
|
245
|
-
let contactKakao;
|
|
246
|
-
if (wantsWelcome) {
|
|
247
|
-
welcome = await promptInput({
|
|
248
|
-
message: 'welcome 메시지:',
|
|
249
|
-
validate: (v) => v.trim().length > 0 ? true : '메시지를 입력해주세요.',
|
|
250
|
-
});
|
|
251
|
-
contactEmail = await promptInput({
|
|
252
|
-
message: '이메일 (선택):',
|
|
253
|
-
default: '',
|
|
254
|
-
});
|
|
255
|
-
contactKakao = await promptInput({
|
|
256
|
-
message: '카카오 오픈채팅 링크 (선택):',
|
|
257
|
-
default: '',
|
|
258
|
-
});
|
|
259
|
-
}
|
|
231
|
+
console.error('\n\x1b[2m💡 프로필에 연락처를 설정하면 설치 시 명함이 전달됩니다: relayax.com/dashboard/edit\x1b[0m\n');
|
|
260
232
|
const tags = tagsRaw
|
|
261
233
|
.split(',')
|
|
262
234
|
.map((t) => t.trim())
|
|
@@ -271,16 +243,6 @@ function registerPublish(program) {
|
|
|
271
243
|
};
|
|
272
244
|
if (invite_code)
|
|
273
245
|
yamlData.invite_code = invite_code;
|
|
274
|
-
if (welcome)
|
|
275
|
-
yamlData.welcome = welcome;
|
|
276
|
-
if (contactEmail || contactKakao) {
|
|
277
|
-
const contact = {};
|
|
278
|
-
if (contactEmail)
|
|
279
|
-
contact.email = contactEmail;
|
|
280
|
-
if (contactKakao)
|
|
281
|
-
contact.kakao = contactKakao;
|
|
282
|
-
yamlData.contact = contact;
|
|
283
|
-
}
|
|
284
246
|
fs_1.default.writeFileSync(relayYamlPath, js_yaml_1.default.dump(yamlData, { lineWidth: 120 }), 'utf-8');
|
|
285
247
|
console.error(`\n\x1b[32m✓ relay.yaml이 생성되었습니다.\x1b[0m\n`);
|
|
286
248
|
}
|
|
@@ -294,9 +256,9 @@ function registerPublish(program) {
|
|
|
294
256
|
}));
|
|
295
257
|
process.exit(1);
|
|
296
258
|
}
|
|
297
|
-
//
|
|
298
|
-
if (isTTY
|
|
299
|
-
console.error('💡
|
|
259
|
+
// Profile hint
|
|
260
|
+
if (isTTY) {
|
|
261
|
+
console.error('💡 프로필에 연락처를 설정하면 설치 시 명함이 전달됩니다: relayax.com/dashboard/edit');
|
|
300
262
|
}
|
|
301
263
|
// Validate structure
|
|
302
264
|
const hasDirs = VALID_DIRS.some((d) => {
|
|
@@ -341,8 +303,6 @@ function registerPublish(program) {
|
|
|
341
303
|
version: config.version,
|
|
342
304
|
changelog: config.changelog,
|
|
343
305
|
requires: config.requires,
|
|
344
|
-
welcome: config.welcome,
|
|
345
|
-
contact: config.contact,
|
|
346
306
|
visibility: config.visibility,
|
|
347
307
|
invite_code: config.invite_code,
|
|
348
308
|
};
|
package/dist/commands/search.js
CHANGED
|
@@ -12,7 +12,7 @@ function formatTable(results) {
|
|
|
12
12
|
? r.description.slice(0, 47) + '...'
|
|
13
13
|
: r.description,
|
|
14
14
|
installs: String(r.install_count),
|
|
15
|
-
commands: r.commands.join(', ') || '-',
|
|
15
|
+
commands: r.commands.map((c) => typeof c === 'string' ? c : c.name).join(', ') || '-',
|
|
16
16
|
}));
|
|
17
17
|
const cols = ['slug', 'name', 'description', 'installs', 'commands'];
|
|
18
18
|
const widths = cols.map((col) => Math.max(col.length, ...rows.map((r) => r[col].length)));
|