oto/agent-ops/rules/project/domain/cli/rules.md

39 lines
1.5 KiB
Markdown

# cli
## 목적 / 책임
사용자로부터 CLI 인자를 받아 파싱하고, `Application`을 통해 파이프라인을 시작하거나 스케줄러 데몬을 관리하는 진입 계층이다.
## 포함 경로
- `lib/cli/` — CLI 레이어 전체 (명령 파싱, 스케줄러 관리)
## 제외 경로
- `lib/oto/` — 비즈니스 로직·파이프라인 엔진 (cli는 진입만 담당)
## 주요 구성 요소
- `Cli` (`cli.dart`) — CLI 루트 객체
- `CommandExe``-j`(Jenkins), `-t`(test), `-f`(file) 플래그 파싱 → `Application.build()` 호출
- `CommandInstall` — PATH 등록 (`install/regist_path.dart`)
- `CommandScheduler` — 스케줄러 데몬 시작
- `CommandStart` — 시작 커맨드
- `CommandTemplate` — 템플릿 출력
- `CommandManager` — CLI 커맨드 등록 관리
- `SchedulerManager` — 스케줄러 실행 조정 (interval, isolate, OS별 구현)
## 유지할 패턴
- CLI 커맨드는 `CommandBase` 상속
- OS별 스케줄러는 `scheduler_linux.dart` / `scheduler_osx.dart` / `scheduler_windows.dart` 분리 유지
## 다른 도메인과의 경계
- **pipeline/command**: cli는 `Application.build()`만 호출. 파이프라인·커맨드 내부를 직접 참조하지 않는다
- **core**: DataComposer 호출은 Application 내부에서 이루어지며 cli는 관여하지 않는다
## 금지 사항
- cli 레이어에서 Pipeline 또는 Command를 직접 인스턴스화하지 않는다
- 비즈니스 로직을 cli 커맨드 핸들러에 넣지 않는다