Project Structure
Understanding the codebase organization and architecture of Gemini CLI
Project Overview
Gemini CLI is organized as a monorepo with multiple interconnected packages
Gemini CLI is a Lerna-based monorepo project that modularizes functionality into independent packages for easier development, testing, and maintenance.
Package Structure
Core packages that make up the Gemini CLI ecosystem
CLI Package
packages/cli
Main command-line interface and user-facing commands
Key Responsibilities:
- Command parsing and routing
- User interface and interaction
- Configuration management
- Error handling and reporting
- Help and documentation display
Core Package
packages/core
Core functionality and business logic
Key Responsibilities:
- API client implementations
- Model interactions
- Tool management system
- MCP protocol handling
- State management
Tools Package
packages/tools
Built-in tools and utilities
Key Responsibilities:
- File system operations
- Shell command execution
- Web requests and searches
- Memory management
- Tool registration
Extensions Package
packages/extensions
Extension system and plugin management
Key Responsibilities:
- Extension loading and management
- Plugin registry
- Extension API
- Lifecycle management
- Dependency resolution
Development Workflow
How to work with the codebase effectively
Global Commands
npm run bootstrap
Install and link all packages
npm run build
Build all packages
npm run test
Run all tests
npm run lint
Lint all packages
Package-specific Commands
lerna run build --scope @gemini/cli
Build specific package
lerna run test --scope @gemini/core
Test specific package
lerna add lodash packages/core
Add dependency to package
Related Resources
Continue exploring the development documentation