fandomie 0.0.0-stage → 0.2.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 (3) hide show
  1. package/README.md +42 -2
  2. package/dist/cli.mjs +1119 -0
  3. package/package.json +20 -4
package/README.md CHANGED
@@ -1,3 +1,43 @@
1
- # Temporary Holding Version
1
+ # fandomie
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ [팬덤이](https://fandomie.nangmanpg.com)(인스타 댓글 DM 자동화)의 성과·내역·자동화 설정을 터미널에서 다루고, 사용 가이드를 읽는 CLI 예요.
4
+
5
+ ```bash
6
+ npx fandomie login # 브라우저로 로그인
7
+ npx fandomie accounts # 연결한 인스타 계정
8
+ npx fandomie stats --posts
9
+ ```
10
+
11
+ Node 20 이상이 필요해요.
12
+
13
+ ## 로그인
14
+
15
+ - `fandomie login` 을 실행하면 브라우저에 팬덤이 로그인 화면이 열려요. 워크스페이스와 권한(읽기만 / 읽기와 수정하기)을 확인하고 「허용」 을 눌러요.
16
+ - 서버나 CI 처럼 브라우저가 없는 곳에서는 콘솔의 「MCP · API 연결」 에서 키를 만들어 `FANDOMIE_TOKEN` 에 넣어요.
17
+ - 연결은 콘솔의 「연결된 앱」 에서 언제든 끊을 수 있어요.
18
+
19
+ ## 명령
20
+
21
+ | 명령 | 무엇 |
22
+ | ---------------------------------------------------------------- | ---------------------------------------- |
23
+ | `whoami` | 로그인한 회원·워크스페이스·권한 |
24
+ | `accounts` | 연결한 인스타 계정 |
25
+ | `media [--after <커서>]` | 최근 게시물 |
26
+ | `stats [--since --until] [--posts \| --media <id>]` | 반응·DM·클릭 숫자 |
27
+ | `usage [--month YYYY-MM]` | 사용량 |
28
+ | `automations list` · `show <id>` · `history <id>` | 자동화와 변경 내역 |
29
+ | `automations create --file a.json` · `update <id> --file a.json` | 자동화 만들기·고치기 |
30
+ | `automations on <id>` · `off <id>` | 켜고 끄기 |
31
+ | `logs` · `people` · `people show <user_id>` | 댓글마다 한 일, 반응한 사람 |
32
+ | `guide [slug\|검색어]` | 사용 가이드. 목차, 한 쪽, 제목·요약 찾기 |
33
+ | `mcp` | Claude·ChatGPT·Claude Code 에 붙이는 법 |
34
+
35
+ - 계정이 여럿이면 `-a <인스타 아이디>` 로 골라요.
36
+ - 바꾸는 명령은 먼저 바뀔 내용만 보여 줘요. 맞으면 같은 명령에 `--confirm` 을 붙여요.
37
+ - 터미널에서는 표, 파이프로 넘기면 JSON 이 나와요. `-o json` 으로 고를 수 있어요.
38
+
39
+ ## 한도
40
+
41
+ 키마다 1초에 한 번, 워크스페이스 전체로 하루 2,000번까지 부를 수 있어요. 1초 한도에 걸리면 CLI 가 알아서 기다려요.
42
+
43
+ 종료 코드: 0 성공, 1 오류, 2 인자 오류, 3 로그인 필요, 4 한도.
package/dist/cli.mjs ADDED
@@ -0,0 +1,1119 @@
1
+ #!/usr/bin/env node
2
+ import { mkdir, readFile, rename, rm, stat, writeFile } from "node:fs/promises";
3
+ import { parseArgs } from "node:util";
4
+ import { spawn } from "node:child_process";
5
+ import { createHash, randomBytes } from "node:crypto";
6
+ import { createServer } from "node:http";
7
+ import { homedir } from "node:os";
8
+ import { join } from "node:path";
9
+ //#region package.json
10
+ var version = "0.2.0";
11
+ //#endregion
12
+ //#region src/errors.ts
13
+ const EXIT = {
14
+ ok: 0,
15
+ error: 1,
16
+ usage: 2,
17
+ login: 3,
18
+ limit: 4
19
+ };
20
+ var CliError = class extends Error {
21
+ code;
22
+ constructor(message, code = EXIT.error) {
23
+ super(message);
24
+ this.code = code;
25
+ }
26
+ };
27
+ const LOGIN_NEEDED = "로그인이 필요해요. fandomie login 으로 로그인하거나 FANDOMIE_TOKEN 에 콘솔에서 만든 키를 넣어 주세요.";
28
+ //#endregion
29
+ //#region src/site.ts
30
+ const SITES = {
31
+ prod: {
32
+ stage: "prod",
33
+ api: "https://api.fandomie.nangmanpg.com",
34
+ console: "https://console.fandomie.nangmanpg.com"
35
+ },
36
+ stg: {
37
+ stage: "stg",
38
+ api: "https://stg.api.fandomie.nangmanpg.com",
39
+ console: "https://stg.console.fandomie.nangmanpg.com"
40
+ }
41
+ };
42
+ const BASE_PATH = "/api/meta";
43
+ const mcpUrl = (site) => `${site.api}${BASE_PATH}/mcp`;
44
+ function siteFor(stage) {
45
+ if (stage === void 0 || stage === "" || stage === "prod") return SITES.prod;
46
+ return stage === "stg" ? SITES.stg : null;
47
+ }
48
+ //#endregion
49
+ //#region src/api.ts
50
+ const TOO_FAST = "1초에 한 번";
51
+ const DAILY_LIMIT = "오늘 부를 수 있는 수";
52
+ const MAX_TRIES = 6;
53
+ const REFRESH_EARLY_MS = 6e4;
54
+ var Client = class {
55
+ deps;
56
+ constructor(deps) {
57
+ this.deps = deps;
58
+ }
59
+ get site() {
60
+ return this.deps.site;
61
+ }
62
+ async token() {
63
+ const key = this.deps.env.FANDOMIE_TOKEN?.trim();
64
+ if (key) return {
65
+ value: key,
66
+ login: null
67
+ };
68
+ const login = await this.deps.store.login(this.deps.site.api);
69
+ if (!login) throw new CliError(LOGIN_NEEDED, EXIT.login);
70
+ if (login.expiresAt - REFRESH_EARLY_MS > this.deps.now()) return {
71
+ value: login.accessToken,
72
+ login
73
+ };
74
+ const fresh = await this.refresh(login, false);
75
+ return {
76
+ value: fresh.accessToken,
77
+ login: fresh
78
+ };
79
+ }
80
+ async callTool(name, args = {}) {
81
+ let refreshed = false;
82
+ for (let attempt = 0; attempt < MAX_TRIES; attempt += 1) {
83
+ const token = await this.token();
84
+ const response = await this.post(mcpUrl(this.deps.site), token.value, {
85
+ jsonrpc: "2.0",
86
+ id: attempt + 1,
87
+ method: "tools/call",
88
+ params: {
89
+ name,
90
+ arguments: args
91
+ }
92
+ });
93
+ if (response.status === 401) {
94
+ if (token.login && !refreshed) {
95
+ refreshed = true;
96
+ await this.refresh(token.login, true);
97
+ continue;
98
+ }
99
+ throw new CliError(token.login ? LOGIN_NEEDED : "FANDOMIE_TOKEN 의 키가 맞지 않거나 끝났어요. 콘솔에서 새 키를 만들어 주세요.", EXIT.login);
100
+ }
101
+ const body = await response.json().catch(() => null);
102
+ if (!response.ok || !body) throw new CliError(`서버가 ${response.status} 로 답했어요.`);
103
+ if (body.error) throw new CliError(body.error.message ?? "요청이 틀렸어요.");
104
+ const result = body.result ?? {};
105
+ const text = result.content?.find((part) => part.type === "text")?.text;
106
+ if (result.isError) {
107
+ const message = text ?? "요청을 처리하지 못했어요.";
108
+ if (message.includes(TOO_FAST)) {
109
+ await this.deps.sleep(1e3 + Math.floor(Math.random() * 500));
110
+ continue;
111
+ }
112
+ throw new CliError(message, message.includes(DAILY_LIMIT) ? EXIT.limit : EXIT.error);
113
+ }
114
+ if (result.structuredContent) return result.structuredContent;
115
+ try {
116
+ return JSON.parse(text ?? "{}");
117
+ } catch {
118
+ return { text };
119
+ }
120
+ }
121
+ throw new CliError("1초 한도에 계속 걸렸어요. 같은 키로 도는 다른 명령이 끝난 뒤 다시 해 주세요.", EXIT.limit);
122
+ }
123
+ async refresh(stale, force) {
124
+ const { store, site, now } = this.deps;
125
+ return store.withLock(async () => {
126
+ const current = await store.login(site.api);
127
+ if (!current) throw new CliError(LOGIN_NEEDED, EXIT.login);
128
+ if (current.accessToken !== stale.accessToken) return current;
129
+ if (!force && current.expiresAt - REFRESH_EARLY_MS > now()) return current;
130
+ const response = await this.form(`${site.api}${BASE_PATH}/oauth/token`, {
131
+ grant_type: "refresh_token",
132
+ client_id: current.clientId,
133
+ refresh_token: current.refreshToken
134
+ });
135
+ const body = await response.json().catch(() => null);
136
+ if (response.status === 400 || response.status === 401) {
137
+ await store.saveLogin(site.api, null);
138
+ throw new CliError("로그인이 끝났어요. fandomie login 으로 다시 로그인해 주세요.", EXIT.login);
139
+ }
140
+ if (!response.ok || !body?.access_token || !body.refresh_token) throw new CliError(`로그인을 갱신하지 못했어요(${response.status}). 잠시 뒤 다시 해 주세요.`);
141
+ const fresh = toLogin(body, current.clientId, now());
142
+ await store.saveLogin(site.api, fresh);
143
+ return fresh;
144
+ });
145
+ }
146
+ async post(url, token, body) {
147
+ return this.send(url, {
148
+ method: "POST",
149
+ headers: {
150
+ "content-type": "application/json",
151
+ accept: "application/json, text/event-stream",
152
+ "mcp-protocol-version": "2025-06-18",
153
+ ...token ? { authorization: `Bearer ${token}` } : {}
154
+ },
155
+ body: JSON.stringify(body)
156
+ });
157
+ }
158
+ async form(url, fields) {
159
+ return this.send(url, {
160
+ method: "POST",
161
+ headers: { "content-type": "application/x-www-form-urlencoded" },
162
+ body: new URLSearchParams(fields).toString()
163
+ });
164
+ }
165
+ async send(url, init) {
166
+ try {
167
+ return await this.deps.fetch(url, {
168
+ ...init,
169
+ headers: {
170
+ ...init.headers,
171
+ "user-agent": `fandomie-cli/${this.deps.version}`
172
+ }
173
+ });
174
+ } catch (caught) {
175
+ throw new CliError(`서버에 닿지 못했어요: ${caught instanceof Error ? caught.message : String(caught)}`);
176
+ }
177
+ }
178
+ };
179
+ function toLogin(body, clientId, now) {
180
+ return {
181
+ clientId,
182
+ accessToken: body.access_token ?? "",
183
+ refreshToken: body.refresh_token ?? "",
184
+ expiresAt: now + (body.expires_in ?? 3600) * 1e3,
185
+ scope: body.scope ?? "read"
186
+ };
187
+ }
188
+ //#endregion
189
+ //#region src/auth.ts
190
+ const CALLBACK_PATH = "/callback";
191
+ const WAIT_MS = 5 * 6e4;
192
+ const CLIENT_NAME = "팬덤이 CLI";
193
+ const pkce = () => {
194
+ const verifier = randomBytes(32).toString("base64url");
195
+ return {
196
+ verifier,
197
+ challenge: createHash("sha256").update(verifier).digest("base64url")
198
+ };
199
+ };
200
+ function openBrowser(url) {
201
+ const [command, args] = process.platform === "darwin" ? ["open", [url]] : process.platform === "win32" ? ["cmd", [
202
+ "/c",
203
+ "start",
204
+ "\"\"",
205
+ url.replace(/&/g, "^&")
206
+ ]] : ["xdg-open", [url]];
207
+ try {
208
+ const child = spawn(command, args, {
209
+ stdio: "ignore",
210
+ detached: true
211
+ });
212
+ child.on("error", () => {});
213
+ child.unref();
214
+ } catch {}
215
+ }
216
+ function readCallback(query, expected) {
217
+ if (query.get("state") !== expected.state) throw new CliError("로그인 응답이 이 요청의 것이 아니에요. 다시 해 주세요.");
218
+ const issuer = query.get("iss");
219
+ if (issuer && issuer !== expected.issuer) throw new CliError("다른 서버가 보낸 로그인 응답이에요. 다시 해 주세요.");
220
+ const error = query.get("error");
221
+ if (error === "access_denied") throw new CliError("로그인을 거절했어요.");
222
+ if (error) throw new CliError(`로그인하지 못했어요: ${query.get("error_description") ?? error}`);
223
+ const code = query.get("code");
224
+ if (!code) throw new CliError("로그인 응답에 code 가 없어요.");
225
+ return code;
226
+ }
227
+ const DONE_PAGE = (message) => `<!doctype html><meta charset="utf-8"><title>팬덤이 CLI</title><body style="font-family:system-ui;padding:48px;text-align:center"><p>${message}</p><p style="color:#888">이 창은 닫아도 돼요.</p></body>`;
228
+ async function waitForCallback(onListen) {
229
+ return new Promise((resolve, reject) => {
230
+ const server = createServer((request, response) => {
231
+ const url = new URL(request.url ?? "/", "http://127.0.0.1");
232
+ if (url.pathname !== CALLBACK_PATH) {
233
+ response.writeHead(404).end();
234
+ return;
235
+ }
236
+ const failed = url.searchParams.has("error");
237
+ response.writeHead(200, { "content-type": "text/html; charset=utf-8" }).end(DONE_PAGE(failed ? "로그인하지 못했어요. 터미널을 확인해 주세요." : "로그인했어요. 터미널로 돌아가 주세요."));
238
+ clearTimeout(timer);
239
+ server.close();
240
+ server.closeAllConnections();
241
+ resolve(url.searchParams);
242
+ });
243
+ const timer = setTimeout(() => {
244
+ server.close();
245
+ reject(new CliError("5분 안에 로그인하지 않아 멈췄어요. 다시 해 주세요."));
246
+ }, WAIT_MS);
247
+ server.on("error", (caught) => {
248
+ clearTimeout(timer);
249
+ reject(new CliError(`로그인을 받을 포트를 열지 못했어요: ${caught.message}`));
250
+ });
251
+ server.listen(0, "127.0.0.1", () => {
252
+ const { port } = server.address();
253
+ onListen(`http://127.0.0.1:${port}${CALLBACK_PATH}`);
254
+ });
255
+ });
256
+ }
257
+ async function clientId(client, deps) {
258
+ const saved = await deps.store.client(deps.site.api);
259
+ if (saved) return saved;
260
+ const response = await client.post(`${deps.site.api}${BASE_PATH}/oauth/register`, null, {
261
+ client_name: CLIENT_NAME,
262
+ redirect_uris: [`http://127.0.0.1${CALLBACK_PATH}`],
263
+ grant_types: ["authorization_code", "refresh_token"],
264
+ response_types: ["code"],
265
+ token_endpoint_auth_method: "none"
266
+ });
267
+ const body = await response.json().catch(() => null);
268
+ if (!response.ok || !body?.client_id) throw new CliError(`로그인을 준비하지 못했어요(${response.status}).`);
269
+ await deps.store.saveClient(deps.site.api, body.client_id);
270
+ return body.client_id;
271
+ }
272
+ async function login(client, deps, io, options) {
273
+ const id = await clientId(client, deps);
274
+ const { verifier, challenge } = pkce();
275
+ const state = randomBytes(16).toString("base64url");
276
+ let redirectUri = "";
277
+ const code = readCallback(await waitForCallback((uri) => {
278
+ redirectUri = uri;
279
+ const url = new URL(`${deps.site.console}/oauth/authorize`);
280
+ url.search = new URLSearchParams({
281
+ response_type: "code",
282
+ client_id: id,
283
+ redirect_uri: uri,
284
+ code_challenge: challenge,
285
+ code_challenge_method: "S256",
286
+ state,
287
+ scope: options.readOnly ? "read" : "read write",
288
+ resource: mcpUrl(deps.site)
289
+ }).toString();
290
+ io.print("브라우저에서 팬덤이에 로그인하고 「허용」 을 눌러 주세요.");
291
+ io.print(`브라우저가 열리지 않으면 이 주소를 여세요:\n${url.toString()}`);
292
+ io.openBrowser(url.toString());
293
+ }), {
294
+ state,
295
+ issuer: deps.site.api
296
+ });
297
+ const response = await client.form(`${deps.site.api}${BASE_PATH}/oauth/token`, {
298
+ grant_type: "authorization_code",
299
+ client_id: id,
300
+ code,
301
+ redirect_uri: redirectUri,
302
+ code_verifier: verifier
303
+ });
304
+ const body = await response.json().catch(() => null);
305
+ if (!response.ok || !body?.access_token || !body.refresh_token) throw new CliError(`로그인을 마치지 못했어요: ${body?.error_description ?? body?.error ?? response.status}`);
306
+ await deps.store.saveLogin(deps.site.api, toLogin(body, id, deps.now()));
307
+ }
308
+ async function logout(client, deps) {
309
+ const saved = await deps.store.login(deps.site.api);
310
+ if (!saved) return false;
311
+ await client.form(`${deps.site.api}${BASE_PATH}/oauth/revoke`, {
312
+ token: saved.refreshToken,
313
+ token_type_hint: "refresh_token",
314
+ client_id: saved.clientId
315
+ }).catch(() => null);
316
+ await deps.store.saveLogin(deps.site.api, null);
317
+ return true;
318
+ }
319
+ //#endregion
320
+ //#region src/output.ts
321
+ const WIDE = /[ᄀ-ᅟ⺀-꓏가-힣豈-﫿︰-﹏＀-⦆¢-₩]/u;
322
+ function width(text) {
323
+ let total = 0;
324
+ for (const char of text) total += WIDE.test(char) ? 2 : 1;
325
+ return total;
326
+ }
327
+ const MAX_CELL = 48;
328
+ function clip(text) {
329
+ if (width(text) <= MAX_CELL) return text;
330
+ let out = "";
331
+ for (const char of text) {
332
+ if (width(out + char) > MAX_CELL - 1) break;
333
+ out += char;
334
+ }
335
+ return `${out}…`;
336
+ }
337
+ function cell(value) {
338
+ if (value === null || value === void 0) return "-";
339
+ if (typeof value === "boolean") return value ? "예" : "아니오";
340
+ if (Array.isArray(value)) return value.map(cell).join(", ");
341
+ if (typeof value === "object") return JSON.stringify(value);
342
+ return String(value).replace(/\s+/g, " ");
343
+ }
344
+ function table(rows, columns) {
345
+ if (rows.length === 0) return "(없음)";
346
+ const grid = [columns.map((column) => column.label), ...rows.map((row) => columns.map((column) => clip(column.format ? column.format(row[column.key], row) : cell(row[column.key]))))];
347
+ const widths = columns.map((_, index) => Math.max(...grid.map((line) => width(line[index] ?? ""))));
348
+ return grid.map((line) => line.map((text, index) => index === line.length - 1 ? text : text + " ".repeat((widths[index] ?? 0) - width(text))).join(" ").trimEnd()).join("\n");
349
+ }
350
+ function render(data, mode, view) {
351
+ if (mode === "json" || !view) return JSON.stringify(data, null, 2);
352
+ const listed = view.rows ? data[view.rows] : [data];
353
+ if (!Array.isArray(listed)) return JSON.stringify(data, null, 2);
354
+ const body = table(listed, view.columns);
355
+ const footer = view.footer?.(data);
356
+ return footer ? `${body}\n\n${footer}` : body;
357
+ }
358
+ const day = (value) => typeof value === "string" ? value.slice(0, 16).replace("T", " ") : "-";
359
+ //#endregion
360
+ //#region src/views.ts
361
+ const nested = (path) => (_, row) => {
362
+ let value = row;
363
+ for (const key of path.split(".")) value = value && typeof value === "object" ? value[key] : void 0;
364
+ return cell(value);
365
+ };
366
+ const nextPage = (key, flag) => (data) => typeof data[key] === "string" && data[key] ? `다음 쪽: ${flag} ${String(data[key])}` : null;
367
+ const VIEWS = {
368
+ whoami: { columns: [
369
+ {
370
+ key: "workspace",
371
+ label: "워크스페이스",
372
+ format: nested("workspace.name")
373
+ },
374
+ {
375
+ key: "user",
376
+ label: "회원",
377
+ format: nested("user.email")
378
+ },
379
+ {
380
+ key: "role",
381
+ label: "역할"
382
+ },
383
+ {
384
+ key: "key",
385
+ label: "권한",
386
+ format: nested("key.scopes")
387
+ },
388
+ {
389
+ key: "key",
390
+ label: "만료",
391
+ format: (_, row) => day(row.key?.expires_at)
392
+ }
393
+ ] },
394
+ accounts: {
395
+ rows: "accounts",
396
+ columns: [
397
+ {
398
+ key: "username",
399
+ label: "계정",
400
+ format: (value) => `@${cell(value)}`
401
+ },
402
+ {
403
+ key: "ig_id",
404
+ label: "ig_id"
405
+ },
406
+ {
407
+ key: "status",
408
+ label: "상태"
409
+ },
410
+ {
411
+ key: "connected_at",
412
+ label: "연결",
413
+ format: day
414
+ }
415
+ ]
416
+ },
417
+ media: {
418
+ rows: "items",
419
+ columns: [
420
+ {
421
+ key: "id",
422
+ label: "게시물"
423
+ },
424
+ {
425
+ key: "mediaProductType",
426
+ label: "종류"
427
+ },
428
+ {
429
+ key: "timestamp",
430
+ label: "올린 때",
431
+ format: day
432
+ },
433
+ {
434
+ key: "commentsCount",
435
+ label: "댓글"
436
+ },
437
+ {
438
+ key: "caption",
439
+ label: "글"
440
+ }
441
+ ],
442
+ footer: nextPage("next", "--after")
443
+ },
444
+ mediaStats: {
445
+ rows: "media",
446
+ columns: [
447
+ {
448
+ key: "mediaId",
449
+ label: "게시물"
450
+ },
451
+ {
452
+ key: "commentsMatched",
453
+ label: "반응"
454
+ },
455
+ {
456
+ key: "dmSent",
457
+ label: "DM"
458
+ },
459
+ {
460
+ key: "linkClicked",
461
+ label: "클릭"
462
+ }
463
+ ]
464
+ },
465
+ automations: {
466
+ rows: "automations",
467
+ columns: [
468
+ {
469
+ key: "id",
470
+ label: "id"
471
+ },
472
+ {
473
+ key: "name",
474
+ label: "이름"
475
+ },
476
+ {
477
+ key: "trigger",
478
+ label: "반응"
479
+ },
480
+ {
481
+ key: "kind",
482
+ label: "유형"
483
+ },
484
+ {
485
+ key: "active",
486
+ label: "켜짐"
487
+ },
488
+ {
489
+ key: "keywords",
490
+ label: "단어"
491
+ }
492
+ ]
493
+ },
494
+ versions: {
495
+ rows: "versions",
496
+ columns: [
497
+ {
498
+ key: "created_at",
499
+ label: "때",
500
+ format: day
501
+ },
502
+ {
503
+ key: "event",
504
+ label: "일"
505
+ },
506
+ {
507
+ key: "changed",
508
+ label: "바뀐 곳"
509
+ },
510
+ {
511
+ key: "member",
512
+ label: "누가",
513
+ format: nested("member.name")
514
+ }
515
+ ]
516
+ },
517
+ logs: {
518
+ rows: "logs",
519
+ columns: [
520
+ {
521
+ key: "created_at",
522
+ label: "때",
523
+ format: day
524
+ },
525
+ {
526
+ key: "commenter_username",
527
+ label: "사람"
528
+ },
529
+ {
530
+ key: "dm_status",
531
+ label: "DM"
532
+ },
533
+ {
534
+ key: "reply_status",
535
+ label: "답글"
536
+ },
537
+ {
538
+ key: "media_id",
539
+ label: "게시물"
540
+ },
541
+ {
542
+ key: "error",
543
+ label: "까닭"
544
+ }
545
+ ],
546
+ footer: nextPage("nextCursor", "--before")
547
+ },
548
+ people: {
549
+ rows: "people",
550
+ columns: [
551
+ {
552
+ key: "username",
553
+ label: "사람"
554
+ },
555
+ {
556
+ key: "user_id",
557
+ label: "user_id"
558
+ },
559
+ {
560
+ key: "comments",
561
+ label: "댓글"
562
+ },
563
+ {
564
+ key: "dms_sent",
565
+ label: "DM"
566
+ },
567
+ {
568
+ key: "link_clicks",
569
+ label: "클릭"
570
+ },
571
+ {
572
+ key: "email",
573
+ label: "이메일"
574
+ },
575
+ {
576
+ key: "last_at",
577
+ label: "마지막",
578
+ format: day
579
+ }
580
+ ],
581
+ footer: nextPage("nextCursor", "--before")
582
+ }
583
+ };
584
+ //#endregion
585
+ //#region src/commands.ts
586
+ const GLOBAL_OPTIONS = {
587
+ account: {
588
+ type: "string",
589
+ short: "a"
590
+ },
591
+ output: {
592
+ type: "string",
593
+ short: "o"
594
+ },
595
+ stage: { type: "string" },
596
+ help: {
597
+ type: "boolean",
598
+ short: "h"
599
+ }
600
+ };
601
+ const PERIOD = {
602
+ since: { type: "string" },
603
+ until: { type: "string" },
604
+ insiders: { type: "boolean" }
605
+ };
606
+ const PAGE = {
607
+ before: { type: "string" },
608
+ limit: { type: "string" }
609
+ };
610
+ const CONFIRM = { confirm: { type: "boolean" } };
611
+ const str = (values, key) => {
612
+ const value = values[key];
613
+ return typeof value === "string" && value.trim() ? value.trim() : void 0;
614
+ };
615
+ function limit(values) {
616
+ const raw = str(values, "limit");
617
+ if (raw === void 0) return void 0;
618
+ const value = Number(raw);
619
+ if (!Number.isInteger(value) || value < 1 || value > 200) throw new CliError("--limit 은 1~200 사이 정수예요.", EXIT.usage);
620
+ return value;
621
+ }
622
+ const compact = (args) => Object.fromEntries(Object.entries(args).filter(([, value]) => value !== void 0));
623
+ const period = (values) => ({
624
+ since: str(values, "since"),
625
+ until: str(values, "until"),
626
+ include_insiders: values.insiders === true ? true : void 0
627
+ });
628
+ const show = (ctx, data, view) => {
629
+ ctx.out(render(data, ctx.mode, view));
630
+ return EXIT.ok;
631
+ };
632
+ const read = (tool, build = () => ({}), view) => async (ctx, values, args) => {
633
+ const name = typeof tool === "function" ? tool(values) : tool;
634
+ const data = await ctx.client.callTool(name, compact({
635
+ account: str(values, "account"),
636
+ ...build(values, args)
637
+ }));
638
+ return show(ctx, data, typeof view === "function" ? view(values) : view);
639
+ };
640
+ const write = (tool, build) => async (ctx, values, args) => {
641
+ const confirm = values.confirm === true;
642
+ const data = await ctx.client.callTool(tool, compact({
643
+ account: str(values, "account"),
644
+ ...await build(values, args, ctx),
645
+ confirm: confirm ? true : void 0
646
+ }));
647
+ ctx.out(JSON.stringify(data, null, 2));
648
+ if (data.preview === true) {
649
+ if (data.valid === false) {
650
+ ctx.err(`저장할 수 없어요: ${String(data.error ?? "")}`);
651
+ return EXIT.error;
652
+ }
653
+ ctx.err("아직 바꾸지 않았어요. 바꾸려면 같은 명령에 --confirm 을 붙여 주세요.");
654
+ }
655
+ return EXIT.ok;
656
+ };
657
+ async function automationFile(values, ctx) {
658
+ const path = str(values, "file");
659
+ if (!path) throw new CliError("--file 로 자동화 JSON 을 주세요. - 면 표준 입력이에요.", EXIT.usage);
660
+ try {
661
+ const parsed = JSON.parse(await ctx.readInput(path));
662
+ if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) throw new Error("not an object");
663
+ return parsed;
664
+ } catch (caught) {
665
+ if (caught instanceof CliError) throw caught;
666
+ throw new CliError(`${path} 를 JSON 객체로 읽지 못했어요.`, EXIT.usage);
667
+ }
668
+ }
669
+ const toggle = (active) => write("set_automation_active", async (_, [id]) => ({
670
+ automation_id: id,
671
+ active
672
+ }));
673
+ function guideList(pages) {
674
+ const groups = /* @__PURE__ */ new Map();
675
+ for (const page of pages) {
676
+ const key = page.group ?? "더 보기";
677
+ groups.set(key, [...groups.get(key) ?? [], page]);
678
+ }
679
+ return [...groups].map(([title, items]) => [title, ...items.map((page) => ` ${page.title} (${page.slug})\n ${page.lead}`)].join("\n")).join("\n\n");
680
+ }
681
+ const guide = async (ctx, _values, args) => {
682
+ const listed = await ctx.client.callTool("list_guide");
683
+ const pages = Array.isArray(listed.pages) ? listed.pages : [];
684
+ const query = args.join(" ").trim();
685
+ if (!query) {
686
+ ctx.out(ctx.mode === "json" ? JSON.stringify(listed, null, 2) : guideList(pages));
687
+ return EXIT.ok;
688
+ }
689
+ if (pages.some((page) => page.slug === query)) {
690
+ const page = await ctx.client.callTool("read_guide", { slug: query });
691
+ ctx.out(ctx.mode === "json" ? JSON.stringify(page, null, 2) : `${String(page.title)}\n${String(page.url)}\n\n${String(page.text)}`);
692
+ return EXIT.ok;
693
+ }
694
+ const words = query.toLowerCase().split(/\s+/);
695
+ const found = pages.filter((page) => {
696
+ const hay = `${page.title} ${page.lead}`.toLowerCase();
697
+ return words.every((word) => hay.includes(word));
698
+ });
699
+ if (found.length === 0) throw new CliError(`「${query}」 이 든 쪽이 없어요. fandomie guide 로 목차를 보세요.`);
700
+ ctx.out(ctx.mode === "json" ? JSON.stringify({ pages: found }, null, 2) : guideList(found));
701
+ return EXIT.ok;
702
+ };
703
+ const COMMANDS = [
704
+ {
705
+ path: ["login"],
706
+ summary: "브라우저로 로그인한다. --read-only 면 읽기만 고른 채로, --no-browser 면 주소만 출력",
707
+ options: {
708
+ "read-only": { type: "boolean" },
709
+ "no-browser": { type: "boolean" }
710
+ },
711
+ run: async (ctx, values) => {
712
+ await login(ctx.client, ctx.deps, {
713
+ print: ctx.err,
714
+ openBrowser: values["no-browser"] === true ? () => {} : openBrowser
715
+ }, { readOnly: values["read-only"] === true });
716
+ const me = await ctx.client.callTool("get_workspace");
717
+ ctx.err("로그인했어요.");
718
+ return show(ctx, me, VIEWS.whoami);
719
+ }
720
+ },
721
+ {
722
+ path: ["logout"],
723
+ summary: "로그인을 끊고 이 컴퓨터의 토큰을 지운다",
724
+ run: async (ctx) => {
725
+ const done = await logout(ctx.client, ctx.deps);
726
+ ctx.err(done ? "로그아웃했어요." : "로그인한 적이 없어요.");
727
+ return EXIT.ok;
728
+ }
729
+ },
730
+ {
731
+ path: ["whoami"],
732
+ summary: "로그인한 회원, 워크스페이스, 권한, 한도",
733
+ run: read("get_workspace", () => ({}), VIEWS.whoami)
734
+ },
735
+ {
736
+ path: ["accounts"],
737
+ summary: "연결한 인스타 계정",
738
+ run: read("list_accounts", () => ({}), VIEWS.accounts)
739
+ },
740
+ {
741
+ path: ["media"],
742
+ summary: "계정의 최근 게시물(24개씩). --after 로 다음 쪽",
743
+ options: { after: { type: "string" } },
744
+ run: read("list_media", (v) => ({ after: str(v, "after") }), VIEWS.media)
745
+ },
746
+ {
747
+ path: ["stats"],
748
+ summary: "계정의 반응·DM·클릭 숫자. --posts 면 게시물마다, --media <id> 면 게시물 하나의 하루별 숫자",
749
+ options: {
750
+ ...PERIOD,
751
+ posts: { type: "boolean" },
752
+ media: { type: "string" }
753
+ },
754
+ run: read((v) => str(v, "media") ? "get_media_performance" : v.posts ? "get_media_stats" : "get_account_stats", (v) => ({
755
+ ...period(v),
756
+ media_id: str(v, "media")
757
+ }), (v) => str(v, "media") ? void 0 : v.posts ? VIEWS.mediaStats : void 0)
758
+ },
759
+ {
760
+ path: ["usage"],
761
+ summary: "워크스페이스의 사용량. --month YYYY-MM 이면 그달",
762
+ options: { month: { type: "string" } },
763
+ run: read("get_usage", (v) => ({ month: str(v, "month") }))
764
+ },
765
+ {
766
+ path: ["automations", "list"],
767
+ summary: "계정의 자동화",
768
+ run: read("list_automations", () => ({}), VIEWS.automations)
769
+ },
770
+ {
771
+ path: ["automations", "show"],
772
+ args: ["id"],
773
+ summary: "자동화 하나의 전부(update 의 --file 바탕으로 쓴다)",
774
+ run: async (ctx, values, [id]) => {
775
+ const data = await ctx.client.callTool("list_automations", compact({ account: str(values, "account") }));
776
+ const found = (Array.isArray(data.automations) ? data.automations : []).find((row) => row.id === id);
777
+ if (!found) throw new CliError(`자동화 ${id ?? ""} 를 찾지 못했어요.`);
778
+ ctx.out(JSON.stringify(found, null, 2));
779
+ return EXIT.ok;
780
+ }
781
+ },
782
+ {
783
+ path: ["automations", "history"],
784
+ args: ["id"],
785
+ summary: "자동화 하나의 변경 내역",
786
+ run: read("get_automation_history", (_, [id]) => ({ automation_id: id }), VIEWS.versions)
787
+ },
788
+ {
789
+ path: ["automations", "create"],
790
+ summary: "자동화를 만든다. --file <json|-> --confirm",
791
+ options: {
792
+ file: { type: "string" },
793
+ ...CONFIRM
794
+ },
795
+ run: write("save_automation", async (values, _, ctx) => ({ automation: await automationFile(values, ctx) }))
796
+ },
797
+ {
798
+ path: ["automations", "update"],
799
+ args: ["id"],
800
+ summary: "자동화 전부를 고친다. --file <json|-> --confirm",
801
+ options: {
802
+ file: { type: "string" },
803
+ ...CONFIRM
804
+ },
805
+ run: write("save_automation", async (values, [id], ctx) => ({
806
+ automation_id: id,
807
+ automation: await automationFile(values, ctx)
808
+ }))
809
+ },
810
+ {
811
+ path: ["automations", "on"],
812
+ args: ["id"],
813
+ summary: "자동화를 켠다(실제 DM 이 나간다). --confirm",
814
+ options: CONFIRM,
815
+ run: toggle(true)
816
+ },
817
+ {
818
+ path: ["automations", "off"],
819
+ args: ["id"],
820
+ summary: "자동화를 끈다. --confirm",
821
+ options: CONFIRM,
822
+ run: toggle(false)
823
+ },
824
+ {
825
+ path: ["logs"],
826
+ summary: "댓글마다 한 일. --media <id> --status error|skipped --before --limit",
827
+ options: {
828
+ media: { type: "string" },
829
+ status: { type: "string" },
830
+ ...PAGE
831
+ },
832
+ run: read("list_logs", (v) => ({
833
+ media_id: str(v, "media"),
834
+ status: str(v, "status"),
835
+ before: str(v, "before"),
836
+ limit: limit(v)
837
+ }), VIEWS.logs)
838
+ },
839
+ {
840
+ path: ["people"],
841
+ summary: "계정에 반응한 사람. -q <아이디 일부> --filter email|clicked|missed --before --limit",
842
+ options: {
843
+ q: {
844
+ type: "string",
845
+ short: "q"
846
+ },
847
+ filter: { type: "string" },
848
+ ...PAGE
849
+ },
850
+ run: read("list_people", (v) => ({
851
+ q: str(v, "q"),
852
+ filter: str(v, "filter"),
853
+ before: str(v, "before"),
854
+ limit: limit(v)
855
+ }), VIEWS.people)
856
+ },
857
+ {
858
+ path: ["people", "show"],
859
+ args: ["user_id"],
860
+ summary: "한 사람의 댓글·DM·버튼 대화·링크 기록",
861
+ run: read("get_person", (_, [userId]) => ({ user_id: userId }))
862
+ },
863
+ {
864
+ path: ["guide"],
865
+ args: ["slug|검색어"],
866
+ variadic: true,
867
+ summary: "고객 가이드. 인자가 없으면 목차, slug 면 그 쪽의 본문, 아니면 제목·요약에 그 말이 든 쪽",
868
+ run: guide
869
+ },
870
+ {
871
+ path: ["mcp"],
872
+ summary: "MCP 주소와 Claude Code 에 붙이는 법",
873
+ run: async (ctx) => {
874
+ const url = mcpUrl(ctx.deps.site);
875
+ ctx.out([
876
+ `MCP 주소: ${url}`,
877
+ "",
878
+ "Claude·ChatGPT: 커넥터 추가에 위 주소를 넣으면 로그인 창이 떠요.",
879
+ "Claude Code:",
880
+ ` claude mcp add --transport http fandomie ${url} --header "Authorization: Bearer <키>"`,
881
+ `키는 ${ctx.deps.site.console}/settings?tab=api 에서 만들어요.`
882
+ ].join("\n"));
883
+ return EXIT.ok;
884
+ }
885
+ }
886
+ ];
887
+ function findCommand(argv) {
888
+ const valued = new Set([...Object.entries(GLOBAL_OPTIONS), ...COMMANDS.flatMap((item) => Object.entries(item.options ?? {}))].filter(([, option]) => option.type === "string").flatMap(([name, option]) => [`--${name}`, ..."short" in option ? [`-${option.short}`] : []]));
889
+ const words = [];
890
+ for (let index = 0; index < argv.length && words.length < 2; index += 1) {
891
+ const token = argv[index] ?? "";
892
+ if (token.startsWith("-")) {
893
+ if (valued.has(token)) index += 1;
894
+ continue;
895
+ }
896
+ words.push(index);
897
+ }
898
+ const names = words.map((index) => argv[index] ?? "");
899
+ const command = COMMANDS.find((item) => item.path.length === 2 && item.path.join(" ") === names.join(" ")) ?? COMMANDS.find((item) => item.path.length === 1 && item.path[0] === names[0]);
900
+ if (!command) return null;
901
+ const used = new Set(words.slice(0, command.path.length));
902
+ return {
903
+ command,
904
+ rest: argv.filter((_, index) => !used.has(index))
905
+ };
906
+ }
907
+ function parseCommand(command, rest) {
908
+ try {
909
+ const { values, positionals } = parseArgs({
910
+ args: rest,
911
+ options: {
912
+ ...GLOBAL_OPTIONS,
913
+ ...command.options
914
+ },
915
+ allowPositionals: true,
916
+ strict: true
917
+ });
918
+ const expected = command.args ?? [];
919
+ if (!values.help && !command.variadic && positionals.length !== expected.length) throw new CliError(`쓰는 법: fandomie ${usage(command)}`, EXIT.usage);
920
+ return {
921
+ values,
922
+ args: positionals
923
+ };
924
+ } catch (caught) {
925
+ if (caught instanceof CliError) throw caught;
926
+ throw new CliError(`${caught instanceof Error ? caught.message : String(caught)}\n쓰는 법: fandomie ${usage(command)}`, EXIT.usage);
927
+ }
928
+ }
929
+ const usage = (command) => [
930
+ ...command.path,
931
+ ...(command.args ?? []).map((arg) => command.variadic ? `[${arg}]` : `<${arg}>`),
932
+ ...Object.entries(command.options ?? {}).map(([name, option]) => option.type === "string" ? `[--${name} <값>]` : `[--${name}]`)
933
+ ].join(" ");
934
+ function help() {
935
+ return [
936
+ "팬덤이 CLI — 성과·내역·자동화 설정을 터미널에서 다룬다",
937
+ "",
938
+ "쓰는 법: fandomie <명령> [옵션]",
939
+ "",
940
+ "명령:",
941
+ ...COMMANDS.map((command) => ` ${command.path.join(" ").padEnd(22)}${command.summary}`),
942
+ "",
943
+ "공통 옵션:",
944
+ " -a, --account <아이디> 인스타 계정(@아이디 또는 ig_id). 연결한 계정이 하나면 빼도 된다",
945
+ " -o, --output table|json 출력 꼴. 터미널이면 table, 파이프면 json",
946
+ " -h, --help 명령의 쓰는 법",
947
+ "",
948
+ "로그인: fandomie login 또는 FANDOMIE_TOKEN=<콘솔에서 만든 키>",
949
+ "한도: 키마다 1초에 한 번, 워크스페이스 전체로 하루 2,000번. 1초 한도는 알아서 기다린다",
950
+ "종료 코드: 0 성공, 1 오류, 2 인자 오류, 3 로그인 필요, 4 한도"
951
+ ].join("\n");
952
+ }
953
+ //#endregion
954
+ //#region src/store.ts
955
+ const EMPTY = {
956
+ logins: {},
957
+ clients: {}
958
+ };
959
+ function configDir(env = process.env, platform = process.platform, home = homedir()) {
960
+ if (platform === "win32" && env.APPDATA) return join(env.APPDATA, "fandomie");
961
+ return join(env.XDG_CONFIG_HOME || join(home, ".config"), "fandomie");
962
+ }
963
+ const LOCK_STALE_MS = 3e4;
964
+ const LOCK_WAIT_MS = 15e3;
965
+ var Store = class {
966
+ dir;
967
+ sleep;
968
+ file;
969
+ lock;
970
+ constructor(dir, sleep = (ms) => new Promise((done) => setTimeout(done, ms))) {
971
+ this.dir = dir;
972
+ this.sleep = sleep;
973
+ this.file = join(dir, "credentials.json");
974
+ this.lock = join(dir, "refresh.lock");
975
+ }
976
+ async read() {
977
+ try {
978
+ const parsed = JSON.parse(await readFile(this.file, "utf8"));
979
+ return {
980
+ logins: parsed.logins ?? {},
981
+ clients: parsed.clients ?? {}
982
+ };
983
+ } catch {
984
+ return {
985
+ ...EMPTY,
986
+ logins: {},
987
+ clients: {}
988
+ };
989
+ }
990
+ }
991
+ async login(api) {
992
+ return (await this.read()).logins[api] ?? null;
993
+ }
994
+ async client(api) {
995
+ return (await this.read()).clients[api] ?? null;
996
+ }
997
+ async saveLogin(api, login) {
998
+ const saved = await this.read();
999
+ if (login) {
1000
+ saved.logins[api] = login;
1001
+ saved.clients[api] = login.clientId;
1002
+ } else delete saved.logins[api];
1003
+ await this.write(saved);
1004
+ }
1005
+ async saveClient(api, clientId) {
1006
+ const saved = await this.read();
1007
+ saved.clients[api] = clientId;
1008
+ await this.write(saved);
1009
+ }
1010
+ async write(saved) {
1011
+ await mkdir(this.dir, {
1012
+ recursive: true,
1013
+ mode: 448
1014
+ });
1015
+ const temp = `${this.file}.${process.pid}.tmp`;
1016
+ await writeFile(temp, `${JSON.stringify(saved, null, 2)}\n`, { mode: 384 });
1017
+ await rename(temp, this.file);
1018
+ }
1019
+ async withLock(run) {
1020
+ await mkdir(this.dir, {
1021
+ recursive: true,
1022
+ mode: 448
1023
+ });
1024
+ const started = Date.now();
1025
+ for (;;) try {
1026
+ await mkdir(this.lock);
1027
+ break;
1028
+ } catch (caught) {
1029
+ if (caught.code !== "EEXIST") throw caught;
1030
+ if (await stat(this.lock).then((info) => Date.now() - info.mtimeMs, () => 0) > LOCK_STALE_MS) {
1031
+ await rm(this.lock, {
1032
+ recursive: true,
1033
+ force: true
1034
+ });
1035
+ continue;
1036
+ }
1037
+ if (Date.now() - started > LOCK_WAIT_MS) throw new CliError(`다른 fandomie 명령이 로그인을 갱신하고 있어요. 계속되면 ${this.lock} 을 지워 주세요.`);
1038
+ await this.sleep(100);
1039
+ }
1040
+ try {
1041
+ return await run();
1042
+ } finally {
1043
+ await rm(this.lock, {
1044
+ recursive: true,
1045
+ force: true
1046
+ });
1047
+ }
1048
+ }
1049
+ };
1050
+ //#endregion
1051
+ //#region src/main.ts
1052
+ async function readStdin() {
1053
+ const chunks = [];
1054
+ for await (const chunk of process.stdin) chunks.push(chunk);
1055
+ return Buffer.concat(chunks).toString("utf8");
1056
+ }
1057
+ const PROCESS_IO = {
1058
+ out: (text) => process.stdout.write(`${text}\n`),
1059
+ err: (text) => process.stderr.write(`${text}\n`),
1060
+ isTTY: process.stdout.isTTY === true,
1061
+ stdin: readStdin
1062
+ };
1063
+ async function main(argv, version, io = PROCESS_IO, override = {}) {
1064
+ if (argv.length === 0 || argv[0] === "--help" || argv[0] === "-h" || argv[0] === "help") {
1065
+ io.out(help());
1066
+ return EXIT.ok;
1067
+ }
1068
+ if (argv[0] === "--version" || argv[0] === "-v") {
1069
+ io.out(version);
1070
+ return EXIT.ok;
1071
+ }
1072
+ try {
1073
+ const found = findCommand(argv);
1074
+ if (!found) throw new CliError(`모르는 명령이에요: ${argv.join(" ")}\nfandomie --help 로 명령을 보세요.`, EXIT.usage);
1075
+ const { values, args } = parseCommand(found.command, found.rest);
1076
+ if (values.help) {
1077
+ io.out(`쓰는 법: fandomie ${usage(found.command)}\n\n${found.command.summary}`);
1078
+ return EXIT.ok;
1079
+ }
1080
+ const site = siteFor(typeof values.stage === "string" ? values.stage : process.env.FANDOMIE_STAGE);
1081
+ if (!site) throw new CliError("--stage 는 prod 나 stg 예요.", EXIT.usage);
1082
+ const output = values.output;
1083
+ if (output !== void 0 && output !== "table" && output !== "json") throw new CliError("--output 은 table 이나 json 이에요.", EXIT.usage);
1084
+ const mode = output ?? (io.isTTY ? "table" : "json");
1085
+ const deps = {
1086
+ site,
1087
+ store: new Store(configDir()),
1088
+ env: process.env,
1089
+ fetch: globalThis.fetch,
1090
+ sleep: (ms) => new Promise((done) => setTimeout(done, ms)),
1091
+ now: Date.now,
1092
+ version,
1093
+ ...override
1094
+ };
1095
+ const context = {
1096
+ client: new Client(deps),
1097
+ deps,
1098
+ mode,
1099
+ out: io.out,
1100
+ err: io.err,
1101
+ readInput: (path) => path === "-" ? io.stdin() : readFile(path, "utf8")
1102
+ };
1103
+ return await found.command.run(context, values, args);
1104
+ } catch (caught) {
1105
+ if (caught instanceof CliError) {
1106
+ io.err(caught.message);
1107
+ return caught.code;
1108
+ }
1109
+ io.err(`예상하지 못한 오류예요: ${caught instanceof Error ? caught.message : String(caught)}`);
1110
+ return EXIT.error;
1111
+ }
1112
+ }
1113
+ //#endregion
1114
+ //#region src/cli.ts
1115
+ main(process.argv.slice(2), version).then((code) => {
1116
+ process.exitCode = code;
1117
+ });
1118
+ //#endregion
1119
+ export {};
package/package.json CHANGED
@@ -1,6 +1,22 @@
1
1
  {
2
2
  "name": "fandomie",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.2.0",
4
+ "description": "팬덤이(인스타 댓글 DM 자동화)의 성과·내역·자동화 설정을 터미널에서 다루는 CLI",
5
+ "license": "UNLICENSED",
6
+ "homepage": "https://fandomie.nangmanpg.com",
7
+ "bin": {
8
+ "fandomie": "./dist/cli.mjs"
9
+ },
10
+ "files": [
11
+ "dist"
12
+ ],
13
+ "engines": {
14
+ "node": ">=20"
15
+ },
16
+ "scripts": {
17
+ "build": "tsdown",
18
+ "test": "jest --config ../../jest.config.js --selectProjects cli-fandomie --coverage=false",
19
+ "tsc:once": "tsc --noEmit",
20
+ "prepublishOnly": "pnpm build"
21
+ }
22
+ }