Skip to content

Chat command

CodeBuddy supports chat command, providing command requirements for various development scenarios, such as unit testing, code diagnostics, code review, project code retrieval, and explanations. It also supports custom commands to meet the need for custom extension commands in your coding scenarios.

Slash Command

After selecting code or files, you can quickly invoke chat commands in the dialog box by typing "/", and select different commands for different scenarios.

  • /cr

    Trigger a local project code review using /cr, allowing you to detect and resolve potential issues that local code changes might introduce during project development, improving code quality and accelerating the development process.

  • /tests

    The /tests command helps you generate detailed unit test code for each unit, ensuring the correctness and high coverage of each test, focusing your attention on the correctness of business code and improving the overall quality of the codebase.

  • /explain

    The /explain function performs semantic analysis based on the complete context of the selected code and files, converting complex code into easily understandable natural language, thereby improving development efficiency.。

  • /fix

    The /fix function can identify and analyze errors, defects, or vulnerabilities in the local repository code and provide a specific fix proposal, significantly improving your code quality.

Custom Commands

Benefits of Using Custom Commands

  • Improve Work Efficiency By setting up custom commands, developers can quickly call common code snippets or functions, avoiding repeated typing and searching. This not only saves time but also allows developers to focus more on the logic and creativity of their work.
  • Personalized Programming Experience Every developer has their own programming style and habits. The custom command feature allows users to adjust the AI's responses according to their needs, making it more in line with personal workflows and thought processes.
  • Promote Team Collaboration In team development, using unified custom commands helps team members maintain consistent coding styles and standards. This improves code readability and maintainability, reducing communication costs.

Creating Custom Command

  1. In the chat window, type "/" to bring up the command list, and click Create Command

  2. After typing the command name, press the "enter" key to create a custom command in the current codebase.

  3. In the chat window, type "/" to bring up the command list and view the created custom commands, for example:

    Note:If the custom command does not appear in the command list, try reloading.

Usage

In the chat window, type "/" to bring up the command list, and then select the custom command you created, for example: