graphify 설치 스크립트 추가 및 README 바이브 코딩 도우미 섹션 개편
This commit is contained in:
1 parent
4e82bde404
commit
1de104e30c
5 files changed
+438
-1
No files matched your search
@@ -30,6 +30,9 @@
|
||||
* **[Codex CLI](https://developers.openai.com/codex/cli)** - OpenAI의 공식 터미널 기반 로컬 대화형 코딩 에이전트 CLI
|
||||
* **[OpenCode](https://opencode.ai/)** - 75개 이상의 LLM 프로바이더를 지원하는 터미널 TUI 기반 오픈소스 AI 코딩 에이전트
|
||||
* **[pi](https://pi.dev/)** - 대화형 CLI AI 코딩 어시스턴트 및 추천 플러그인 패키지 일괄 설치 도구
|
||||
|
||||
### 🧠 5. 바이브 코딩 도우미 (Vibe Coding Assistants)
|
||||
* **[graphify](https://github.com/astral-sh/uv)** - 코드베이스를 지식 그래프로 변환하여 에이전트의 컨텍스트 이해를 극대화하는 분석 도구
|
||||
* **[Open Code Review (ocr)](https://github.com/alibaba/open-code-review)** - AI 기반의 오픈소스 코드 리뷰 자동화 도구
|
||||
|
||||
---
|
||||
@@ -136,6 +139,14 @@
|
||||
curl -fsSL "https://gl.isitsoft.kr/publicproj/install-sh/-/raw/main/install-pi.sh?ref_type=heads" | bash
|
||||
```
|
||||
|
||||
#### 🧠 5. 바이브 코딩 도우미 (Vibe Coding Assistants)
|
||||
|
||||
* **graphify:**
|
||||
```bash
|
||||
curl -fsSL "https://gl.isitsoft.kr/publicproj/install-sh/-/raw/main/install-graphify.sh?ref_type=heads" | bash
|
||||
```
|
||||
> 💡 **사전 요구사항:** Python 패키지 관리자 `uv`가 먼저 설치되어 있어야 합니다.
|
||||
|
||||
* **Open Code Review (ocr):**
|
||||
```bash
|
||||
curl -fsSL "https://gl.isitsoft.kr/publicproj/install-sh/-/raw/main/install-ocr.sh?ref_type=heads" | bash
|
||||
@@ -325,6 +336,19 @@
|
||||
$t="$env:TEMP\install-pi.ps1"; iwr -useb 'https://gl.isitsoft.kr/publicproj/install-sh/-/raw/main/install-pi.ps1' -OutFile $t; powershell -ExecutionPolicy Bypass -File $t
|
||||
```
|
||||
|
||||
#### 🧠 5. 바이브 코딩 도우미 (Vibe Coding Assistants)
|
||||
|
||||
* **graphify:**
|
||||
* **CMD 창에서 설치 시:**
|
||||
```cmd
|
||||
powershell -ExecutionPolicy Bypass -c "[Net.ServicePointManager]::SecurityProtocol=[Net.SecurityProtocolType]::Tls12; $t=\"$env:TEMP\install-graphify.ps1\"; iwr -useb 'https://gl.isitsoft.kr/publicproj/install-sh/-/raw/main/install-graphify.ps1' -OutFile $t; & $t"
|
||||
```
|
||||
* **파워쉘 창에서 설치 시:**
|
||||
```powershell
|
||||
$t="$env:TEMP\install-graphify.ps1"; iwr -useb 'https://gl.isitsoft.kr/publicproj/install-sh/-/raw/main/install-graphify.ps1' -OutFile $t; powershell -ExecutionPolicy Bypass -File $t
|
||||
```
|
||||
> 💡 **사전 요구사항:** Python 패키지 관리자 `uv`가 먼저 설치되어 있어야 합니다.
|
||||
|
||||
* **Open Code Review (ocr):**
|
||||
* **CMD 창에서 설치 시:**
|
||||
```cmd
|
||||
@@ -698,7 +722,29 @@ pi --help # 도움말 및 사용 가능 커맨드 파악
|
||||
pi list # 현재 설치 완료된 플러그인 에코시스템 목록 출력
|
||||
```
|
||||
|
||||
#### 4.6. Open Code Review
|
||||
---
|
||||
|
||||
### 🧠 5. 바이브 코딩 도우미 (Vibe Coding Assistants)
|
||||
|
||||
#### 5.1. graphify
|
||||
코드베이스, 문서, 아키텍처를 지식 그래프(Knowledge Graph)로 구조화하여 AI 에이전트가 방대한 코드베이스를 단번에 파악하고 질문에 정밀하게 답변할 수 있도록 돕는 지식 그래프 분석 엔진입니다. Antigravity, Claude Code, Codex, OpenCode 등 다양한 바이브 코딩 에이전트와 매끄럽게 연동되며 Gemini MCP 서버를 지원합니다.
|
||||
|
||||
##### [주요 특징]
|
||||
* **다차원 지식 그래프 구축** — AST 구문 분석과 시맨틱 요약을 통해 함수, 클래스, 모듈 간의 호출 및 상속 관계를 시각적 그래프로 인덱싱
|
||||
* **자연어 질의(Query) & 경로 탐색(Path)** — 코드베이스에 대한 질문을 던지면 관련 서브그래프를 추출하고, 두 심볼 간의 최단 호출 경로 추적
|
||||
* **원클릭 에이전트 연동** — `graphify antigravity/claude/codex/opencode install` 명령어로 에이전트 규칙 및 MCP 환경 자동 셋업
|
||||
* **Gemini MCP 연동** — Antigravity 및 Gemini 환경에서 `mcp_config.json`을 통해 실시간 MCP 서비스로 연동
|
||||
|
||||
##### [graphify 기본 사용법]
|
||||
```bash
|
||||
graphify . # 현재 디렉토리의 코드베이스 그래프 빌드/갱신
|
||||
graphify query "프로젝트의 핵심 구조와 진입점을 설명해줘" # 지식 그래프 기반 자연어 질의
|
||||
graphify path "AuthManager" "DatabasePool" # 두 심볼 간의 연관 호출 관계 경로 추적
|
||||
graphify explain "WorkerProcess" # 특정 클래스/함수 노드의 상세 정보 확인
|
||||
graphify update . # AST 기반 초고속 증분 업데이트 (무비용)
|
||||
```
|
||||
|
||||
#### 5.2. Open Code Review (ocr)
|
||||
Alibaba에서 개발한 AI 기반 오픈소스 코드 리뷰 자동화 도구입니다. 결정론적 엔지니어링 분석 기법과 LLM 에이전트의 강점을 하이브리드로 결합하여 코드 변경 사항의 컨텍스트를 깊이 있게 추적하고 리뷰 의견을 생성합니다.
|
||||
|
||||
##### [주요 특징]
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
# Graphify 설치 스크립트 구현 계획 (INSTALL-GRAPHIFY-IMP-PLAN)
|
||||
|
||||
## 1. 개요
|
||||
지식 그래프 기반의 코드베이스 분석 도구인 `graphify`를 설치하고, 다양한 바이브 코딩 에이전트(Antigravity, Claude, Codex, OpenCode) 및 Gemini MCP 연동을 자동으로 구성하는 크로스 플랫폼 설치 스크립트(`install-graphify.sh`, `install-graphify.ps1`)를 구현하고 문서를 개편합니다.
|
||||
|
||||
```mermaid
|
||||
flowchart TD
|
||||
Start([시작]) --> CheckUV{uv 설치 여부 확인}
|
||||
CheckUV -- 미설치 --> ErrorExit[uv 필요 안내 및 종료]
|
||||
CheckUV -- 설치됨 --> InstallGraphify[uv tool install 'graphifyy[pdf,openai,anthropic,gemini]']
|
||||
InstallGraphify --> AgentConfig[각 에이전트 연동 설정<br/>antigravity/claude/codex/opencode]
|
||||
AgentConfig --> GeminiMCP[Gemini MCP 설정 반영<br/>~/.gemini/antigravity/mcp_config.json]
|
||||
GeminiMCP --> Done([완료])
|
||||
```
|
||||
|
||||
## 2. 작업 단계 및 체크리스트
|
||||
|
||||
### 단계 1: 실행 계획 수립 및 환경 분석
|
||||
- [x] 작업 계획서(`VIBE-WORK/261012/INSTALL-GRAPHIFY-IMP-PLAN.md`) 작성
|
||||
|
||||
### 단계 2: Unix / macOS용 `install-graphify.sh` 구현
|
||||
- [x] `uv` 설치 여부 확인 로직 구현 (미설치 시 친절한 안내 메시지 출력 후 종료)
|
||||
- [x] `uv tool install --upgrade 'graphifyy[pdf,openai,anthropic,gemini]'` 실행
|
||||
- [x] 바이브 코딩 에이전트 연동 명령어 실행:
|
||||
- `graphify antigravity install`
|
||||
- `graphify claude install`
|
||||
- `graphify codex install`
|
||||
- `graphify opencode install`
|
||||
- [x] `~/.gemini/antigravity/mcp_config.json` 생성 및 갱신 로직 구현 (python `uv run` 활용)
|
||||
- [x] 실행 권한 부여 (`chmod +x install-graphify.sh`) 및 문법 검증
|
||||
|
||||
### 단계 3: Windows PowerShell용 `install-graphify.ps1` 구현
|
||||
- [x] `uv` 존재 여부 확인 (`Get-Command uv`) 및 미설치 시 에러 출력 후 종료
|
||||
- [x] `uv tool install --upgrade 'graphifyy[pdf,openai,anthropic,gemini]'` 실행
|
||||
- [x] 바이브 코딩 에이전트 연동 실행 (오류 발생 시에도 유연하게 처리)
|
||||
- [x] `$env:USERPROFILE\.gemini\antigravity\mcp_config.json` 생성 및 갱신 로직 구현
|
||||
- [x] PowerShell 문법 검증
|
||||
|
||||
### 단계 4: `README.md` 문서 개편
|
||||
- [x] 최상단 목차에 `5. 바이브 코딩 도우미 (Vibe Coding Assistants)` 추가
|
||||
- [x] 5장에 `graphify` (5.1) 추가
|
||||
- [x] 기존 4장에 있던 `Open Code Review`를 5장 하위(5.2)로 이동 및 번호 재정렬
|
||||
- [x] Bash / PowerShell 원클릭 설치 스크립트 안내에 `install-graphify` 추가 및 문서 정리
|
||||
|
||||
### 단계 5: 완료 보고서 작성 및 Graphify 갱신 / Git 커밋
|
||||
- [x] 완료 보고서(`VIBE-WORK/261012/INSTALL-GRAPHIFY-PHASE01.md`) 작성
|
||||
- [x] `uv tool run --from graphifyy graphify . --update` 실행
|
||||
- [x] Git commit 및 push
|
||||
@@ -0,0 +1,50 @@
|
||||
# Graphify 설치 스크립트 구현 완료 보고서 (INSTALL-GRAPHIFY-PHASE01)
|
||||
|
||||
## 1. 개요
|
||||
지식 그래프 기반의 코드베이스 분석 및 컨텍스트 이해 도구인 `graphify`의 크로스 플랫폼 원클릭 설치 스크립트(`install-graphify.sh`, `install-graphify.ps1`)를 구현하고, `README.md` 문서를 개편하여 "5. 바이브 코딩 도우미" 섹션을 신설하였습니다.
|
||||
|
||||
```mermaid
|
||||
flowchart LR
|
||||
subgraph Prerequisites[사전 요구사항]
|
||||
UV["uv 확인 (없으면 안내 후 종료)"]
|
||||
end
|
||||
|
||||
subgraph Install[설치]
|
||||
UV --> Graphify["uv tool install 'graphifyy[pdf,openai,anthropic,gemini]'"]
|
||||
end
|
||||
|
||||
subgraph Integrations[에이전트 및 MCP 연동]
|
||||
Graphify --> Agents["graphify {antigravity,claude,codex,opencode} install"]
|
||||
Graphify --> GeminiMCP["~/.gemini/antigravity/mcp_config.json 구성"]
|
||||
end
|
||||
|
||||
subgraph Assistants[바이브 코딩 도우미]
|
||||
Agents --> Section5["README.md 5장: graphify (5.1) & ocr (5.2)"]
|
||||
GeminiMCP --> Section5
|
||||
end
|
||||
```
|
||||
|
||||
## 2. 세부 구현 내역
|
||||
|
||||
### 2.1. Unix/macOS용 설치 스크립트 (`install-graphify.sh`)
|
||||
- `uv` 설치 여부 점검 (`command -v uv`), 미설치 시 친절한 설치 안내 메시지 및 에러 종료 처리
|
||||
- `uv tool install --upgrade 'graphifyy[pdf,openai,anthropic,gemini]'` 실행으로 추가 옵션 포함 설치
|
||||
- 4대 주요 바이브 코딩 에이전트 연동:
|
||||
- `graphify antigravity install`
|
||||
- `graphify claude install`
|
||||
- `graphify codex install`
|
||||
- `graphify opencode install`
|
||||
- `~/.gemini/antigravity/mcp_config.json` 자동 구성:
|
||||
- `mcpServers.graphify` 또는 루트 레벨 `"graphify"` 엔트리로 안전하게 병합 및 저장
|
||||
|
||||
### 2.2. Windows PowerShell용 설치 스크립트 (`install-graphify.ps1`)
|
||||
- `Get-Command uv`를 통해 `uv` 설치 여부 확인 및 안내
|
||||
- `uv tool install --upgrade 'graphifyy[pdf,openai,anthropic,gemini]'` 실행
|
||||
- 각 에이전트 연동 명령 실행 및 에러 허용 처리
|
||||
- `$env:USERPROFILE\.gemini\antigravity\mcp_config.json`을 읽고 파싱하여 JSON 형태로 안전하게 생성/갱신
|
||||
|
||||
### 2.3. 문서 개편 (`README.md`)
|
||||
- 최상단 카테고리에 `5. 바이브 코딩 도우미 (Vibe Coding Assistants)` 신설
|
||||
- 5.1로 `graphify` 등록 및 원클릭 설치 명령어(Bash, PowerShell, CMD) 추가
|
||||
- 4장에 있던 `Open Code Review (ocr)`를 5장 하위(5.2)로 이동하여 바이브 코딩 보조 도구로 체계화
|
||||
- 상세 사용법 및 명령어 안내 보강
|
||||
@@ -0,0 +1,154 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
graphify install and vibe coding agent integration script for Windows PowerShell.
|
||||
|
||||
.DESCRIPTION
|
||||
Installs graphify via Astral uv tool and sets up agent integrations
|
||||
(Antigravity, Claude, Codex, OpenCode) along with Gemini MCP configuration.
|
||||
|
||||
.NOTES
|
||||
Author: mcchae
|
||||
#>
|
||||
|
||||
[CmdletBinding()]
|
||||
param()
|
||||
|
||||
Set-StrictMode -Version Latest
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
# Enforce TLS 1.2+ for HTTPS downloads
|
||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
||||
|
||||
# ────────────────────────────────────────────
|
||||
# Utility functions (English only to prevent Windows console encoding issues)
|
||||
# ────────────────────────────────────────────
|
||||
function Info { Write-Host "[INFO] $args" -ForegroundColor Cyan }
|
||||
function Warn { Write-Host "[WARN] $args" -ForegroundColor Yellow }
|
||||
function Success { Write-Host "[OK] $args" -ForegroundColor Green }
|
||||
function ErrExit { Write-Host "[ERROR] $args" -ForegroundColor Red; exit 1 }
|
||||
|
||||
# ────────────────────────────────────────────
|
||||
# Check uv prerequisite
|
||||
# ────────────────────────────────────────────
|
||||
function Check-Requirements {
|
||||
$uvCmd = Get-Command uv -ErrorAction SilentlyContinue
|
||||
if (-not $uvCmd) {
|
||||
Write-Host ""
|
||||
Write-Host "=================================================================" -ForegroundColor Red
|
||||
Write-Host "[ERROR] 'uv' package manager is not installed or not in PATH." -ForegroundColor Red
|
||||
Write-Host "graphify requires 'uv' to be installed first." -ForegroundColor Yellow
|
||||
Write-Host "Please install uv using the following command:" -ForegroundColor Yellow
|
||||
Write-Host ""
|
||||
Write-Host " powershell -ExecutionPolicy ByPass -c `"irm https://astral.sh/uv/install.ps1 | iex`"" -ForegroundColor White
|
||||
Write-Host "=================================================================" -ForegroundColor Red
|
||||
Write-Host ""
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
||||
# ────────────────────────────────────────────
|
||||
# Gemini MCP configuration
|
||||
# ────────────────────────────────────────────
|
||||
function Configure-GeminiMcp {
|
||||
$geminiDir = Join-Path $env:USERPROFILE ".gemini\antigravity"
|
||||
$configFile = Join-Path $geminiDir "mcp_config.json"
|
||||
|
||||
if (-not (Test-Path $geminiDir)) {
|
||||
New-Item -ItemType Directory -Path $geminiDir -Force | Out-Null
|
||||
}
|
||||
|
||||
Info "Configuring Gemini MCP config at: $configFile"
|
||||
|
||||
$graphifyEntry = @{
|
||||
command = "uv"
|
||||
args = @(
|
||||
"run",
|
||||
"--with",
|
||||
"graphifyy",
|
||||
"--with",
|
||||
"mcp",
|
||||
"-m",
|
||||
"graphify.serve",
|
||||
"`${workspace.path}/graphify-out/graph.json"
|
||||
)
|
||||
}
|
||||
|
||||
$data = @{}
|
||||
if (Test-Path $configFile) {
|
||||
try {
|
||||
$rawContent = Get-Content -Path $configFile -Raw -Encoding UTF8
|
||||
$trimmed = $rawContent.Trim()
|
||||
if ($trimmed.StartsWith('{') -and $trimmed.EndsWith('}')) {
|
||||
$parsed = $trimmed | ConvertFrom-Json
|
||||
# Convert PSCustomObject to hashtable
|
||||
if ($parsed -ne $null) {
|
||||
foreach ($prop in $parsed.PSObject.Properties) {
|
||||
$data[$prop.Name] = $prop.Value
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
Warn "Could not parse existing $configFile. Creating fresh configuration."
|
||||
$data = @{}
|
||||
}
|
||||
}
|
||||
|
||||
if ($data.ContainsKey("mcpServers") -and ($data["mcpServers"] -is [System.Collections.IDictionary] -or $data["mcpServers"] -is [PSCustomObject])) {
|
||||
$data["mcpServers"].graphify = $graphifyEntry
|
||||
} else {
|
||||
$data["graphify"] = $graphifyEntry
|
||||
}
|
||||
|
||||
$jsonOutput = $data | ConvertTo-Json -Depth 10
|
||||
Set-Content -Path $configFile -Value $jsonOutput -Encoding UTF8
|
||||
Success "Gemini MCP configuration updated successfully: $configFile"
|
||||
}
|
||||
|
||||
# ────────────────────────────────────────────
|
||||
# Main Entry Point
|
||||
# ────────────────────────────────────────────
|
||||
function Main {
|
||||
Info "===== Graphify install script (Windows PowerShell) ====="
|
||||
|
||||
# 1. Prerequisite check
|
||||
Check-Requirements
|
||||
Success "Prerequisite 'uv' found."
|
||||
|
||||
# 2. Install graphifyy using uv tool
|
||||
Info "Installing/upgrading 'graphifyy[pdf,openai,anthropic,gemini]' via uv tool..."
|
||||
uv tool install --upgrade "graphifyy[pdf,openai,anthropic,gemini]"
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
ErrExit "Failed to install graphifyy via uv tool."
|
||||
}
|
||||
Success "graphifyy installed successfully."
|
||||
|
||||
# 3. Agent integrations
|
||||
$agents = @("antigravity", "claude", "codex", "opencode")
|
||||
foreach ($agent in $agents) {
|
||||
Info "Configuring agent integration: graphify $agent install"
|
||||
try {
|
||||
& uv tool run --from graphifyy graphify $agent install
|
||||
if ($LASTEXITCODE -eq 0) {
|
||||
Success "Agent '$agent' integration completed."
|
||||
} else {
|
||||
Warn "Agent '$agent' integration returned non-zero code ($LASTEXITCODE). Continuing..."
|
||||
}
|
||||
} catch {
|
||||
Warn "Failed to configure agent '$agent': $_"
|
||||
}
|
||||
}
|
||||
|
||||
# 4. Configure Gemini MCP
|
||||
Configure-GeminiMcp
|
||||
|
||||
Write-Host ""
|
||||
Success "===== Graphify installation and agent setup completed successfully! ====="
|
||||
Info "Getting started:"
|
||||
Info " 1. Build code graph: graphify ."
|
||||
Info " 2. Query codebase: graphify query `"Explain project structure`""
|
||||
Info " 3. Find paths: graphify path `"ClassA`" `"ClassB`""
|
||||
Info " 4. Explain node: graphify explain `"AuthManager`""
|
||||
Write-Host ""
|
||||
}
|
||||
|
||||
Main
|
||||
Executable
+139
@@ -0,0 +1,139 @@
|
||||
#!/usr/bin/env bash
|
||||
# shellcheck disable=SC2086
|
||||
|
||||
# graphify 설치 및 바이브 코딩 에이전트 연동 스크립트
|
||||
#
|
||||
# uv tool을 이용하여 graphifyy를 설치하고, 다양한 AI 코딩 에이전트(Antigravity, Claude, Codex, OpenCode)
|
||||
# 및 Gemini MCP 설정을 자동으로 구성합니다.
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
# ────────────────────────────────────────────
|
||||
# 유틸리티 함수 (모두 stderr 출력)
|
||||
# ────────────────────────────────────────────
|
||||
info() { echo "[INFO] $*" >&2; }
|
||||
warn() { echo "[WARN] $*" >&2; }
|
||||
error() { echo "[ERROR] $*" >&2; exit 1; }
|
||||
success() { echo "[OK] $*" >&2; }
|
||||
|
||||
# ────────────────────────────────────────────
|
||||
# 필수 명령어 확인
|
||||
# ────────────────────────────────────────────
|
||||
check_requirements() {
|
||||
if ! command -v uv &>/dev/null; then
|
||||
echo "" >&2
|
||||
echo "=================================================================" >&2
|
||||
echo "[ERROR] 'uv' 패키지 관리자가 설치되어 있지 않습니다." >&2
|
||||
echo "graphify를 설치하려면 먼저 uv가 필요합니다." >&2
|
||||
echo "아래 명령어를 실행하여 uv를 먼저 설치해 주세요:" >&2
|
||||
echo "" >&2
|
||||
echo " curl -fsSL https://astral.sh/uv/install.sh | bash" >&2
|
||||
echo "=================================================================" >&2
|
||||
echo "" >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# ────────────────────────────────────────────
|
||||
# Gemini MCP 설정 갱신/작성
|
||||
# ────────────────────────────────────────────
|
||||
configure_gemini_mcp() {
|
||||
local target_dir="$HOME/.gemini/antigravity"
|
||||
local config_file="$target_dir/mcp_config.json"
|
||||
|
||||
mkdir -p "$target_dir"
|
||||
info "Gemini MCP 설정 파일 구성 중: $config_file"
|
||||
|
||||
# uv run python을 활용하여 안전하게 JSON 구조 생성 또는 병합
|
||||
uv run - << 'EOF'
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
|
||||
target_dir = os.path.expanduser("~/.gemini/antigravity")
|
||||
config_file = os.path.join(target_dir, "mcp_config.json")
|
||||
|
||||
graphify_entry = {
|
||||
"command": "uv",
|
||||
"args": [
|
||||
"run",
|
||||
"--with",
|
||||
"graphifyy",
|
||||
"--with",
|
||||
"mcp",
|
||||
"-m",
|
||||
"graphify.serve",
|
||||
"${workspace.path}/graphify-out/graph.json"
|
||||
]
|
||||
}
|
||||
|
||||
data = {}
|
||||
if os.path.exists(config_file):
|
||||
try:
|
||||
with open(config_file, "r", encoding="utf-8") as f:
|
||||
content = f.read().strip()
|
||||
if content.startswith("{") and content.endswith("}"):
|
||||
data = json.loads(content)
|
||||
elif content.startswith('"graphify"'):
|
||||
# Handle key-only fragments if previously written
|
||||
data = json.loads("{" + content + "}")
|
||||
except Exception as e:
|
||||
sys.stderr.write(f"[WARN] 기존 설정 파싱 실패 (신규 파일로 생성합니다): {e}\n")
|
||||
data = {}
|
||||
|
||||
# Antigravity/Gemini mcp_config structure handling
|
||||
if "mcpServers" in data and isinstance(data["mcpServers"], dict):
|
||||
data["mcpServers"]["graphify"] = graphify_entry
|
||||
else:
|
||||
data["graphify"] = graphify_entry
|
||||
|
||||
with open(config_file, "w", encoding="utf-8") as f:
|
||||
json.dump(data, f, indent=2, ensure_ascii=False)
|
||||
f.write("\n")
|
||||
|
||||
print(f"[OK] Gemini MCP 설정이 성공적으로 저장되었습니다: {config_file}")
|
||||
EOF
|
||||
}
|
||||
|
||||
# ────────────────────────────────────────────
|
||||
# 메인 설치 로직
|
||||
# ────────────────────────────────────────────
|
||||
main() {
|
||||
info "===== Graphify 지식 그래프 도구 설치 스크립트 ====="
|
||||
|
||||
# 1. uv 확인
|
||||
check_requirements
|
||||
success "uv 패키지 관리자가 확인되었습니다."
|
||||
|
||||
# 2. graphifyy 설치 (uv tool)
|
||||
info "uv tool을 통해 'graphifyy[pdf,openai,anthropic,gemini]' 패키지를 설치/업데이트합니다..."
|
||||
uv tool install --upgrade 'graphifyy[pdf,openai,anthropic,gemini]'
|
||||
success "graphify 도구 설치가 완료되었습니다."
|
||||
|
||||
# 3. 바이브 코딩 에이전트 연동
|
||||
info "바이브 코딩 에이전트별 연동 설정을 진행합니다..."
|
||||
|
||||
agents=("antigravity" "claude" "codex" "opencode")
|
||||
for agent in "${agents[@]}"; do
|
||||
info "에이전트 연동 실행 중: graphify $agent install"
|
||||
if uv tool run --from graphifyy graphify "$agent" install 2>&1 | sed 's/^/ [agent] /'; then
|
||||
success "graphify $agent 연동 완료"
|
||||
else
|
||||
warn "graphify $agent 연동 중 경고/에러가 발생했으나 계속 진행합니다."
|
||||
fi
|
||||
done
|
||||
|
||||
# 4. Gemini MCP 설정 작성
|
||||
configure_gemini_mcp
|
||||
|
||||
echo ""
|
||||
success "===== Graphify 및 에이전트 연동 설치가 모두 완료되었습니다! ====="
|
||||
info "사용 방법 안내:"
|
||||
info " 1. 코드베이스 그래프 생성: graphify ."
|
||||
info " 2. 자연어 질의: graphify query \"프로젝트 구조 설명해줘\""
|
||||
info " 3. 관계 경로 분석: graphify path \"ClassA\" \"ClassB\""
|
||||
info " 4. 개념 상세 확인: graphify explain \"AuthManager\""
|
||||
echo ""
|
||||
}
|
||||
|
||||
main "$@"
|
||||
Reference in new issue
Block a user