tencent cloud

Installation and Login

Download
Focus Mode
Font Size
Last updated: 2026-09-30 18:15:48
AI-Translated

System Requirements

Node.js: version 18.20 or later
Operating system: macOS, Linux, or Windows

Environment Verification

# Check the Node.js version
node --version # Should display v18.0.0 or later

# Check the npm version
npm --version

Installation Methods

Installing with a Package Manager

Node.js Package Manager

Select a package manager available on this machine to run the following command:
npm
pnpm
yarn
bun
npm install -g @tencent-ai/codebuddy-code
pnpm add -g @tencent-ai/codebuddy-code
yarn global add @tencent-ai/codebuddy-code
bun install -g @tencent-ai/codebuddy-code

Homebrew (macOS/Linux)

Install directly without Node.js:
Two-Step Installation
Single-Command Installation
Brewfile
# Add tap
brew tap Tencent-CodeBuddy/tap

# Install Tools
brew install codebuddy-code
brew install Tencent-CodeBuddy/tap/codebuddy-code
tap "Tencent-CodeBuddy/tap"
brew "codebuddy-code"

Installing with Native Binaries (Beta)

Note:
Beta feature: Native binary installation is currently in the Beta testing phase, and its features are still being improved. If you encounter any issues, contact technical support at codebuddy@tencent.com.
The native installer provides a standalone CodeBuddy installation without requiring a Node.js environment.

Download and Install:

# macOS/Linux
curl -fsSL https://copilot.tencent.com/cli/install.sh | bash
# Windows
irm https://copilot.tencent.com/cli/install.ps1 | iex

Feature Description

Native binary installation offers the following features compared to the npm version:
A single executable file with no additional dependencies required.
No Node.js runtime required
Improved automatic update mechanism

Supported Platforms

macOS (Apple Silicon M1/M2/M3 or Intel x86_64)
Linux (arm64 or x86_64)
Windows (x86_64)

Migrating from npm Versions

If you have already installed CodeBuddy Code via npm, you can migrate to the native binary version using the following command:
codebuddy install

Fresh Installation

macOS / Linux
Windows
curl -fsSL https://www.codebuddy.cn/cli/install.sh | bash
irm https://www.codebuddy.cn/cli/install.ps1 | iex

Verifying the Installation

The installation script automatically downloads the latest version and configures environment variables. After the installation is complete, run the following command to verify:
codebuddy --version
If the command is unavailable, manually add the installation path to the PATH environment variable:
macOS / Linux
Windows
export PATH="$HOME/.local/bin:$PATH"

# To make it permanent, add it to your shell configuration file:
# Bash: ~/.bashrc or ~/.bash_profile
# Zsh: ~/.zshrc
# Add the following path to your user environment variables:
# %USERPROFILE%\\AppData\\Local\\codebuddy\\bin

Configuration Directory

By default, CodeBuddy Code stores configuration files in the following directories:
Platform
Default Configuration Directory
macOS / Linux
~/.codebuddy
Windows
%USERPROFILE%\\.codebuddy

Configuration Directory Contents

~/.codebuddy/
├── settings.json # User settings
├── .mcp.json # MCP server configuration
└── skills/ # User-defined skills

Custom Configuration Directory

You can customize the configuration directory location by setting the CODEBUDDY_CONFIG_DIR environment variable:
export CODEBUDDY_CONFIG_DIR="$HOME/.my-codebuddy-config"
This is particularly useful in the following scenarios:
Multiple CodeBuddy instances require independent configuration.
In enterprise environments, configuration locations need to be managed centrally.
Avoid configuration conflicts when this application coexists with other applications that use the CodeBuddy engine, such as WorkBuddy.

Update

Automatic Updates

By default, CodeBuddy Code automatically keeps itself up to date, ensuring that you have the latest features and security fixes.

Disabling Automatic Updates

To disable automatic updates, set the environment variable:
export DISABLE_AUTOUPDATER=1

Manual Updates

To manually update to the latest version, run the following command:
codebuddy update
The update command automatically detects your installation method and performs the corresponding update.

Updating with a Package Manager

If the codebuddy update command fails to update successfully, you can also reinstall using a package manager:
npm install -g @tencent-ai/codebuddy-code
Or use another package manager (pnpm, yarn, or bun) to run the corresponding installation command.

Uninstallation

Uninstalling the Package Manager Version

Homebrew
npm
pnpm
yarn
bun
# Uninstall Tools
brew uninstall codebuddy-code

# Remove tap (Optional)
brew untap Tencent-CodeBuddy/tap
npm uninstall -g @tencent-ai/codebuddy-code
pnpm remove -g @tencent-ai/codebuddy-code
yarn global remove @tencent-ai/codebuddy-code
bun remove -g @tencent-ai/codebuddy-code

Uninstalling the Native Binary Version

macOS / Linux

Delete the executable file:
rm -f ~/.local/bin/codebuddy

Cleaning Up Configuration Files (Optional)

To completely clean up, delete the configuration directory:
macOS / Linux:
rm -rf ~/.codebuddy
rm -rf ~/.local/share/codebuddy
Tip:
If you have customized the configuration directory by using the CODEBUDDY_CONFIG_DIR environment variable, delete the corresponding directory.

Login Authentication

When using CodeBuddy Code for the first time, you need to complete login authentication. After startup, a login method selection page is displayed:
Select login method:
› Log in via Chinese Site
Log in via International Site
Log in via Enterprise Domain
Log in via iOA (Tencent only)

Login Method Description

Login Method
Scenario
Description
Chinese Site
Domestic users
Authenticate through the Tencent Cloud China site (copilot.tencent.com), which supports mainstream domestic models.
International Site
Overseas users
Authenticate through the Tencent Cloud International site (codebuddy.ai), which supports mainstream overseas models.
Enterprise Domain
Dedicated Edition/Private Deployment
Connect to the enterprise dedicated or self-hosted CodeBuddy service and enter the service address provided by the enterprise.
Use the ↑↓ keys to select a login method, and press Enter to confirm. The browser then opens automatically to complete authentication.

FAQs

Command Unavailable

Problem: After installation, the system prompts codebuddy: command not found
Solution:
1. Check whether the installation path is in the PATH environment variable:
echo $PATH
2. Add the CodeBuddy installation path to PATH (see the installation verification section above).
3. Restart the terminal or reload the configuration file:
source ~/.bashrc # or ~/.zshrc

Old Version Still in Use After the Update

Problem: npm install -g indicates successful installation, but codebuddy --version still shows an old version.
This is usually caused by multiple codebuddy executable files existing in the system, for example, when CodeBuddy is installed through both npm and Homebrew, or when nvm switches the Node version.

Network issue

Problem: Network connection failed during installation or update.
Solution:
1. Check the network connection.
2. Configure the npm registry mirror (if installing via npm):
npm config set registry https://registry.npmmirror.com


Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback