Skip to main content

CodeBuddy Code

CodeBuddy Code is a terminal AI programming tool (CLI) developed by Tencent Cloud CodeBuddy. It supports AI-powered conversations, code generation, file operations, and terminal command execution via the command line.

Prerequisites

  • You have activated a TCB environment and obtained the environment ID cloudBaseEnvID
  • Enable the required model in the AI console
  • Obtain the Base URL and API Key in the AI console
Base URLhttps://<ENV_ID>.api.tcloudbasegateway.com/v1/ai/cloudbase

Configuration Steps

CodeBuddy Code manages custom models through a models.json configuration file.

Configuration field reference

FieldDescription
idModel ID, copy the enabled model identifier from the AI Console model list
nameDisplay name for the model
urlModel Base URL, obtained from the AI Console
apiKeyAPI Key for calling the model, obtained from the AI Console
  1. Open or create the CodeBuddy Code configuration file
note

If browsing for the file, your file browser may hide files starting with ".". You may need to enable showing hidden files.

On Mac, use Finder shortcut Command + Shift + .. On Windows, check "File Explorer - View - Show - Hidden items".

  • Mac/Linux path
~/.codebuddy/models.json
  • Windows path
C:\Users\<your-username>\.codebuddy\models.json
  1. Add the following configuration
{
"models": [
{
"id": "hy3-preview",
"name": "hy3-preview (CloudBase)",
"vendor": "CloudBase",
"url": "https://{{cloudBase-env-ID}}.api.tcloudbasegateway.com/v1/ai/cloudbase",
"apiKey": "eyJhbGciOiJSUzI1N...",
"maxInputTokens": 128000,
"maxOutputTokens": 8192,
"supportsToolCall": true,
"supportsImages": true
}
],
"availableModels": ["hy3-preview"]
}
  1. Start CodeBuddy Code
codebuddy --model hy3-preview

Or switch models during interaction with the /model command.

Troubleshooting

ErrorSolution
Request failed / connection timeoutVerify the Base URL in the url field is correct
401 authentication failedAPI Key is incorrect or expired, please obtain a new one from the AI Console
429 Token usage exceeded quota limitModel name is incorrect, or the model is not enabled in the AI Console
Model not visible in listCheck that the availableModels array includes the model ID