Skip to content

Commit 9dfd68a

Browse files
Merge pull request #19 from BuildCLI/develop
Develop to main
2 parents 815fdd6 + e0d3233 commit 9dfd68a

7 files changed

Lines changed: 270 additions & 13 deletions

File tree

.vitepress/config.mts

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -100,28 +100,45 @@ function sidebarFAQ(): DefaultTheme.SidebarItem[] {
100100
function sidebarCommands(): DefaultTheme.SidebarItem[] {
101101
return [
102102
{
103-
text: 'Autocomplete',
104-
link: 'autocomplete',
103+
text: 'About',
104+
link: 'about',
105105
},
106106
{
107-
text: 'Project',
108-
link: 'project',
107+
text: 'AI',
108+
link: 'ai',
109109
},
110110
{
111-
text: 'About',
112-
link: 'about',
111+
text: 'Autocomplete',
112+
link: 'autocomplete',
113113
},
114114
{
115-
text: 'Version',
116-
link: 'version',
115+
text: 'Changelog',
116+
link: 'changelog',
117+
},
118+
{
119+
text: 'Config',
120+
link: 'config',
117121
},
118122
{
119123
text: 'Doctor',
120124
link: 'doctor',
121125
},
126+
122127
{
123-
text: 'Changelog',
124-
link: 'changelog',
128+
text: 'Hook',
129+
link: 'hook',
130+
},
131+
{
132+
text: 'Project',
133+
link: 'project',
134+
},
135+
{
136+
text: 'Run',
137+
link: 'run',
138+
},
139+
{
140+
text: 'Version',
141+
link: 'version',
125142
},
126143
];
127144
}

src/commands/ai.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
2+
# `ai code`
3+
4+
## Description
5+
6+
Command to use ai features.
7+
8+
## Usage
9+
10+
```bash
11+
buildcli ai code [subcommand] [options] [path]
12+
```
13+
14+
## Subcommands
15+
16+
| Subcommand | Description |
17+
|-----------------|---------------------------------------------|
18+
| `comment, c` | Comments out the selected code. |
19+
| `document, docs` | Generates documentation for the project code. |
20+
| `test, t` | Automatically 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. |
21+
22+
23+
## Options
24+
25+
| Option | Description |
26+
|-----------------|-----------------------------------------------------|
27+
| `-c, --context` | Overwrite the default AI prompt. |
28+
| `--ext, --extensions` | java, kt, scala, groovy. |
29+
30+
31+
## Examples
32+
33+
### Example 1
34+
35+
Generates code review via the terminal with a custom prompt.
36+
37+
```bash
38+
buildcli ai code comment src/main/java/org/myproject --context "Make a quick code review"
39+
```
40+
41+
### Example 2
42+
43+
Documents all project code files with Javadocs.
44+
45+
```bash
46+
buildcli ai code docs src/main/java/org/myproject
47+
```
48+
49+
### Example 3
50+
51+
Automatically generates unit tests for source code files using AI.
52+
53+
```bash
54+
buildcli ai code test src/main/java/org/myproject
55+
```
56+
57+
58+
## See Also
59+
60+
- [autocomplete](autocomplete.md)
61+
- [about](about.md)

src/commands/config.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# `config`
2+
3+
## Description
4+
Analyzes the environment to ensure all necessary tools and
5+
dependencies are available and functioning correctly.
6+
Provides subcommands for diagnosing issues and applying
7+
fixes, ensuring smooth execution of other commands.
8+
9+
## Usage
10+
11+
```bash
12+
buildcli config [options] [subcommands]
13+
```
14+
15+
## Subcommands
16+
17+
| Option | Description |
18+
|--------------------|---------------------------------------------------------------------------------------------------------------------------|
19+
| `set`, `s` | Set configuration properties for BuildCLI. |
20+
| `clear`, `c` | Clear config file |
21+
| `init`, `i`, `create` | Initializes a new configuration context for BuildCLI. |
22+
| `print`, `p`, `show`,`list` | Prints the current configuration. |
23+
| `remove`, `rm`, `r` | Removes specified configuration properties from BuildCLI. |
24+
25+
26+
## Options
27+
28+
| Option | Description |
29+
|--------------------|---------------------------------------------------------------------------------------------------------------------------|
30+
| `--global`, `-g` | Release version to label the generated changelog (e.g., 1.2.3). If not specified, use the latest Git tag or 'Unreleased'. |
31+
| `--local`, `-l` | Output format. Supported: markdown, html and json. (default: markdown) |
32+
33+
34+
## Examples
35+
36+
### Example 1
37+
38+
Set local configuration properties for BuildCLI.
39+
40+
```bash
41+
buildcli -l init
42+
```
43+
44+
### Example 2
45+
46+
Defines AI vendor as Ollama.
47+
48+
```bash
49+
buildcli -g set buildcli.ai.vendor=ollama
50+
```
51+
52+
### Example 3
53+
54+
Print BuildCLI configurations
55+
56+
```bash
57+
buildcli print
58+
```
59+
60+
### Example 4
61+
62+
Removes specified configuration properties from BuildCLI.
63+
64+
```bash
65+
buildcli remove set buildcli.ai.vendor=ollama
66+
```
67+
68+
### Example 5
69+
70+
Clear config file
71+
72+
```bash
73+
buildcli clear
74+
```
75+
76+
## See Also
77+
78+
- [doctor](doctor.md)
79+
- [project](project.md)
80+
- [autocomplete](autocomplete.md)

src/commands/hook.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# `hook`
2+
3+
## Description
4+
Manage hooks. Hooks are commands that are executed before or after a specific command.
5+
6+
## Usage
7+
8+
```bash
9+
buildcli hook [subcommands] <args>
10+
```
11+
12+
## Subcommands
13+
14+
| Option | Description |
15+
|--------------------|---------------------------------------------------------------------------------------------------------------------------|
16+
| `add` | Add a hook to a command. Args: `[before/after] "[command]" "[hookCommand]"`|
17+
| `remove` | Remove a hook from a command. Args: `[before/after] "[command]"` |
18+
| `list` | Remove a hook from a command. No args are needed. |
19+
20+
21+
22+
## Examples
23+
24+
### Example 1
25+
26+
This will execute 'project clean' before 'project build'.
27+
You can use `b` as an alias for `before` and a for `after`.
28+
29+
```bash
30+
buildcli hook add b "project build" "project
31+
```
32+
33+
### Example 2
34+
35+
This will remove any command that run after 'project build'
36+
37+
```bash
38+
buildcli hook remove a "project build"
39+
```
40+
41+
### Example 3
42+
43+
This will display all registered hooks and their associated commands.
44+
45+
```bash
46+
buildcli list
47+
```
48+
49+
## See Also
50+
51+
- [ai](ai.md)
52+
<!-- - [plugin](plugin.md) -->
53+
- [config](config.md)

src/commands/project.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ buildcli project [subcommand] [options] [arguments]
2424
| `init, i` | Initializes a new project. |
2525
| `cleanup, clean`| Cleans up the project. |
2626
| `update, up` | Updates the project. |
27-
| `document-code, docs` | Documents the project code. |
2827

2928
## Options
3029

src/commands/run.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# `run`
2+
3+
## Description
4+
Run projects or features related to docker
5+
6+
## Usage
7+
8+
```bash
9+
buildcli run [<file-or-dir>] [<args>...] [SUBCOMMAND]
10+
```
11+
12+
## Parameters
13+
14+
| Option | Description |
15+
|--------------------|---------------------------------------------------------------------------------------------------------------------------|
16+
| `[<file-or-dir>]` | The file or directory to run. If a directory, it will package and run the project.|
17+
| `[<args>...]` | Arguments to pass to the program. |
18+
19+
## Subcommands
20+
21+
| Option | Description |
22+
|--------------------|---------------------------------------------------------------------------------------------------------------------------|
23+
| `dockerfile`, `docker`, `d` | Builds and runs a Docker image for the project. Builds the Docker image and starts the container, exposing port 8080.|
24+
25+
## Examples
26+
27+
### Example 1
28+
29+
This will execute `Hello.java` file.
30+
```bash
31+
buildcli run Hello.java
32+
```
33+
34+
### Example 2
35+
36+
This will the docker file named "yourdockerfile"
37+
38+
```bash
39+
buildcli run docker -n "yourdockerfile"
40+
```
41+
42+
43+
## See Also
44+
45+
- [ai](ai.md)
46+
<!-- - [plugin](plugin.md)-->
47+
- [config](config.md)

src/installation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ if not exist "%USERPROFILE%\bin" mkdir "%USERPROFILE%\bin"
2525
copy /Y cli\target\buildcli.jar "%USERPROFILE%\bin\buildcli.jar"
2626
(
2727
echo @echo off
28-
echo java --enable-preview --add-modules jdk.incubator.vector -jar "%%USERPROFILE%%\bin\buildcli.jar"
28+
echo java --enable-preview --add-modules jdk.incubator.vector -jar "%USERPROFILE%\bin\buildcli.jar %*"
2929
) > "%USERPROFILE%\bin\buildcli.bat"
3030
echo %PATH% | findstr /I "%USERPROFILE%\bin" >nul || (
31-
setx PATH "%PATH%;%USERPROFILE%\bin"
31+
setx PATH "%%PATH%%;%USERPROFILE%\bin"
3232
)
3333
endlocal
3434
```

0 commit comments

Comments
 (0)