CodeBuddy Code Configuration Documentation
Overview
This document explains how to configure CodeBuddy Code using CloudBase AI CLI.
CloudBase AI CLI supports configuring CodeBuddy Code in two ways:
- CodeBuddy account login: Log in using a CodeBuddy account, supporting OAuth authentication.
- API key configuration: Log in using a CodeBuddy API key
CodeBuddy Configuration
Run:
tcb ai --setup
After running the command, you will go to the configuration wizard.
- Select the AI programming assistant to be configured, and select
CodeBuddy Code - Choose the configuration method, and choose
Log in using a CodeBuddy account - Follow the prompts to log in to your CodeBuddy account
- Finally, select the default AI programming assistant to use. It will be opened by default when you run
tcb aiin the future.
Launching CodeBuddy Code
tcb ai -a codebuddy
tip
If CodeBuddy Code is configured as the default, you can directly run tcb ai.
Detailed Configuration Instructions
Custom Configuration
Configuring the CodeBuddy API Key
- API Key: Enter your CodeBuddy API Key
Environment Variable Configuration
CodeBuddy Code supports configuration via environment variables:
export CODEBUDDY_API_KEY="your-api-key-here"
MCP Server Configuration
CodeBuddy Code supports MCP command management through parameter pass-through:
# Parameter Pass-through via CloudBase AI CLI
tcb ai -a codebuddy -- --mcp-server "your-mcp-server-config"
Configuration Validation
The configuration of CodeBuddy Code is automatically validated, including:
- API Key Format Validation
- Network connectivity test
- MCP Server Configuration Check
Troubleshooting
Frequently Asked Questions
API Key Invalid
- Check if the API Key is correct
- Verify if the API Key has sufficient usage permissions
- Check the CodeBuddy account status
Network Connection Issues
- Check firewall settings
- Verify that the network can access the CodeBuddy service
- Try changing the network environment
MCP Server Configuration Error
- Verify MCP server configuration format
- Check if the server address is accessible
- Verify server authentication credentials
View Logs
Enable verbose logging to troubleshoot issues:
tcb ai -a codebuddy -- --verbose
Best Practices
API Key Security Management
- Use environment variables instead of hardcoding API keys
- Rotate API keys regularly
- Restrict the permission scope of API keys
MCP Server Management
- Use configuration files to manage multiple MCP servers
- Check server status regularly
- Back up important server configurations
Performance Optimization
- Select an appropriate model based on the project scale
- Configure the number of concurrent requests appropriately
- Monitor API usage and cost