본문으로 건너뛰기

설정 시스템

설계 원칙

global.json  = "뭘 켜고 끌 것인가"  (기능 토글)
detail.json = "어떻게 동작할 것인가" (세부 파라미터)
local.json = "내 환경에서만 다른 것" (Git 제외)

읽기 우선순위

local.json > global.json > detail.json > 기본값

global.json

기능의 on/off와 핵심 파라미터만 포함합니다. 자주 변경됩니다.

{
"session": { "enabled": true, "handoff": { "auto_save_on_stop": true, "stale_threshold_logs": 100 } },
"security": { "enabled": true, "use_semgrep": true },
"multi_llm": { "enabled": true, "providers": { "opencode": { "enabled": true }, "codex": { "enabled": true } } }
}

detail/ 분리 구조

detail.json은 직접 수정하지 않습니다. 기능별 파일을 수정한 후 merge.sh로 재생성합니다.

파일내용
session.json세션 로깅, 요약, 체크리스트
multi-llm.json실행, 모니터링, 프로바이더 상세
security.json보안 패턴, PostToolUse 체크
hooks.jsonPreToolUse, Stop 훅 설정
infra.json포트, 대시보드, RAG, 동기화
# 편집 → 재생성
vi .ai-core/config/detail/session.json
bash .ai-core/config/detail/merge.sh

config-loader.sh

hooks에서 설정을 읽는 공통 라이브러리입니다.

source "$SCRIPT_DIR/lib/config-loader.sh"

# 토글 확인
if [ "$(cfg_bool '.security.enabled' 'true')" = "true" ]; then ...

# 값 읽기
MAX=$(cfg_get '.session.archive.max_sessions' '50')