@team-semicolon/semo-cli 4.0.4 → 4.0.5

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/dist/index.js +35 -15
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -822,6 +822,8 @@ program
822
822
  }
823
823
  // 7. Hooks 설치 (대화 로깅)
824
824
  await setupHooks(cwd, false);
825
+ // 7.5. ~/.semo.env 템플릿 생성 (없는 경우)
826
+ setupSemoEnvTemplate();
825
827
  // 8. CLAUDE.md 생성
826
828
  await setupClaudeMd(cwd, [], options.force);
827
829
  // 9. 설치 검증
@@ -847,9 +849,11 @@ program
847
849
  console.log(chalk_1.default.gray(" ✓ semo-agents (14개 페르소나 Agent)"));
848
850
  console.log(chalk_1.default.gray(" ✓ semo-scripts (자동화 스크립트)"));
849
851
  console.log(chalk_1.default.cyan("\n다음 단계:"));
850
- console.log(chalk_1.default.gray(" 1. Claude Code에서 프로젝트 열기"));
851
- console.log(chalk_1.default.gray(" 2. 자연어로 요청하기 (예: \"댓글 기능 구현해줘\")"));
852
- console.log(chalk_1.default.gray(" 3. /SEMO:help로 도움말 확인"));
852
+ console.log(chalk_1.default.gray(" 1. ~/.semo.env에 DB 접속 정보 입력 (이미 존재하면 생략)"));
853
+ console.log(chalk_1.default.gray(" DATABASE_URL='postgres://user:pass@host:5432/appdb'"));
854
+ console.log(chalk_1.default.gray(" 2. Claude Code에서 프로젝트 열기 (SessionStart 훅이 자동 sync)"));
855
+ console.log(chalk_1.default.gray(" 3. 자연어로 요청하기 (예: \"댓글 기능 구현해줘\")"));
856
+ console.log(chalk_1.default.gray(" 4. /SEMO:help로 도움말 확인"));
853
857
  console.log();
854
858
  });
855
859
  // === Standard 설치 (DB 기반) ===
@@ -1360,16 +1364,6 @@ function printVerificationResult(result) {
1360
1364
  }
1361
1365
  }
1362
1366
  const BASE_MCP_SERVERS = [
1363
- {
1364
- name: "semo-integrations",
1365
- command: "npx",
1366
- args: ["-y", "@team-semicolon/semo-mcp"],
1367
- env: {
1368
- // Slack/GitHub/DB 토큰은 패키지에 암호화 포함됨 (설정 불필요)
1369
- SUPABASE_URL: "${SUPABASE_URL}",
1370
- SUPABASE_KEY: "${SUPABASE_KEY}",
1371
- },
1372
- },
1373
1367
  {
1374
1368
  name: "context7",
1375
1369
  command: "npx",
@@ -1391,6 +1385,32 @@ const BASE_MCP_SERVERS = [
1391
1385
  args: ["-y", "@modelcontextprotocol/server-github"],
1392
1386
  },
1393
1387
  ];
1388
+ // === ~/.semo.env 템플릿 생성 ===
1389
+ function setupSemoEnvTemplate() {
1390
+ const envFile = path.join(os.homedir(), ".semo.env");
1391
+ if (fs.existsSync(envFile))
1392
+ return; // 이미 존재하면 건너뜀
1393
+ const template = `# SEMO 환경변수 — 모든 컨텍스트에서 자동 로드됨
1394
+ # (Claude Code 앱, OpenClaw LaunchAgent, cron 등 비인터랙티브 환경 포함)
1395
+ #
1396
+ # 팀 Core DB 접속 정보를 여기에 입력하세요.
1397
+ # 설정 후 Claude Code 세션을 재시작하면 자동으로 context sync가 동작합니다.
1398
+
1399
+ DATABASE_URL=''
1400
+
1401
+ # Slack 알림 Webhook (선택 — bot-ops 채널 dead-letter 감지용)
1402
+ SLACK_WEBHOOK=''
1403
+ `;
1404
+ try {
1405
+ fs.writeFileSync(envFile, template, { mode: 0o600 });
1406
+ console.log(chalk_1.default.cyan("\n📄 ~/.semo.env 템플릿 생성됨"));
1407
+ console.log(chalk_1.default.yellow(" ⚠️ DATABASE_URL을 팀 Core DB 접속 정보로 채워주세요!"));
1408
+ console.log(chalk_1.default.gray(` 파일: ${envFile}`));
1409
+ }
1410
+ catch {
1411
+ // silent — 권한 등으로 실패해도 무시
1412
+ }
1413
+ }
1394
1414
  // === Claude MCP 서버 존재 여부 확인 ===
1395
1415
  function isMCPServerRegistered(serverName) {
1396
1416
  try {
@@ -1597,7 +1617,7 @@ async function setupHooks(cwd, isUpdate = false) {
1597
1617
  hooks: [
1598
1618
  {
1599
1619
  type: "command",
1600
- command: "semo context sync 2>/dev/null || true",
1620
+ command: ". ~/.semo.env 2>/dev/null; semo context sync 2>/dev/null || true",
1601
1621
  timeout: 30,
1602
1622
  },
1603
1623
  ],
@@ -1631,7 +1651,7 @@ async function setupHooks(cwd, isUpdate = false) {
1631
1651
  hooks: [
1632
1652
  {
1633
1653
  type: "command",
1634
- command: "semo context push 2>/dev/null || true",
1654
+ command: ". ~/.semo.env 2>/dev/null; semo context push 2>/dev/null || true",
1635
1655
  timeout: 30,
1636
1656
  },
1637
1657
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@team-semicolon/semo-cli",
3
- "version": "4.0.4",
3
+ "version": "4.0.5",
4
4
  "description": "SEMO CLI - AI Agent Orchestration Framework Installer",
5
5
  "main": "dist/index.js",
6
6
  "bin": {