tencent cloud

Quick Start

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

First Experience

1. Go to the Project Directory

cd /path/to/your/project

2. Start Interactive Mode

codebuddy
cbc
You will see a welcome page:
CodeBuddy Code v1.0.0
Enter /help to view available commands.
Start a conversation and let AI become your coding partner.

>
Note:
If you want CodeBuddy Code to always respond in a specific language (such as Simplified Chinese), run the /config command after startup to set the Language option.

3. Initialize Project Context

Before you formally start a conversation, strongly recommend running the /init command first to initialize the project context:
> /init

Why Is /init Important?

Improved results:
More Accurate Understanding: By building a project knowledge graph in advance, AI can understand code structure and business logic more accurately.
Faster Responses: Avoid repeated file scanning to significantly improve response speed in subsequent conversations.
More Precise Suggestions: Provide suggestions that better align with the project architecture based on a global view.
Reduce Misjudgments: Understand project dependencies to avoid proposing incompatible changes.
Cost Optimization:
Lower token Consumption: Build context once to avoid re-analyzing it in every conversation.
Reduce Duplicate Requests: Preload key information to reduce context Token overhead by 30-50%.
More Efficient Conversations: Each conversation round carries less redundant information, resulting in lower overall costs.
Best Practices:
# When Using the Project for the First Time
> /init

# When the Project Structure Undergoes Significant Changes (Such as Adding New Modules or Refactoring)
> /clear # Start a new conversation
> /init # Reinitialize

4. Try Your First Conversation

> Help me analyze the structure of this project.
CodeBuddy automatically scans your project files and provides a detailed structural analysis.

Core Usage Patterns

Interactive Conversation Mode

The most natural way to use it, ideal for exploratory development:
codebuddy
Typical Conversation Example:
> I want to add a loading state to this React component.
> Help me refactor this function to make it more readable.
> What are the potential performance issues in this code?
> Write unit tests for this API.

Single-Command Mode

Suitable for scripting and automation scenarios:
# Ask Directly
codebuddy -p "Optimize the performance of this SQL query"

# Pipe Input
cat error.log | codebuddy -p "Analyze these error logs"

# File Analysis (Add -y or --dangerously-skip-permissions when authorization is required)
codebuddy -p "Review the code quality of src/utils.js" -y
Important:
When using the -p/--print parameter for a single execution, if the operation requires authorized actions such as accessing files or running commands, you must add the -y (or --dangerously-skip-permissions) parameter.

Project-Level Operations

Handle complex cross-file tasks:
# Project Refactoring (Requires File Operation Authorization)
codebuddy -p "Migrate all components from class components to function components" -y

# Code Standards (Requires File Read Authorization)
codebuddy -p "Check the TypeScript type definitions across the entire project" -y

# Test Coverage (Requires File Operation Authorization)
codebuddy -p "Add unit tests for all files in the services directory" -y

Shortcut Keys

Basic Navigation

Shortcut Keys
Function
↑/↓
Browse command history
↓
View background tasks (when tasks are running).
Tab
Autocomplete commands
Esc
Clear input (press twice) / Return to previous menu.
Ctrl+C
Exit the program.
Ctrl+D
Exit the program (when the input box is empty and no conversation is in progress, press twice).

Permissions and Modes

Shortcut Keys
Function
Shift+Tab (Windows also supports Alt+M).
Switch permission mode (default → bypass → accept → plan).

Editing Features

Shortcut Keys
Function
Ctrl+R
Expand or collapse detailed output (in conversations).
Ctrl+G
Edit prompts with an external editor.
Enter
Sending messages.
Shift+Enter
Line break (multi-line input).
\\Enter
Line break (backslash escape).
Ctrl+J
Insert line break (multi-line input).

Panel Operations

Shortcut Keys
Function
Up/Down or j/k
Navigate options in the panel (Vim-style supported).
Enter
Select the current item.
Space
Toggle selection (multi-select panel).
x
Terminate the selected background task.

Dedicated Features

Shortcut Keys
Function
Ctrl+O
View thinking details panel.
When the terminal displays the "Thinking" indicator, you can press Ctrl+O to open the full reasoning content, and then press Ctrl+O again to exit.


Help and Support

Was this page helpful?

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

Feedback