Skip to content
This repository was archived by the owner on Oct 2, 2024. It is now read-only.

Commit f2ae549

Browse files
committed
Add ChatGPT extension. Add LiteCommand Features topic. Add IntelliJ Plugin topic.
1 parent 4e0c247 commit f2ae549

11 files changed

+192
-7
lines changed
12.8 MB
Binary file not shown.
60.4 KB
Loading
80.6 KB
Loading

Writerside/litecommands.tree

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,19 @@
55
<instance-profile id="litecommands"
66
name="LiteCommands"
77
start-page="Introdution.md">
8-
9-
<toc-element topic="Introdution.md">
8+
<toc-element toc-title="Introduction">
9+
<toc-element topic="Introdution.md">
10+
</toc-element>
11+
<toc-element topic="Features-of-LiteCommands.topic"/>
12+
</toc-element>
13+
<toc-element topic="IntelliJ-IDEA-Plugin.md"/>
14+
<toc-element toc-title="Getting Started">
15+
<toc-element topic="Dependency.md"/>
1016
</toc-element>
11-
<toc-element topic="Dependency.md"/>
1217
<toc-element topic="Platforms.md">
1318
<toc-element topic="SENDER.md"/>
1419
</toc-element>
20+
1521
<toc-element topic="Configuration.md"/>
1622
<toc-element topic="Command.md"/>
1723
<toc-element topic="Arguments.md">
@@ -30,6 +36,7 @@
3036
<toc-element topic="Custom-Types.md"/>
3137
</toc-element>
3238
<toc-element topic="Jakarta-Extension.md"/>
39+
<toc-element topic="ChatGPT-Extension.md"/>
3340
<toc-element topic="Adventure-Kyori.md">
3441
<toc-element topic="adventure.md"/>
3542
<toc-element topic="adventure-platform.md"/>

Writerside/topics/Adventure-Kyori.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,30 @@ Depending on the platform you are using, see the following pages for more inform
2020
- `litecommands-adventure` -> [Adventure](adventure.md)
2121
- `build-in` means that you don't need to add any additional artifacts to your project.
2222

