시작하기#
설치#
# 로컬 경로에서 활성화
dart pub global activate --source path .
# 설치 확인
cob --version
사전 요구사항#
- Dart SDK 3.9+ (필수)
- Mason CLI (필수) - dart pub global activate mason_cli
- gh CLI (선택) - GitHub 레포 자동 생성 시 필요
첫 프로젝트 생성#
Interactive 모드 (권장)#
cob create --type monorepo
프롬프트에 따라 프로젝트 정보를 입력하고, feature 브릭을 선택합니다. GitHub 레포 생성 여부도 interactive 모드에서 확인할 수 있습니다.
Non-interactive 모드#
cob create --type monorepo --no-interactive \
--name my_app \
--organization MyOrg \
--features home,community,notification,payment \
--backend serverpod
GitHub 레포 자동 생성#
--create-repo 플래그를 추가하면 프로젝트 생성 후 GitHub 레포를 자동 생성합니다.
cob create --type monorepo --no-interactive \
--name my_app \
--github-org coco-de \
--create-repo
실행 흐름:
- Mason 브릭으로 프로젝트 파일 생성
- git init + initial commit
- gh repo create coco-de/my-app --private --source=. --push
gh CLI가 설치되어 있지 않거나 인증되지 않은 경우 경고만 출력하고 건너뜁니다. 사전에 gh auth login으로 인증하세요.
Feature 적용#
기존 프로젝트에 feature를 추가할 수 있습니다:
# community feature 추가 (frontend + backend)
cob apply --feature community
# entity 이름 커스터마이징
cob apply --feature community \
--primary-entity Article \
--secondary-entity Reply
# backend 없이 frontend만
cob apply --feature community --no-backend
Console Feature 적용#
관리자 콘솔 feature를 추가할 수 있습니다:
# console feature 추가
cob apply --feature console_dashboard
# 복수 console feature 동시 적용
cob apply --features console_dashboard,console_user_management,console_sales_analysis
Entity 커스터마이징#
primary_entity와 secondary_entity를 지정하면 모든 파일명, 클래스명, 변수명이 자동 변환됩니다:
# 기본값: Post / Comment
cob apply --feature community
# 커스텀: Article / Reply
cob apply --feature community \
--primary-entity Article \
--secondary-entity Reply
# AI가 도메인에 맞게 자유롭게 지정 가능
cob apply --feature store \
--primary-entity Product \
--secondary-entity ProductCategory
커스텀 bricks 경로#
기본 bricks/ 외 다른 경로에서 브릭을 참조할 수 있습니다:
cob apply --feature community --bricks-dir /path/to/custom/bricks
설정 저장 및 재사용#
# 설정 저장
cob create --type monorepo --save-config
# 저장된 설정 목록
cob create-from-config --list
# 설정으로 생성
cob create-from-config --config my_app