CodeBuddy

CodeBuddy Code is Tencent Cloud's terminal coding assistant. Environment variables override its API endpoint, key, and model so requests can use ModelGo.

Prerequisites

  • Node.js 18+ and CodeBuddy CLI are installed; codebuddy --version works.
  • A ModelGo API key is available from ModelGo Console.
  • You know the logical model ID from the Model Catalog.

1. Install CodeBuddy

bash
npm install -g @tencent-ai/codebuddy-code
codebuddy --version

2. Configure ModelGo variables

Set these variables in the shell that starts CodeBuddy:

bash
export CODEBUDDY_BASE_URL="https://api.modelgo.ai/v1"
export CODEBUDDY_API_KEY="sk-your-token"
export CODEBUDDY_MODEL="your-model-id"

CODEBUDDY_AUTH_TOKEN is CodeBuddy platform login, not the ModelGo model key.

3. Start and verify

bash
curl https://api.modelgo.ai/v1/models -H "Authorization: Bearer $CODEBUDDY_API_KEY"
codebuddy
codebuddy -p "Describe this project in one sentence"

Troubleshooting

CodeBuddy still uses its default model

Confirm variables are visible in the current shell, then fully restart codebuddy.

401 or 404 responses

Check CODEBUDDY_API_KEY, CODEBUDDY_MODEL, and CODEBUDDY_BASE_URL; do not put a full endpoint path in the Base URL.

Related docs