


This mod is a chat enhancement mod with the following features:
Default key: Press Y to open chat
Commands: Start with /
Help: /help to view available commands
AI Chat: /ai HI - Chat with AI (local display only)
Translation: /ai translate 你好 - Translate to English, then @send to broadcast the AI response
Command Learning: /ai how to use this cmd: whisper @whisper - Learn how to use commands (useful for foreign language commands)
Position: /pos T / R / C - Change chat window position (Top/Right/Center)
Note: While typing, you can freely click on text to copy content
' s New in 1.2.0 (vs 1.1.5)
I completely abandoned the old UI system and switched to Unity ' s latest UXML/USS system, solving these issues:
Here ' s how to customize the chat appearance:
Open the Unity Project
unity folder in this projectLocate the UI Files
.uxml filesCustomize Styles
Build the Bundle
Window → Asset Management → Addressables → Groups → BuildDeploy the Bundle
unity project / Libraries / com.unity.addressables / aa / standalonewindows64 /PeakChatOpsUI.peakbundleHere
'
s how to create your own commands. Example: Echo.cs
using System;
using PeakChatOps.API;
using Cysharp.Threading.Tasks;
using PeakChatOps.Core;
#nullable enable
namespace PeakChatOps.Commands;
[PCOCommand("echo", "Echo input content", "Usage: /echo <content>\nReturns your input as-is.")]
public class EchoCommand
{
// New message-driven handler signature. Plugins/commands register handlers
// on EventBusRegistry.CmdMessageBus with channel "cmd://echo".
public EchoCommand()
{
EventBusRegistry.CmdMessageBus.Subscribe("cmd://echo", Handle);
DevLog.UI("[Cmd] EchoCommand subscribed to cmd://echo");
}
public static async UniTask Handle(CmdMessageEvent evt)
{
try
{
var args = evt.Args ?? Array.Empty<string>();
var res = args.Length == 0 ? "Please enter content to echo." : string.Join(" ", args);
var resultEvt = new CmdExecResultEvent(evt.Command, evt.Args ?? Array.Empty<string>(), evt.UserId, stdout: res, stderr: null, success: true);
await EventBusRegistry.CmdExecResultBus.Publish("cmd://", resultEvt);
}
catch (Exception ex)
{
var errEvt = new CmdExecResultEvent(evt.Command, evt.Args ?? Array.Empty<string>(), evt.UserId, stdout: null, stderr: ex.Message, success: false);
await EventBusRegistry.CmdExecResultBus.Publish("cmd://", errEvt);
}
await UniTask.CompletedTask;
}
}
API Key is securely stored locally. You can use it with confidence. If you have concerns, it is recommended to use the cloud model provided by ollama.
dotnet build -c Release -target:PackTS -v d
For questions or suggestions, feel free to open an issue or PR!