Files
Luna/Documentation/Luna AI Assistant/Channels/CLI Channel.md
T
darman 9929941748 Add project documentation and reference materials
Include Luna AI Assistant design docs covering channels, configuration,
core architecture, memory, scheduler, and skills. Add reference docs
from OpenClaw and ZeroClaw projects, plus Mistral and OpenAI API specs.
2026-04-04 04:14:06 +02:00

1.1 KiB

CLI Channel

The CLI connects to Luna via SignalR. CliChannel is a server-side adapter that bridges the SignalR hub to the IChannel interface defined in Channels.

How It Works

CliChannel wraps IChatHubContext from Core to send streaming responses back to the connected SignalR client. The flow:

  1. The ChatHub receives a message from the CLI client over SignalR.
  2. ChatHub calls RaiseMessageReceived on the CliChannel instance.
  3. The Channels picks up the event and routes it through SessionManager.RouteMessagesAsync.
  4. The resulting IAsyncEnumerable<ChatStreamUpdate> is passed back to CliChannel.SendStreamingMessageAsync.
  5. CliChannel forwards the stream to the SignalR client via IChatHubContext.

Key Characteristics

  • Server-side adapter: CliChannel lives on the server; the actual CLI is a separate SignalR client.
  • Single connection: One CliChannel instance maps to the SignalR hub connection.
  • No polling: Unlike Telegram Channel, the CLI uses persistent WebSocket connections via SignalR.

Namespace

Luna.Channels.Cli