CLI vs TUI Feature Parity Analysis
Date: 2025-12-10 Context: LLM-Driven Tool Selection Migration
Executive Summaryβ
CRITICAL FINDING: The CLI and TUI have completely different architectures for agent execution and tool handling.
Impact of Recent Changes:
- β
TUI: LLM-driven tool selection implemented (in
apps/tui/src/chat_executor.rs) - β CLI: Changes do NOT affect CLI (uses completely different code path)
Parity Status: ~60% (CLI lacks TUI's custom chat experience)
Architectural Comparisonβ
TUI Architectureβ
User Input (TUI Interface)
β
apps/tui/src/chat_executor.rs β OUR CHANGES ARE HERE
β
Custom tool implementation:
- Hardcoded tool list (get_chat_tools)
- Custom tool execution logic
- Terminal command execution with safety checks
- project_scan, search_files, read_file, etc.
β
Direct API calls to Claude/Gemini/OpenAI
β
Response rendering in TUI
Key File: apps/tui/src/chat_executor.rs (1,700+ lines)
- Custom tool registry
- Proactive execution logic (REMOVED in our changes)
- LLM-driven tool selection (ADDED in our changes)
- Terminal command safety modal
- Streaming response handling
CLI Architectureβ
User Input (stdin)
β
apps/cli/src/commands/chat.rs
β
apps/cli/src/commands/step.rs
β
radium-orchestrator crate
ββ Agent loader (reads TOML configs)
ββ Tool registry (orchestration/mod.rs)
ββ Model execution
β
Response printed to stdout
Key Files:
apps/cli/src/commands/chat.rs- REPL loopapps/cli/src/commands/step.rs- Agent executioncrates/radium-orchestrator/- Orchestration engine
Tool Handling:
- Uses radium-orchestrator's tool registry
- Tools defined in
crates/radium-orchestrator/src/orchestration/ - Follows agent TOML configuration
Feature Comparison Matrixβ
| Feature | TUI | CLI | Parity | Notes |
|---|---|---|---|---|
| Core Chat | β | β | 100% | Both support multi-turn conversation |
| Agent Selection | β Fixed (chat mode) | β Agent param | 0% | TUI is single-purpose, CLI is multi-agent |
| System Prompt | β chat-assistant.md | β Agent TOML | 100% | CLI can use same prompt via agent config |
| Tool Calling | β Custom impl | β Orchestrator | 80% | Different implementations, similar capability |
| LLM-Driven Selection | β NEW! | β οΈ Partial | 50% | TUI has it, CLI depends on orchestrator |
| project_scan | β Hardcoded | β Orchestrator | 90% | Both have it, different paths |
| search_files | β Hardcoded | β Orchestrator | 90% | Both have it |
| read_file | β Hardcoded | β Orchestrator | 90% | Both have it |
| list_directory | β Hardcoded | β Orchestrator | 90% | Both have it |
| grep | β Hardcoded | β Orchestrator | 90% | Both have it |
| git_log | β Hardcoded | β Orchestrator | 90% | Both have it |
| git_diff | β Hardcoded | β Orchestrator | 90% | Both have it |
| git_blame | β | β Orchestrator | 0% | Only in orchestrator |
| git_show | β | β Orchestrator | 0% | Only in orchestrator |
| find_references | β | β Orchestrator | 0% | Only in orchestrator |
| Terminal Commands | β With safety | β Via run_command | 80% | TUI has modal, CLI is direct |
| Command Safety Check | β Modal UI | β No check | 0% | TUI-specific feature |
| Streaming Responses | β | β | 100% | Both support streaming |
| Session History | β | β | 100% | Both save history |
| Context Files | β | β | 100% | Both load CLAUDE.md/GEMINI.md |
| MCP Integration | β | β | 0% | CLI has MCP slash commands |
| Analytics | β | β | 0% | CLI has session reports |
Overall Parity Score: ~60%
What This Means for LLM-Driven Tool Selectionβ
TUI (Our Changes Apply Here)β
Status: β Fully Implemented
The changes we just made affect the TUI:
- β Removed proactive scan gate
- β Enhanced system prompt (chat-assistant.md)
- β Improved tool descriptions
- β LLM now autonomously decides when to call tools
Testing: Use ./dist/target/debug/radium-tui to test
CLI (Our Changes DON'T Apply Here)β
Status: β οΈ Depends on Orchestrator Implementation
The CLI uses a completely different execution path:
- Reads agent config from TOML files
- Uses
radium-orchestratorcrate for tool execution - Tools are registered in
crates/radium-orchestrator/src/orchestration/
Question: Does the orchestrator already use LLM-driven tool selection?
Let me check the orchestrator implementation...
Orchestrator Tool Execution Analysisβ
File: crates/radium-orchestrator/src/orchestration/mod.rs
The orchestrator has:
- β Tool registry with schemas
- β Tool execution via ToolHandler trait
- β project_scan_tool.rs (already implemented)
- β git_extended_tools.rs (git_blame, git_show, find_references)
- β code_analysis_tool.rs
Architecture: The orchestrator already uses LLM-driven tool selection!
// Orchestrator exposes tools to the LLM via FunctionDeclarations
let tools = tool_registry.get_all_tools();
// LLM sees tools and decides which to call
// Orchestrator executes the chosen tools
Conclusion: The CLI already has LLM-driven tool selection via the orchestrator!
Key Architectural Differenceβ
TUI: Custom Chat Executor (Old Approach)β
Before our changes:
// apps/tui/src/chat_executor.rs
if question_type == ProjectOverview {
execute_proactive_scan() // β HARDCODED PATTERN MATCHING
}
After our changes:
// apps/tui/src/chat_executor.rs
// Prepend analysis plan, LLM sees tools and decides
// β LLM-DRIVEN SELECTION
Problem Solved: Removed brittle pattern matching
CLI: Orchestrator-Based (Already Correct)β
// CLI β step::execute β orchestrator
let tools = tool_registry.get_all_tools();
agent.execute_with_tools(tools); // β LLM-DRIVEN FROM THE START
Status: CLI was already using the correct architecture!
Why The Divergence?β
Looking at git history and code structure:
-
TUI was built first as a custom chat interface
- Custom tool execution logic
- Hardcoded tool list
- Pattern-based proactive execution
-
CLI was built later using the orchestrator
- Proper separation of concerns
- Agent-based architecture
- Tool registry abstraction
-
Result: Two completely different code paths
Parity Gapsβ
TUI Has (CLI Doesn't)β
-
Terminal Command Safety Modal
- TUI shows modal before executing dangerous commands
- CLI executes directly
-
Single-Purpose Chat Mode
- TUI is focused on chat only
- CLI is multi-purpose (agents, requirements, steps)
-
Custom Tool List
- TUI has hardcoded get_chat_tools()
- CLI uses tool registry
CLI Has (TUI Doesn't)β
-
Extended Git Tools
- git_blame
- git_show
- find_references
-
MCP Integration
- Slash commands from MCP servers
- Dynamic tool discovery
-
Session Analytics
- Token usage reports
- Session summaries
- Cost tracking
-
Agent Selection
- Can chat with any agent
- TUI is fixed to chat-assistant mode
Recommendationsβ
Short Term (Immediate)β
-
Document the Architecture Difference
- Users need to know TUI and CLI are different
- Set expectations about feature parity
-
Test Both Independently
- TUI test: Verify LLM-driven tool selection works
- CLI test: Verify orchestrator tools work with chat-assistant agent
-
Update Documentation
- Explain when to use TUI vs CLI
- Document tool availability in each
Medium Term (Next Sprint)β
-
Migrate TUI to Use Orchestrator
- Remove custom chat_executor tool logic
- Use radium-orchestrator tool registry
- Achieve architectural consistency
-
Add Missing Tools to TUI
- git_blame, git_show, find_references
- Use orchestrator implementations
-
Add TUI Features to CLI
- Command safety checks
- Interactive approval for dangerous commands
Long Term (Future)β
-
Unified Architecture
- Both TUI and CLI use orchestrator
- Single source of truth for tools
- Consistent behavior across interfaces
-
Feature Parity
- All tools available in both
- Same safety checks
- Same user experience (adapted to interface)
Testing Guideβ
Test TUI (With Our Changes)β
# Test LLM-driven tool selection
./dist/target/debug/radium-tui
# Query that should trigger project_scan
> Scan my project and tell me what it's about
# Expected:
# β
LLM calls project_scan("quick")
# β
Returns README, manifest, structure
# β Does NOT ask permission
Test CLI (With chat-assistant Agent)β
# First, verify ANTHROPIC_API_KEY is set (agent uses Claude)
echo $ANTHROPIC_API_KEY
# Start chat with chat-assistant agent
./dist/target/release/radium-cli chat chat-assistant
# Query that should trigger project_scan
> Scan my project and tell me what it's about
# Expected:
# β
LLM calls project_scan tool (via orchestrator)
# β
Returns comprehensive response
# β Should NOT ask permission (if orchestrator tools work correctly)
Test CLI with Gemini Agent (Alternative)β
If you want to test with Gemini instead of Claude:
- Create a Gemini-based chat agent:
# agents/test/chat-gemini.toml
[agent]
id = "chat-gemini"
name = "Chat Assistant (Gemini)"
description = "Interactive developer assistant with Gemini"
prompt_path = "prompts/agents/core/chat-assistant.md"
engine = "gemini"
model = "gemini-2.0-flash-exp"
reasoning_effort = "medium"
- Test:
GEMINI_API_KEY=<your-key> ./dist/target/release/radium-cli chat chat-gemini
> Scan my project
Conclusionβ
Current Stateβ
- TUI: β LLM-driven tool selection implemented (via our changes)
- CLI: β LLM-driven tool selection already existed (via orchestrator)
Parityβ
- Architecture: 0% (completely different implementations)
- Features: ~60% (CLI has more tools, TUI has better UX)
- Tool Calling: 90% (both work, different paths)
Next Stepsβ
- Test both independently to verify behavior
- Document the difference for users
- Consider migration of TUI to use orchestrator (future work)
Bottom Line:
Both TUI and CLI can do LLM-driven tool selection, but through completely different code paths. Our changes only affected the TUI. The CLI was already using the correct architecture via the orchestrator.
For true parity, we should eventually migrate the TUI to use the orchestrator's tool registry instead of maintaining a separate custom implementation.