The Gemini CLI project is structured as a monorepo with two main packages that follow a clear separation of concerns:
@google/gemini-cli-core: The core logic package containing all business logic, AI interactions, and tool implementations@google/gemini-cli: The CLI package providing the user interface layer (both interactive and non-interactive modes)graph TB
subgraph "CLI Package"
UI[React/Ink UI]
CLI[CLI Entry Point]
Settings[Settings Manager]
Themes[Theme System]
NonInt[Non-Interactive Mode]
end
subgraph "Core Package"
Config[Config]
GeminiClient[Gemini Client]
Tools[Tool System]
Auth[Authentication]
Services[Services]
Models[AI Models]
end
CLI --> Config
UI --> GeminiClient
NonInt --> GeminiClient
Settings --> Config
UI --> Tools
Config --> Services
Config --> Auth
GeminiClient --> Models
GeminiClient --> Tools
packages/core)The core package is a headless library that provides:
packages/cli)The CLI package is the user-facing application that provides: