1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
//! # Claude Code Toolkit
//!
//! A comprehensive Rust toolkit for managing Claude Code credentials, session monitoring,
//! and GitHub integration. This crate provides both a command-line interface and a library
//! for programmatic access to Claude Code functionality.
//!
//! ## Features
//!
//! - **Credential Management**: Secure storage and synchronization of Claude Code credentials
//! - **Session Monitoring**: Real-time tracking of Claude Code sessions with timer functionality
//! - **GitHub Integration**: Seamless sync with GitHub repositories and organizations
//! - **Daemon Mode**: Background service for automatic credential synchronization
//! - **Cross-Platform**: Primary support for Linux, with WSL support for Windows users
//! - **Systemd Integration**: Native systemd service support on Linux (optional feature)
//! - **Desktop Notifications**: Optional desktop notification support
//!
//! ## Quick Start
//!
//! ### Command Line Usage
//!
//! ```bash
//! # Install the daemon service
//! claude-code-toolkit service install
//!
//! # Add a GitHub organization for sync
//! claude-code-toolkit org add my-org
//!
//! # Add a specific repository
//! claude-code-toolkit repo add owner/repo
//!
//! # Sync credentials to all configured targets
//! claude-code-toolkit sync
//!
//! # Check status
//! claude-code-toolkit status
//! ```
//!
//! ### Library Usage
//!
//! ```rust,no_run
//! use claude_code_toolkit::{
//! config::manager::ConfigurationManager,
//! sync::SyncService,
//! Result,
//! };
//!
//! #[tokio::main]
//! async fn main() -> Result<()> {
//! // Initialize configuration
//! let config_manager = ConfigurationManager::new()?;
//!
//! // Set up sync service
//! let mut sync_service = SyncService::new_with_config().await?;
//!
//! // Sync credentials
//! sync_service.sync_all().await?;
//!
//! Ok(())
//! }
//! ```
//!
//! ## Architecture
//!
//! The toolkit is organized into several key modules:
//!
//! - [`config`] - Configuration management and credential storage
//! - [`daemon`] - Background service functionality
//! - [`providers`] - Integration with external services (GitHub, etc.)
//! - [`sync`] - Credential synchronization logic
//! - [`cli`] - Command-line interface components
//! - [`utils`] - Utility functions and helpers
//!
//! ## Configuration
//!
//! The toolkit uses YAML-based configuration files stored in platform-appropriate
//! directories. Configuration includes:
//!
//! - GitHub API tokens and repository settings
//! - Sync intervals and retry policies
//! - Notification preferences
//! - Daemon service settings
//!
//! ## Security
//!
//! - Credentials are stored securely using platform-specific secure storage
//! - All API communications use HTTPS
//! - Sensitive data is never logged or exposed in error messages
//! - Configuration files have restrictive permissions
//!
//! ## Feature Flags
//!
//! - `systemd` (default): Enables systemd service integration on Linux
//! - `notifications` (default): Enables desktop notification support
//!
//! ## Platform Support
//!
//! | Platform | CLI | Sync | Daemon | Notes |
//! |----------|-----|------|--------|-------|
//! | 🐧 Linux | ✅ | ✅ | ✅ | Complete systemd integration |
//! | 🪟 Windows (WSL) | ✅ | ✅ | ✅ | Requires WSL with systemd enabled |
//! | 🪟 Windows (Native) | ⚠️ | ❌ | ❌ | CLI only - credentials in system store |
//! | macOS | ⚠️ | ❌ | ❌ | CLI only - credentials in Keychain |
//!
//! **Feature Details**:
//! - **✅ Full**: Complete functionality as designed
//! - **⚠️ Partial**: CLI commands work, but credential reading fails
//! - **❌ No**: Feature unavailable due to platform limitations
//!
//! **Support Breakdown**:
//! - **CLI Full**: All commands including org/repo management, configuration
//! - **CLI Partial**: Commands work but `status`, `sync`, `timer` fail (no credential access)
//! - **Sync**: Requires file-based credential storage at `~/.claude/.credentials.json`
//! - **Daemon**: Requires systemd for background service functionality
//!
//! **Important Notes**:
//! - This toolkit expects Claude Code credentials to be stored as **files**, not in system keychains
//! - **Expected credential location**: `~/.claude/.credentials.json`
//! - **Linux and WSL** store credentials as files at this location, making them compatible
//! - **macOS and native Windows** store credentials in Keychain/Credential Manager respectively
//! - On incompatible platforms, credential reading will fail and sync operations won't work
pub use ;
pub use *;