CodeBuddy Code Installation Guide
📋 Table of Contents
Installation Methods
📦 Install via Package Manager
Node.js Package Managers
Prerequisites: Node.js 18.20 or higher
Choose your preferred package manager and run the following command:
bash
npm install -g @tencent-ai/codebuddy-codebash
pnpm add -g @tencent-ai/codebuddy-codebash
yarn global add @tencent-ai/codebuddy-codebash
bun install -g @tencent-ai/codebuddy-codeHomebrew (macOS/Linux)
No Node.js required, install directly:
bash
# Add tap
brew tap Tencent-CodeBuddy/tap
# Install tool
brew install codebuddy-codebash
brew install Tencent-CodeBuddy/tap/codebuddy-coderuby
tap "Tencent-CodeBuddy/tap"
brew "codebuddy-code"Verify Installation
After installation, run the following command to verify successful installation:
bash
codebuddy --version⚙️ Install via Native Binary (Beta)
⚠️ Beta Testing Phase
Native binary installation is currently in Beta testing phase, and features are still being improved. If you encounter any issues, please submit an issue report on the Issues page, or contact technical support (codebuddy@tencent.com).
Features
Native binary installation provides the following features compared to the npm version:
- Single executable file with no additional dependencies
- 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 Version
If you have already installed CodeBuddy Code via npm, you can migrate to the native binary version using the following command:
bash
codebuddy installFresh Installation
bash
curl -fsSL https://copilot.tencent.com/cli/install.sh | bashpowershell
irm https://copilot.tencent.com/cli/install.ps1 | iexVerify Installation
The installation script will automatically download the latest version and configure environment variables. After installation, run the following command to verify:
bash
codebuddy --versionIf the command is not available, manually add the installation path to the PATH environment variable:
bash
export PATH="$HOME/.local/bin:$PATH"
# For permanent effect, it's recommended to add to your shell configuration file:
# Bash: ~/.bashrc or ~/.bash_profile
# Zsh: ~/.zshrcpowershell
# Add the following path to user environment variables:
# %USERPROFILE%\AppData\Local\codebuddy\bin🔄 Updates
Automatic Updates
CodeBuddy Code automatically stays up to date by default to ensure you have the latest features and security fixes.
Disable Automatic Updates
To disable automatic updates, set the environment variable:
bash
export DISABLE_AUTOUPDATER=1Manual Updates
Use the following command to manually update to the latest version:
bash
codebuddy updateThe update command will automatically detect your installation method and perform the corresponding update operation.
Update via Package Manager
If the codebuddy update command fails to update successfully, you can also reinstall using your package manager:
bash
npm install -g @tencent-ai/codebuddy-codeOr use the corresponding installation command with other package managers (pnpm, yarn, bun).
🔧 Troubleshooting
Command Not Available
Issue: After installation, you get codebuddy: command not found
Solution:
Check if the installation path is in the
PATHenvironment variable:bashecho $PATHAdd the CodeBuddy installation path to
PATH(refer to the Verify Installation section above)Restart your terminal or reload the configuration file:
bashsource ~/.bashrc # or ~/.zshrc
Network Issues
Issue: Network connection failure during installation or update
Solution:
- Check network connection
- Configure npm registry mirror (if installing via npm):bash
npm config set registry https://registry.npmmirror.com
🗑️ Uninstallation
Uninstall Package Manager Version
bash
# Uninstall tool
brew uninstall codebuddy-code
# Remove tap (optional)
brew untap Tencent-CodeBuddy/tapbash
npm uninstall -g @tencent-ai/codebuddy-codebash
pnpm remove -g @tencent-ai/codebuddy-codebash
yarn global remove @tencent-ai/codebuddy-codebash
bun remove -g @tencent-ai/codebuddy-codeUninstall Native Binary Version
macOS / Linux
Remove the executable file:
bash
rm -f ~/.local/bin/codebuddyClean Configuration Files (Optional)
For complete cleanup, you can delete the configuration directories:
macOS / Linux:
bash
rm -rf ~/.codebuddy
rm -rf ~/.local/share/codebuddy