23-
</tip>
23+
</tip>
24+
25+
```mermaid
26+
graph LR
27+
ADVENTURE_PLATFORM[litecommands-adventure-platform]
28+
ADVENTURE[litecommands-adventure]
29+
30+
BUKKIT[Bukkit / Spigot]
31+
BUNGEE[BungeeCord / Waterfall]
32+
PAPER[Paper / Purpur]
33+
VELOCITY[Velocity]
34+
MINESTOM[MineStom]
35+
36+
LC_BUKKIT[litecommands-bukkit]
37+
LC_BUNGEE[litecommands-bungeecord]
38+
LC_VELOCITY[litecommands-velocity]
39+
LC_MINESTOM[litecommands-minestom]
40+
41+
BUKKIT --> LC_BUKKIT
42+
BUKKIT --> ADVENTURE_PLATFORM
43+
PAPER --> ADVENTURE
44+
PAPER --> LC_BUKKIT
45+
BUNGEE --> ADVENTURE_PLATFORM
46+
BUNGEE --> LC_BUNGEE
47+
VELOCITY --> LC_VELOCITY
48+
MINESTOM --> LC_MINESTOM
49+
```
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# ChatGPT Extension
2+
3+
The `litecommands-chatgpt` is a extension for supporting ChatGPT suggestions.
4+
5+
## Dependency
6+
7+
Add the following dependency to your project:
8+
9+
<tabs>
10+
<tab title="Gradle KTS">
11+
12+
```kotlin
13+
implementation("dev.rollczi:litecommands-chatgpt:%latest_version%")
14+
```
15+
</tab>
16+
<tab title="Maven">
17+
18+
```xml
19+
<dependency>
20+
<groupId>dev.rollczi</groupId>
21+
<artifactId>litecommands-chatgpt</artifactId>
22+
<version>%latest_version%</version>
23+
</dependency>
24+
```
25+
</tab>
26+
27+
</tabs>
28+
29+
30+
## Registering the extension
31+
32+
Register the extension in the `LiteCommands` builder:
33+
34+
```java
35+
.extension(new LiteChatGptExtension<>(), configuration -> configuration
36+
.apiKey("OPENAI_API_KEY") // get your api key from https://platform.openai.com/account/api-keys
37+
.model(ChatGptModel.GPT_4) // get model from https://platform.openai.com/docs/models/gpt-3-5
38+
.temperature(1.0) // see more https://platform.openai.com/docs/guides/gpt/how-should-i-set-the-temperature-parameter
39+
.tokensLimit(2, 64) // min and max tokens
40+
.cooldown(Duration.ofMillis(500)) // cooldown between suggestions per player
41+
)
42+
```
43+
44+
## Example
45+
46+
You can use `@ChatGpt` annotation to get suggestions from ChatGPT.
47+
48+
```Java
49+
@Command(name = "ban")
50+
public class BanCommand {
51+
52+
@Execute
53+
void ban(
54+
@Arg Player player,
55+
@Join @ChatGpt(topic = "Reason for ban") String reason
56+
) {
57+
player.kickPlayer(reason);
58+
}
59+
60+
}
61+
```
62+
63+
## Demo
64+
65+
See the demo of ChatGPT extension in action:
66+
67+
<video src="../images/chat-gpt/chat-gpt.mp4" controls/>
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE topic
3+
SYSTEM "https://resources.jetbrains.com/writerside/1.0/xhtml-entities.dtd">
4+
<topic xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:noNamespaceSchemaLocation="https://resources.jetbrains.com/writerside/1.0/topic.v2.xsd"
6+
title="LiteCommands Features" id="Features-of-LiteCommands">
7+
8+
<section-starting-page>
9+
<title>LiteCommands Features</title>
10+
<description>
11+
LiteCommands offers a wide range of features to make your coding experience better.
12+
</description>
13+
14+
<spotlight>
15+
<a href="Platforms.md"
16+
description="Cross-platform support" type="start"/>
17+
<a href="Adventure-Kyori.md"
18+
description="Adventure support" type="navigation"/>
19+
</spotlight>
20+
21+
<primary>
22+
<title>IntelliJ IDEA Plugin</title>
23+
<a href="IntelliJ-IDEA-Plugin.md"
24+
description="LiteCommands has an IntelliJ IDEA plugin!"/>
25+
...
26+
</primary>
27+
28+
<secondary>
29+
<title>Jakarta Support</title>
30+
<a href="Jakarta-Extension.md"
31+
description="LiteCommands supports Jakarta!"/>
32+
...
33+
</secondary>
34+
35+
<misc>
36+
<cards>
37+
<title>Annotations</title>
38+
<a href="Arg.md"/>
39+
<a href="Join-Argument.md"/>
40+
<a href="Flag.md"/>
41+
<a href="optionalarg-null-way.md"/>
42+
...
43+
</cards>
44+
</misc>
45+
</section-starting-page>
46+
</topic>
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# IntelliJ IDEA Plugin
2+
3+
The LiteCommands **IntelliJ IDEA** Plugin enhances the development experience for LiteCommands framework users by providing a set of powerful features aimed at improving command and argument validation, offering helpful suggestions, and facilitating seamless migration. Below are the key features of the plugin:
4+
5+
## Command Viewer
6+
7+
The Command Viewer is a tool that allows you to view current commands in your command class. It provides a convenient way to navigate through your commands and view their structure with their properties.
8+
9+
![intellij-command-viewer.png](intellij-command-viewer.png) { width="350" }
10+
11+
## Command Validation
12+
13+
The Command Validation highlights any errors in your command methods and arguments and provides helpful suggestions to fix them.
14+
15+
### Missing Annotation
16+
17+
![intellij-command-validation-no-annotation.png](intellij-command-validation-no-annotation.png)
18+
19+
20+
### Primitive cannot be nullable
21+
22+
// TODO image
23+
24+
### Invalid route command
25+
26+
// TODO Image
27+
28+
## Legacy Annotations Migration
29+
30+
### 2.x -> 3.x
31+
- `@Permission`
32+
- `@Route` -> `@Command`
33+
- `@Section` -> `@Command`
34+
- `@Execute`
35+
- `@Arg`
36+
- `@Flag`
37+
- `@Joiner` -> `@Join`
38+
39+
// TODO Image

Writerside/topics/Introdution.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Introduction
1+
# What is LiteCommands?
22

33
<img alt="litecommands.png" src="litecommands.png" width="480"/>
44

Writerside/topics/adventure-platform.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Adventure Platform
1+
# Install (adventure-platform)
22

33
LiteCommands Adventure Platform is an extension for supporting Kyori Adventure features
44
for platforms that are doesn't have native support for it. E.g. Bukkit, BungeeCord, etc.

0 commit comments

Comments
 (0)