Module agent

Module agent 

Source
Expand description

Agent module for interactive AI-powered CLI assistance

This module provides an agent layer using the Rig library that allows users to interact with the CLI through natural language conversations.

§Features

  • Conversation History: Maintains context across multiple turns
  • Automatic Compaction: Compresses old history when token count exceeds threshold
  • Tool Tracking: Records tool calls for better context preservation

§Usage

# Interactive mode
sync-ctl chat

# With specific provider
sync-ctl chat --provider openai --model gpt-5.2

# Single query
sync-ctl chat --query "What security issues does this project have?"

§Interactive Commands

  • /model - Switch to a different AI model
  • /provider - Switch provider (prompts for API key if needed)
  • /help - Show available commands
  • /clear - Clear conversation history
  • /exit - Exit the chat

Modules§

commands
Slash command definitions and interactive command picker
history
Conversation history management with compaction support
prompts
Embedded prompts for the Syncable agent
session
Interactive chat session with /model and /provider commands
tools
Agent tools using Rig’s Tool trait
ui
Terminal UI module for agent interactions

Enums§

AgentError
Error types for the agent
ProviderType
Provider type for the agent

Functions§

run_interactive
Run the agent in interactive mode with custom REPL supporting /model and /provider commands
run_query
Run a single query and return the response

Type Aliases§

AgentResult