cli

package
v0.12.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 19, 2026 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRootCmd

func NewRootCmd(deps *Deps) *cobra.Command

NewRootCmd creates the root cobra command with all subcommands attached. @intent 공통 초기화와 서브커맨드 구성을 한곳에 모아 ccg CLI 진입점을 만든다. @sideEffect 환경 변수와 설정 파일을 읽고 InitFunc가 있으면 DB 초기화를 트리거한다. @mutates deps.Logger, 전역 slog 기본 로거

Types

type Deps

type Deps struct {
	Logger       *slog.Logger
	Store        ingest.GraphStore
	UnitOfWork   ingest.UnitOfWork
	Search       ingest.SearchWriter
	SearchReader retrieval.CandidateSearcher
	Statistics   analyze.StatisticsReader
	Docs         docs.Repository
	Wiki         wiki.Repository
	Walkers      map[string]ingest.Parser
	Syncer       ingest.IncrementalSyncer
	ServeFunc    func(cfg ServeConfig) error
	InitFunc     func(dbDriver, dsn string) error
	MigrateFunc  func(cfg MigrateConfig) error
	CleanupFunc  func()
	Version      VersionInfo
}

Deps holds shared dependencies injected into all subcommands. @intent 중앙 CLI 초기화 단계에서 만든 런타임 의존성을 하위 명령에 전달한다.

type MigrateConfig

type MigrateConfig struct {
	DBDriver      string
	DBDSN         string
	MigrationsDir string
}

MigrateConfig contains the database and external migration source settings. @intent carry the driver, DSN, and migration source needed for one explicit schema migration run.

type ServeConfig

type ServeConfig struct {
	CacheTTL            time.Duration
	NoCache             bool
	Transport           string // deprecated compatibility flag; only "stdio" is accepted by ccg
	OTELEndpoint        string
	NamespaceRoot       string
	MaxFileBytes        int64
	MaxTotalParsedBytes int64
}

ServeConfig holds parsed flags for the local stdio MCP serve subcommand. @intent keep the ccg binary focused on local stdio MCP use while ccg-server owns HTTP/webhook hosting.

type VersionInfo

type VersionInfo struct {
	Version string
	Commit  string
	Date    string
}

VersionInfo holds build-time version metadata injected via ldflags. @intent 빌드 시 주입된 버전 정보를 구조체로 묶어 CLI 출력에 활용한다.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL