Chat Commands

An enhanced chat interface system that transforms traditional text conversations into structured, command-driven interactions. Enables precise agent delegation and tool execution.

Chat Commands Preview

Installation

hax init
hax add composer chat-commands

Component Setup

import { CommandRegistryProvider, useChatCommands, CommandSuggestions } from "@/hax/composer/chat-commands";

export function EnhancedChat() {
  const { commandType, showSuggestions, detectCommand } = useChatCommands();

  return (
    <CommandRegistryProvider>
      <div className="chat-interface">
        <textarea onChange={(e) => detectCommand(e.target.value, e.target.selectionStart)} />
        <CommandSuggestions showSuggestions={showSuggestions} commandType={commandType} />
      </div>
    </CommandRegistryProvider>
  );
}