Skip to main content

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
compact
Context compaction module (forge-inspired)
history
Conversation history management with forge-style compaction support
ide
IDE Integration Module
persistence
Session persistence for conversation history
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

Structs§

AgentState
Agent state for AG-UI state synchronization
ConversationState
Conversation state for AG-UI
TokenUsageState
Token usage state for AG-UI

Enums§

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

Functions§

run_agent_server
Run the agent as a dedicated AG-UI server (headless mode for containers/deployments).
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 Note: event_bridge is accepted for API consistency but not used in single-query mode

Type Aliases§

AgentResult