claude_code_toolkit/config/mod.rs
1//! Configuration management system for Claude Code credentials and settings.
2//!
3//! This module provides a comprehensive configuration management system following
4//! the Repository Pattern. It handles secure credential storage, YAML-based
5//! configuration files, and runtime session information.
6//!
7//! ## Core Components
8//!
9//! - [`CredentialsManager`] - Secure credential storage and retrieval
10//! - [`ConfigurationManager`] - Main configuration orchestrator
11//! - [`YamlConfigProvider`] - YAML file-based configuration provider
12//!
13//! ## Usage Examples
14//!
15//! ### Basic Configuration Setup
16//!
17//! ```rust,no_run
18//! use claude_code_toolkit::config::{ConfigurationManager, CredentialsManager};
19//! use claude_code_toolkit::traits::config::ConfigManager;
20//!
21//! #[tokio::main]
22//! async fn main() -> claude_code_toolkit::Result<()> {
23//! // Initialize configuration manager
24//! let config_manager = ConfigurationManager::new()?;
25//!
26//! // Load configuration
27//! let config = config_manager.load().await?;
28//! println!("Loaded configuration with {} repositories", config.github.repositories.len());
29//!
30//! Ok(())
31//! }
32//! ```
33//!
34//! ### Credential Management
35//!
36//! ```rust,no_run
37//! use claude_code_toolkit::config::CredentialsManager;
38//!
39//! #[tokio::main]
40//! async fn main() -> claude_code_toolkit::Result<()> {
41//! let creds_manager = CredentialsManager::new()?;
42//!
43//! // Check if credentials exist
44//! let session_info = creds_manager.get_session_info().await?;
45//! println!("Session expires in: {} ms", session_info.time_remaining);
46//!
47//! Ok(())
48//! }
49//! ```
50//!
51//! ## Security Features
52//!
53//! - Platform-specific secure credential storage
54//! - Automatic permission setting on configuration files (600)
55//! - Credential validation and expiration checking
56//! - Secure credential file format with encryption support
57//!
58//! ## Configuration Structure
59//!
60//! The configuration system supports:
61//! - GitHub organization and repository settings
62//! - Sync intervals and retry policies
63//! - Notification preferences
64//! - Daemon service configuration
65//! - Custom provider settings
66
67pub mod credentials;
68pub mod manager;
69
70pub use credentials::CredentialsManager;
71pub use manager::{ ConfigurationManager, YamlConfigProvider };