DOCS/ideas/250929_happybell80_multi_ai_cli_integration.md
happybell80 ab0d98e971 docs: multi-AI CLI 통합 도구 설치 및 tmux 세션 구성 가이드 업데이트
- WSL 환경 기준 설치 절차 정리
- tmux 세션 생성 및 pane 설정 방법
- 브로드캐스트 전송 및 로그 관리
- 동기 입력 모드 설정 방법 추가
2025-09-29 23:52:57 +09:00

87 lines
2.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
date: 2025-09-29
author: happybell80
tags: [ai, cli, integration, automation, wsl, tmux, broadcast]
status: completed
---
# Multi-AI CLI 통합 시스템 (WSL/tmux 완성)
## 개요
- WSL tmux 기반 6개 AI 동시 브로드캐스트 시스템
- Windows pywinauto 방식 포기, WSL tmux로 전환
- 2025-09-29 구현 완료
## 최종 구조
```
/home/happybell/projects/ivada/multi-ai-cli-wsl/
├── run.py # 메인 진입점
├── src/
│ └── controller.py # SimpleController 클래스
├── bin/
│ ├── tmux_setup.sh # tmux 세션 생성 (2×3 그리드)
│ └── restart_tmux.sh # 세션 재시작
├── config/
│ └── config.yaml # AI 설정
└── logs/ # pipe-pane 로그 저장
```
## 구현 내용
### tmux 세션 (bin/tmux_setup.sh)
- 2×3 그리드 6개 pane 생성
- 마우스 지원 활성화 (mouse on)
- 스크롤백 10000줄
- pane 경계선 강조 (colour51 for active)
- pipe-pane으로 각 pane 로그 자동 저장
### 컨트롤러 (src/controller.py)
- tmux send-keys로 브로드캐스트
- 메시지와 'C-m' 분리 전송 (Enter 키 이슈 해결)
- 6개 AI 기본 활성화
- 직접 입력 질문, /명령어 구분
### 설정 (config/config.yaml)
```yaml
session: ai-panel
panes:
claude_51123: "ai-panel:0.0"
gemini_local: "ai-panel:0.1"
claude_51124: "ai-panel:0.2"
codex_local: "ai-panel:0.3"
claude_local: "ai-panel:0.4"
openai_local: "ai-panel:0.5"
commands: # 모두 비움 (대화형 모드)
claude_51123: ""
gemini_local: ""
```
## 실행 방법
```bash
# tmux 세션 시작
restart_tmux.sh
# 각 pane에서 AI 수동 실행
# Pane 0: ssh -p 51123 admin@ro-being.com → claude
# Pane 1: gemini
# Pane 2: ssh -p 51124 admin@ro-being.com → claude
# Pane 3: codex
# Pane 4: claude
# Pane 5: 예비
# 별도 터미널에서 컨트롤러
cd ~/projects/ivada/multi-ai-cli-wsl
uv run python run.py
```
## 해결한 이슈
1. tmux send-keys 'Enter' 안됨 → 'C-m' 분리 전송
2. 창 분할 오류 → tiled 레이아웃 사용
3. Windows line ending → sed 제거
4. 명령 템플릿 오류 → 비움 (raw text)
5. 스크롤/복사 충돌 → Shift+드래그
## 제한사항
- AI 로그인은 수동
- 응답 파싱/비교 미구현
- Gemini C-u 처리 미구현