@kikkimo/claude-launcher 1.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,152 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [2.1.0] - 2025-10-27
9
+
10
+ ### Added
11
+ - **GLM (ZhiPu AI) Provider Support**: Full integration for ZhiPu AI's GLM models with two provider options:
12
+ - `zhipu`: For mainland China users (智谱清言)
13
+ - `zai`: For international users (Z.ai Global)
14
+ - Support for GLM-4.5 and GLM-4.6 models
15
+ - Extended timeout configuration (50 minutes) for large response handling
16
+ - Optimized network traffic settings for better performance
17
+ - **Moonshot Provider Enhancements**: Added extended timeout configuration and traffic optimization for Moonshot AI provider
18
+ - **Enhanced Ctrl+C Interaction**: Comprehensive Ctrl+C handling with four distinct scenarios:
19
+ - Basic trigger with warning message display
20
+ - Auto-cancel after 3-second timeout
21
+ - Double Ctrl+C for immediate exit confirmation
22
+ - Any other key press to cancel warning and continue operation
23
+ - **StdinManager Centralized Control**: New singleton class for unified stdin state management:
24
+ - Scope-based stdin acquisition with automatic cleanup
25
+ - Detach/reattach mechanism for proper scope isolation
26
+ - Suspension API for child process coordination
27
+ - Comprehensive Ctrl+C state tracking and handling
28
+ - **Provider-specific Configuration System**: Dynamic provider configuration framework:
29
+ - Flexible environment variable configuration per provider
30
+ - Provider-specific optimization display with validation
31
+ - Internationalized provider notes and recommendations
32
+ - **Complete i18n Coverage**: Extended internationalization support to all supported languages (English, Simplified Chinese, Traditional Chinese, German, French, Spanish, Italian, Portuguese, Japanese, Korean, Russian):
33
+ - Provider optimization messages (timeout, traffic control, custom variables)
34
+ - Provider-specific notes and recommendations
35
+ - Consistent terminology across all supported languages
36
+ - **Automated Test Suites**: Comprehensive test coverage for stdin management:
37
+ - Interactive test scripts for manual validation
38
+ - Automated test scripts for CI/CD integration
39
+ - Test fixture files for isolated testing
40
+
41
+ ### Changed
42
+ - **Provider Configuration Architecture**: Refactored from hardcoded switch statements to dynamic config lookup system
43
+ - **Stdin Operations**: Migrated all stdin operations to use centralized StdinManager:
44
+ - Menu navigation
45
+ - Interactive tables
46
+ - Prompt inputs
47
+ - Confirmation dialogs
48
+ - Password input
49
+ - **Console Control Handover**: Redesigned parent-child process coordination:
50
+ - Clean console relinquishment before launching Claude Code
51
+ - Suspension-aware SIGINT handling
52
+ - Proper console restoration after child process exit
53
+ - **Error Handling**: Unified error handling with `handleLaunchFailure` function
54
+ - **Ctrl+C Monitoring**: Disabled during Claude Code subprocess launch to prevent interception conflicts
55
+ - **Test Configuration Files**: Renamed test-config.json to test-config.fixture for better semantic clarity
56
+
57
+ ### Fixed
58
+ - **Stdin State Management**: Resolved critical hanging issues in CLI interaction:
59
+ - Fixed Promise deadlocks caused by cross-scope listener interference
60
+ - Eliminated dangerous `removeAllListeners` calls that destroyed active listeners
61
+ - Added proper timeout handling (60 seconds) for user input operations
62
+ - Fixed redundant isPaused check that incorrectly tested both property and method
63
+ - **Listener Conflicts**: Prevented stdin listener conflicts between nested scopes:
64
+ - Implemented scope-aware listener management
65
+ - Added detach/reattach pattern for safe scope transitions
66
+ - Tracked active scope for accurate nested scope handling
67
+ - Fixed waitForKey listener removal bug causing Promise hangs on Ctrl+C
68
+ - **Password Input**: Properly cleanup and reject Promise on Ctrl+C to prevent resource leaks
69
+ - **Input Processing**: Fixed consecutive operation hangs (e.g., API switch followed by deletion)
70
+ - **Ctrl+C Reliability**: Enhanced Ctrl+C responsiveness across all interfaces with proper state tracking
71
+ - **Terminal State Cleanup**: Improved stdin cleanup before and after Claude Code launch
72
+ - **Character Encoding**: Replaced mojibake characters (����, ��) with proper Unicode glyphs (↑↓, →) in menu
73
+ - **ANSI Escape Sequences**: Added TTY checks to prevent ANSI codes from polluting non-TTY output (logs, CI/CD)
74
+ - **Global Signal Handlers**: Removed dangerous `removeAllListeners('SIGINT/SIGTERM')` calls that could break other modules
75
+ - **Timeout Display**: Added validation for API_TIMEOUT_MS parsing to prevent NaN display in provider optimizations
76
+ - **Test File Tracking**: Removed incorrect .gitignore rules that prevented test files from being tracked
77
+ - **Code Quality**: Removed unused variables and dead code from test files
78
+
79
+ ### Security
80
+ - **Enhanced Secret Masking**: Expanded environment variable masking to detect and hide:
81
+ - API tokens, keys, secrets
82
+ - Passwords, credentials, authentication tokens
83
+ - Case-insensitive pattern matching for reliable detection
84
+ - Applied masking to both base and custom provider environment variables
85
+ - **Consistent Security Protection**: Unified secret masking across all environment variable displays
86
+
87
+ ### Refactored
88
+ - **Provider Environment Variables**: Moved from inline switch statements to provider configuration objects
89
+ - **Stdin Management**: Complete migration to centralized StdinManager pattern across all modules
90
+ - **Launch Logic**: Restructured Claude Code launching with clear control handover phases
91
+ - **State Restoration**: Eliminated duplicate state restoration in StdinScope.release() for cleaner control flow
92
+ - **Test Organization**: Improved test file naming conventions and structure
93
+
94
+ ### Documentation
95
+ - **README Updates**: Documented GLM API support in both English and Chinese versions
96
+ - **Provider Documentation**: Added comprehensive provider-specific feature descriptions
97
+ - **Configuration Guide**: Enhanced API configuration documentation with provider-specific details
98
+
99
+ ## [2.0.0] - 2025-09-21
100
+
101
+ ### Added
102
+ - **Multi-language Support**: Complete internationalization (i18n) system with support for English, Chinese, German, French, Japanese, Korean, Russian, and Spanish
103
+ - **Third-party API Management**: Full support for multiple third-party API providers with secure configuration management
104
+ - **Interactive API Selection Tables**: Beautiful table-based interface for API switching and removal operations
105
+ - **Version Update Checking**: Automatic and manual version update detection with configurable check intervals
106
+ - **Password-Protected Import/Export**: Secure configuration backup and restore with password encryption
107
+ - **Modular Architecture**: Complete refactor to modular design with separated concerns:
108
+ - `ApiManager` class for API configuration management
109
+ - Dedicated authentication modules with password strength validation
110
+ - UI components for menus, prompts, and interactive tables
111
+ - Crypto utilities for secure data encryption
112
+ - Language management system with locale support
113
+ - **Enhanced Menu System**: Global menu objects to prevent screen flickering during navigation
114
+ - **API Usage Statistics**: Track and display API usage patterns and statistics
115
+ - **Advanced Input Validation**: Comprehensive validation for URLs, auth tokens, and model configurations
116
+ - **CJK Character Support**: Improved handling of Chinese, Japanese, and Korean characters in UI
117
+ - **First-time Setup Wizard**: Guided setup process for new users with password configuration options
118
+
119
+ ### Changed
120
+ - **Complete Architecture Overhaul**: Migrated from monolithic script to modular architecture with 28+ separate modules
121
+ - **Enhanced Security Model**: Upgraded from basic encryption to industry-standard AES-256-CBC with machine-specific keys
122
+ - **Improved User Experience**: Redesigned all user interactions with consistent Claude-style theming
123
+ - **Better Error Handling**: Comprehensive error management with user-friendly messages in multiple languages
124
+ - **Stdin Management**: Robust stdin cleanup and management to prevent navigation issues
125
+ - **Menu Navigation**: Enhanced arrow key navigation with better state management
126
+ - **Configuration Storage**: Migrated from `.env` files to encrypted JSON configuration format
127
+
128
+ ### Fixed
129
+ - **Memory Leaks**: Resolved EventEmitter memory leaks in input handling
130
+ - **Screen Flickering**: Eliminated menu recreation issues that caused display flickering
131
+ - **Input State Management**: Fixed stdin cleanup issues that prevented proper navigation
132
+ - **API Token Security**: Improved token masking and secure storage mechanisms
133
+ - **Cross-platform Compatibility**: Enhanced support for different terminal environments
134
+ - **Process Termination**: Better handling of Ctrl+C and graceful shutdown sequences
135
+ - **Duplicate Detection**: Robust checking for duplicate API configurations
136
+ - **Unicode Handling**: Fixed string width calculations for international characters
137
+
138
+ ### Refactored
139
+ - **Code Organization**: Split monolithic launcher into focused, testable modules
140
+ - **API Management**: Centralized API configuration handling with the `ApiManager` class
141
+ - **Authentication System**: Dedicated password handling with strength validation
142
+ - **UI Components**: Separated interface logic into reusable components
143
+ - **Error Handling**: Centralized error management with consistent user feedback
144
+ - **Import/Export Logic**: Streamlined configuration backup and restore processes
145
+ - **Language System**: Implemented comprehensive i18n framework for multi-language support
146
+
147
+ ### Security
148
+ - **Enhanced Encryption**: Upgraded to AES-256-CBC encryption for all sensitive data
149
+ - **Password Strength Validation**: Enforced strong password requirements for configuration protection
150
+ - **Secure Token Storage**: Improved API token encryption and masking in displays
151
+ - **Machine-specific Keys**: Maintained machine-binding for configuration security
152
+ - **Input Sanitization**: Enhanced validation for all user inputs to prevent security issues
153
+
8
154
  ## [1.0.0] - 2025-07-20
