Skip to content

ai code

Description

Command to use ai features.

Usage

bash
buildcli ai code [subcommand] [options] [path]

Subcommands

SubcommandDescription
comment, cComments out the selected code.
document, docsGenerates documentation for the project code.
test, tAutomatically generates unit tests for source code files using AI. Scans specified files or directories, identifies source files based on provided extensions, and utilizes an AI-powered service to generate corresponding test code. Supports interactive confirmation or auto-acceptance of generated tests.

Options

OptionDescription
-c, --contextOverwrite the default AI prompt.
--ext, --extensionsjava, kt, scala, groovy.

Examples

Example 1

Generates code review via the terminal with a custom prompt.

bash
buildcli ai code comment src/main/java/org/myproject --context "Make a quick code review"

Example 2

Documents all project code files with Javadocs.

bash
buildcli ai code docs src/main/java/org/myproject

Example 3

Automatically generates unit tests for source code files using AI.

bash
buildcli ai code test src/main/java/org/myproject

See Also