claude-config-adapter
v1.0.0
Published
Enterprise-grade Claude API configuration management tool with multi-provider support
Maintainers
Readme
Claude Config Adapter (CCA)
Enterprise-grade Claude API configuration management tool with multi-provider support.
🚀 Features
- 🔐 Enterprise Security: Token encryption using system keychain
- ⚡ Fast Switching: Switch configurations in under 3 seconds
- 🌍 Multi-Provider: Support for Kimi, Qwen, Anthropic, OpenAI
- 📝 Audit Logging: Complete operation history with compliance reports
- 🔄 Automatic Rollback: Configuration backup and restore
- 👥 Team Collaboration: Share configurations without exposing tokens
- 🎯 Environment Support: Separate dev/test/prod configurations
📦 Installation
Global Installation
npm install -g claude-config-adapterLocal Development
git clone https://github.com/anthropics/claude-config-adapter.git
cd claude-config-adapter
npm install
npm link🎯 Quick Start
1. Initialize
cca init2. Add Configuration
# Interactive mode
cca add my-kimi
# Non-interactive mode
cca add my-kimi --url https://api.moonshot.cn/v1 --token sk-xxx3. Test Configuration
cca test my-kimi4. Use Configuration
cca use my-kimi📋 Commands
Core Commands
| Command | Description | Example |
|---------|-------------|---------|
| cca init | Initialize CCA directory | cca init --force |
| cca list | List all configurations | cca list --verbose |
| cca add | Add new configuration | cca add kimi --url=https://api.moonshot.cn |
| cca use | Switch configuration | cca use kimi --env=prod |
| cca delete | Remove configuration | cca delete obsolete --force |
| cca test | Test API connectivity | cca test kimi --timeout=3000 |
| cca rotate | Update API token | cca rotate kimi |
Utility Commands
| Command | Description | Example |
|---------|-------------|---------|
| cca export | Export configurations | cca export > backup.yaml |
| cca import | Import configurations | cca import < backup.yaml |
| cca audit | View audit log | cca audit --export > audit.yaml |
| cca template | Manage templates | cca template --list |
| cca current | Show active config | cca current --env=test |
| cca rollback | Restore from backup | cca rollback --force |
🏗️ Architecture
Directory Structure
~/.cca/
├── providers.json # Configuration registry
├── envs/ # Environment-specific configs
│ ├── prod.json
│ └── test.json
├── templates/ # Pre-configured vendor templates
├── audit.log # Operation audit trail
└── current.json # Active configuration pointerSecurity Model
- Token Storage: Encrypted in system keychain (macOS Keychain, Windows Credential Vault)
- Access Control: Directory permissions set to 700 (Unix-like systems)
- Audit Trail: All operations logged with timestamp, user, and details
- Backup System: Automatic configuration backups before changes
🔧 Configuration Examples
Kimi (Moonshot)
cca add kimi \
--url https://api.moonshot.cn/v1 \
--token sk-your-token-hereQwen (Alibaba)
cca add qwen \
--url https://dashscope.aliyuncs.com/compatible-mode/v1 \
--token your-dashscope-tokenAnthropic Direct
cca add anthropic \
--url https://api.anthropic.com/v1 \
--token sk-ant-your-tokenOpenAI Compatible
cca add openai \
--url https://api.openai.com/v1 \
--token sk-your-openai-token🌍 Environment Support
Development vs Production
# Use test environment
cca use my-kimi --env=test
# Use production environment
cca use my-kimi --env=prodEnvironment Configuration
Each environment can have different settings:
- prod.json: Production settings
- test.json: Development/testing settings
👥 Team Collaboration
Export Configuration (No Tokens)
cca export --file team-config.yamlImport Shared Configuration
cca import --file team-config.yamlAdd Tokens Securely
cca rotate kimi # Each team member adds their own token🔍 Troubleshooting
Common Issues
Token Validation Failed
# Check token validity
cca test my-config
# Update token
cca rotate my-configConfiguration Not Found
# List available configurations
cca list
# Add missing configuration
cca add my-configClaude Desktop Not Restarting
- macOS: Manually quit and restart Claude Desktop
- Windows: Restart from Start Menu or taskbar
- Linux: Restart your Claude client manually
Backup and Recovery
# View available backups
cca rollback
# Force rollback to latest backup
cca rollback --force📊 Monitoring
View Audit Log
cca auditExport Audit Report
cca audit --export --file audit-report.yamlCheck Current Configuration
cca current
cca current --env=test🧪 Testing
Run Tests
npm test
npm test -- --coverageManual Testing
# Test all commands
cca init --force
cca add test --url https://api.example.com/v1 --token test-token
cca test test
cca list --verbose
cca export
cca delete test --force🔄 Development
Setup Development Environment
git clone https://github.com/anthropics/claude-config-adapter.git
cd claude-config-adapter
npm install
# Link for local testing
npm link
# Run with debug output
DEBUG=cca cca listProject Structure
src/
├── commands/ # CLI command implementations
├── utils/ # Core utilities and managers
├── templates/ # Vendor templates
└── tests/ # Unit tests📄 License
MIT License - see LICENSE file for details.
🤝 Contributing
- Fork the repository
- Create a feature branch
- Add tests for new functionality
- Ensure test coverage >= 85%
- Submit a pull request
📞 Support
- Issues: GitHub Issues
- Documentation: This README and
cca help [command] - Examples: Check
src/templates/for configuration examples
