# 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|ChannelManager]] picks up the event and routes it through `SessionManager.RouteMessagesAsync`. 4. The resulting `IAsyncEnumerable` 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`