9
155
 
10
156
  ### Added
package/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # Claude Launcher
2
2
 
3
- An elegant interactive launcher for Claude Code with a beautiful Claude-style interface. Launch Claude Code with various configurations through an intuitive command-line menu.
3
+ [![npm version](https://img.shields.io/npm/v/@kikkimo/claude-launcher.svg?style=flat-square)](https://www.npmjs.com/package/@kikkimo/claude-launcher) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square)](https://opensource.org/licenses/MIT) [![Node.js Version](https://img.shields.io/badge/node-%3E%3D20.0.0-brightgreen.svg?style=flat-square)](https://nodejs.org/) [![npm downloads](https://img.shields.io/npm/dm/@kikkimo/claude-launcher.svg?style=flat-square)](https://www.npmjs.com/package/@kikkimo/claude-launcher) [![DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/kikkimo/claude-launcher)
4
+
5
+ An elegant interactive launcher for Claude Code with a beautiful Claude-style interface and comprehensive third-party API management. Launch Claude Code with various configurations through an intuitive multilingual command-line menu.
4
6
 
5
7
  ## 📖 Documentation
6
8
 
@@ -9,13 +11,33 @@ An elegant interactive launcher for Claude Code with a beautiful Claude-style in
9
11
 
10
12
  ## ✨ Features
11
13
 
12
- - 🎨 **Claude-style interface** with authentic orange/amber color scheme
13
- - ⌨️ **Arrow key navigation** with fallback to number selection
14
- - 🔐 **Encrypted API key storage** using AES-256-CBC encryption
15
- - 🚀 **Multiple launch options** including permission skipping and Kimi K2 API
16
- - 🌍 **Global installation** - use `claude-launcher` from anywhere
17
- - 🔧 **Smart configuration** - automatically finds/creates config files
18
- - 💻 **Cross-platform** - Windows, macOS, and Linux support
14
+ ### 🎨 **Beautiful Interface**
15
+ - Claude-style interface with authentic orange/amber color scheme
16
+ - Arrow key navigation with smooth menu transitions
17
+ - Interactive tables for API selection and management
18
+ - Multi-language support (English, Simplified Chinese, Traditional Chinese, German, French, Spanish, Italian, Portuguese, Japanese, Korean, Russian)
19
+
20
+ ### 🔐 **Advanced Security**
21
+ - AES-256-CBC encryption for all sensitive data
22
+ - Machine-specific encryption keys for enhanced security
23
+ - Password-protected configuration import/export
24
+ - Secure API token storage with masked display
25
+ - Strong password requirements and validation
26
+
27
+ ### 🚀 **Third-party API Management**
28
+ - Full support for multiple third-party API providers (OpenAI, Anthropic, DeepSeek, Kimi, GLM (ZhiPu AI), and more)
29
+ - Interactive API configuration with validation
30
+ - API usage statistics and tracking
31
+ - Secure configuration backup and restore
32
+ - Easy API switching and removal
33
+
34
+ ### 🌍 **Enterprise-grade Features**
35
+ - Global installation - use `claude-launcher` from anywhere
36
+ - Modular architecture with 28+ specialized modules
37
+ - Comprehensive error handling and recovery
38
+ - Version update checking with automatic notifications
39
+ - Cross-platform support (Windows, macOS, Linux)
40
+ - First-time setup wizard for new users
19
41
 
20
42
  ## 🚀 Quick Start
21
43
 
@@ -29,9 +51,12 @@ An elegant interactive launcher for Claude Code with a beautiful Claude-style in
29
51
  claude-launcher
30
52
  ```
31
53
 
32
- 3. **For Kimi API users:** When prompted for the first time, enter your Kimi API key starting with `sk-`
54
+ 3. **First-time setup:** The launcher will guide you through:
55
+ - Language selection (11 languages available)
56
+ - Security setup (password configuration for import/export)
57
+ - Third-party API configuration (if desired)
33
58
 
34
- That's it! The launcher will guide you through the setup process.
59
+ That's it! The intuitive interface will guide you through all available options.
35
60
 
36
61
  ## 📦 Installation
37
62
 
@@ -54,19 +79,23 @@ node claude-launcher
54
79
 
55
80
  ## 🎮 Usage
56
81
 
57
- ### Available Launch Options
82
+ ### Available Options
58
83
 
59
84
  1. **Launch Claude Code** - Standard Claude Code launch
60
85
  2. **Launch Claude Code (Skip Permissions)** - Launch with `--dangerously-skip-permissions`
61
- 3. **Launch Claude Code with Kimi K2 API** - Use Kimi API with encrypted storage
62
- 4. **Launch Claude Code with Kimi K2 API (Skip Permissions)** - Combine Kimi API with permission skipping
63
- 5. **Exit** - Close the launcher
86
+ 3. **Launch Claude Code with Third-party API** - Use configured third-party API
87
+ 4. **Launch Claude Code with Third-party API (Skip Permissions)** - Combine third-party API with permission skipping
88
+ 5. **Third-party API Management** - Configure, switch, remove APIs, view statistics
89
+ 6. **Language Settings** - Switch between 11 supported languages
90
+ 7. **Version Update Check** - Check for launcher updates
91
+ 8. **Exit** - Close the launcher
64
92
 
65
93
  ### Interactive Navigation
66
94
 
67
- - **Arrow Keys**: Use ↑↓ to navigate, Enter to select (in TTY environments)
68
- - **Number Selection**: Type 1-5 and press Enter (in non-TTY environments)
69
- - **Quick Exit**: Press Esc or Q to quit anytime
95
+ - **Arrow Keys**: Use ↑↓ to navigate, Enter to select
96
+ - **Escape Key**: Press Esc to go back or exit
97
+ - **Multi-language**: All interface text adapts to your selected language
98
+ - **Smart Tables**: Interactive tables for API management with clear visual feedback
70
99
 
71
100
  ### Example Session
72
101
 
@@ -81,44 +110,77 @@ $ claude-launcher
81
110
 
82
111
  → Launch Claude Code
83
112
  Launch Claude Code (Skip Permissions)
84
- Launch Claude Code with Kimi K2 API
85
- Launch Claude Code with Kimi K2 API (Skip Permissions)
113
+ Launch Claude Code with Third-party API
114
+ Launch Claude Code with Third-party API (Skip Permissions)
115
+ Third-party API Management
116
+ Language Settings
117
+ Version Update Check
86
118
  Exit
87
119
  ```
88
120
 
121
+ ### Third-party API Management
122
+
123
+ Access comprehensive API management through the dedicated menu:
124
+
125
+ ```bash
126
+ 📋 Third-party API Management
127
+
128
+ → Add New API
129
+ Remove API
130
+ Switch Active API
131
+ View Statistics
132
+ Export Configuration
133
+ Import Configuration
134
+ Change Password
135
+ Back to Main Menu
136
+ ```
137
+
89
138
  ## ⚙️ Configuration
90
139
 
91
- ### Automatic Configuration
140
+ ### Modern Configuration System
92
141
 
93
- On first run, if you select a Kimi API option and no configuration exists, the launcher will:
142
+ Claude Launcher 2.0 uses an advanced configuration system:
94
143
 
95
- 1. Automatically create a configuration file at `~/.claude-launcher.env`
96
- 2. Guide you through entering your Kimi API key
97
- 3. Encrypt and store your API key securely using machine-specific encryption
144
+ 1. **Encrypted JSON Storage**: Configuration stored at `~/.claude-launcher-apis.json`
145
+ 2. **Interactive Setup**: First-time wizard guides you through all options
146
+ 3. **Multi-language Support**: Interface adapts to your preferred language
147
+ 4. **Security First**: All sensitive data encrypted with AES-256-CBC
98
148
 
99
- ### Manual Configuration
149
+ ### First-time Setup Process
100
150
 
101
- If you prefer to set up manually, the config file locations are searched in this order:
151
+ 1. **Language Selection**: Choose from 11 supported languages
152
+ 2. **Security Setup**:
153
+ - Set up password protection for import/export (recommended)
154
+ - Or skip for basic usage (limited features)
155
+ 3. **API Configuration**: Add third-party APIs as needed
102
156
 
103
- 1. `.claude-launcher.env` in current directory
104
- 2. `.claude-launcher.env` in your home directory
105
- 3. `.claude-launcher.env` in the installation directory
157
+ ### Third-party API Configuration
106
158
 
107
- ### Configuration File Format
159
+ Configure any third-party API provider through the interactive interface:
108
160
 
109
- ```env
110
- KIMI_API_KEY=your_encrypted_api_key_here
111
- KIMI_BASE_URL=https://api.moonshot.cn/anthropic/
112
- ```
161
+ - **Supported Providers**: OpenAI, Anthropic, DeepSeek, Kimi, GLM (ZhiPu AI), and custom APIs
162
+ - **Secure Storage**: All API tokens encrypted before storage
163
+ - **Validation**: Real-time validation of URLs, tokens, and models
164
+ - **Usage Tracking**: Monitor API usage statistics
165
+ - **Provider-specific Features**: Optimized configuration for each provider with helpful notes and recommendations
166
+
167
+ ### Configuration Import/Export
168
+
169
+ With password protection enabled:
113
170
 
114
- **Note**: The `KIMI_API_KEY` is automatically encrypted when entered through the launcher. Do not manually edit encrypted values.
171
+ - **Export**: Secure backup of all configurations
172
+ - **Import**: Restore configurations on new machines
173
+ - **Password Protected**: All exports encrypted with your password
174
+ - **Automatic Validation**: Import validation ensures data integrity
115
175
 
116
- ### Security Features
176
+ ### Enhanced Security Features
117
177
 
118
- - **AES-256-CBC Encryption**: API keys are encrypted using industry-standard encryption
119
- - **Machine-specific Keys**: Encryption keys are derived from machine-specific data
120
- - **Local Storage Only**: Encrypted keys cannot be decrypted on other machines
121
- - **Secure Input**: API key input supports copy/paste and validation
178
+ - **AES-256-CBC Encryption**: All sensitive data encrypted with industry-standard algorithms
179
+ - **Machine-specific Keys**: Encryption keys derived from unique machine characteristics
180
+ - **Password Protection**: Optional password layer for configuration import/export
181
+ - **Secure Token Display**: API tokens masked in all interface displays
182
+ - **Strong Password Requirements**: Enforced password complexity for maximum security
183
+ - **Local Storage Only**: All data remains on your machine, cannot be decrypted elsewhere
122
184
 
123
185
  ## 📋 Requirements
124
186
 
@@ -174,4 +236,4 @@ If you encounter any issues or have questions:
174
236
 
175
237
  ---
176
238
 
177
- **Note**: This launcher is designed to work with Claude Code and Kimi K2 API. Make sure you have Claude Code installed before using this tool.
239
+ **Note**: This launcher is designed to work with Claude Code and various third-party APIs. Make sure you have Claude Code installed before using this tool. For third-party API usage, ensure you have valid API credentials from your preferred provider.