-
Notifications
You must be signed in to change notification settings - Fork 0
TUI Interface
Master the RiceCoder Terminal User Interface for efficient code generation and chat interactions.
Status: ✅ Complete
Last Updated: December 3, 2025
The RiceCoder TUI (Terminal User Interface) provides an interactive chat-like experience for code generation, analysis, and conversation. It's designed for developers who prefer working in the terminal and want a responsive, keyboard-driven interface.
- Chat-based interaction: Ask questions and get responses in a conversational format
- Real-time streaming: See AI responses appear in real-time as they're generated
- Multiple modes: Switch between different interaction modes (ask, code, vibe)
- Session persistence: Your conversations are saved and can be resumed
- Keyboard-driven: Navigate and interact entirely with the keyboard
- Syntax highlighting: Code blocks are highlighted for readability
rice chatThis starts the interactive TUI with your configured AI provider.
# Use OpenAI
rice chat --provider openai
# Use local Ollama
rice chat --provider ollama
# Use Anthropic
rice chat --provider anthropicrice chat --model gpt-4
rice chat --model claude-3-opus
rice chat --model mistralPress Ctrl+C to exit the chat at any time. Your conversation is automatically saved.
The TUI is organized into several sections:
┌─────────────────────────────────────────────────────────────┐
│ RiceCoder Chat - Session: default [1/10] │
├─────────────────────────────────────────────────────────────┤
│ │
│ > What's the best way to structure a Rust project? │
│ │
│ RiceCoder: │
│ Here are the key principles for structuring a Rust project: │
│ │
│ 1. Separate concerns into modules │
│ 2. Use meaningful names │
│ 3. Keep modules focused │
│ │
├─────────────────────────────────────────────────────────────┤
│ r[ > │
│ Type your message and press Enter to send │
└─────────────────────────────────────────────────────────────┘
- Header: Shows session name and message count
- Message Area: Displays conversation history with syntax highlighting
- Input Area: Where you type your messages
- Status Bar: Shows helpful hints and keyboard shortcuts
Navigate through your conversation history:
| Key | Action |
|---|---|
↑ / ↓
|
Scroll up/down one line |
Page Up |
Scroll up one screen |
Page Down |
Scroll down one screen |
Home |
Jump to beginning of conversation |
End |
Jump to end of conversation |
Copy text from the conversation:
| Key | Action |
|---|---|
Shift+↑ / Shift+↓
|
Select text line by line |
Shift+Page Up |
Select screen by screen |
Shift+Page Down |
Select screen by screen |
Ctrl+C |
Copy selected text (or exit if nothing selected) |
Move between messages:
| Key | Action |
|---|---|
Ctrl+P |
Previous message |
Ctrl+N |
Next message |
Ctrl+Home |
First message |
Ctrl+End |
Last message |
| Key | Action |
|---|---|
Enter |
Send message |
Shift+Enter |
New line in message |
Ctrl+A |
Move to start of line |
Ctrl+E |
Move to end of line |
Ctrl+U |
Clear line |
Ctrl+W |
Delete word |
Backspace |
Delete character |
Delete |
Delete character forward |
| Key | Action |
|---|---|
↑ (in input) |
Previous message from history |
↓ (in input) |
Next message from history |
Ctrl+R |
Search message history |
Ctrl+L |
Clear screen |
| Key | Action |
|---|---|
Ctrl+S |
Save current session |
Ctrl+O |
Open session |
Ctrl+N |
New session |
Ctrl+D |
Delete session |
| Key | Action |
|---|---|
/ask |
Switch to Ask mode |
/code |
Switch to Code mode |
/vibe |
Switch to Vibe mode |
Ctrl+M |
Show mode menu |
| Key | Action |
|---|---|
Ctrl+C |
Exit TUI |
Ctrl+H |
Show help |
Ctrl+? |
Show keyboard shortcuts |
/help |
Show command help |
RiceCoder supports different interaction modes optimized for different tasks.
General-purpose conversation and questions.
/askBest for:
- Asking questions about code
- Getting explanations
- Brainstorming ideas
- General conversation
Example:
r[ > /ask
r[ > How do I implement error handling in Rust?
Focused on code generation and analysis.
/codeBest for:
- Generating code
- Analyzing existing code
- Refactoring suggestions
- Code review
Example:
r[ > /code
r[ > Generate a function to parse JSON
Creative and exploratory mode.
/vibeBest for:
- Exploring ideas
- Creative writing
- Brainstorming
- Experimental features
Example:
r[ > /vibe
r[ > What would a futuristic CLI tool look like?
Switch modes at any time:
r[ > /ask
r[ > /code
r[ > /vibeOr use the keyboard shortcut:
Ctrl+M # Show mode menuSessions save your conversation history and can be resumed later.
Sessions are created automatically when you start the TUI:
rice chat
# Creates default sessionCreate a named session:
rice chat --session my-projectrice session listOutput:
Sessions:
default (10 messages, last used 2 hours ago)
my-project (25 messages, last used 1 day ago)
experiments (5 messages, last used 1 week ago)
In the TUI:
/session switch my-projectOr from the command line:
rice chat --session my-projectSessions are automatically saved. To manually save:
Ctrl+Srice session delete my-projectOr in the TUI:
/session delete my-projectExport a session to a file:
rice session export my-project > my-project.txtFor longer messages, use Shift+Enter for new lines:
r[ > This is a long message
r[ > that spans multiple lines
r[ > and is easier to readFind previous messages quickly:
Ctrl+R
# Type to searchSelect and copy code from responses:
Shift+↑/↓ # Select text
Ctrl+C # CopyDefine custom shortcuts in .agent/config.yaml:
shortcuts:
test: /code Generate a test for this function
review: /code Review this code for issues
explain: /ask Explain this codeThen use them:
r[ > /testUse shell pipes to send file contents:
cat src/main.rs | rice chatProcess multiple files:
for file in src/*.rs; do
echo "=== $file ===" | rice chat
cat "$file" | rice chat
doneChange the TUI theme:
rice config set theme dracula
rice config set theme nord
rice config set theme solarizedAvailable themes:
-
dracula- Dark theme with vibrant colors -
nord- Arctic, north-bluish color palette -
solarized- Precision colors for machines and people -
monokai- Dark theme with bright accents -
gruvbox- Retro groove color scheme
Customize keyboard bindings in .agent/config.yaml:
keybindings:
send-message: Enter
new-line: Shift+Enter
clear-screen: Ctrl+L
exit: Ctrl+CConfigure how often sessions are saved:
session:
auto-save-interval: 30s
max-history: 1000Control how responses are streamed:
streaming:
enabled: true
chunk-size: 50
delay-ms: 10Solution: Check your configuration:
rice config showEnsure you have:
- A valid API key configured
- A valid provider configured
- Network connectivity
Solution: Check your network and provider:
# Test with a local model
rice chat --provider ollama
# Check API status
rice infoSolution: Resize your terminal window:
# Make terminal larger
# Or use a different terminal emulatorSolution: Check your terminal's clipboard support:
# Try using your terminal's native copy/paste
# Or configure clipboard in .agent/config.yamlSolution: Check file permissions:
ls -la ~/.ricecoder/sessions/
chmod 755 ~/.ricecoder/sessions/Solution: Ensure you're using the correct syntax:
# Correct
/ask
/code
/vibe
# Incorrect
ask
code
vibeSolution: Check your terminal's key handling:
# Some terminals don't support all key combinations
# Try a different terminal emulator
# Or reconfigure keybindings in .agent/config.yamlSolution: Check your terminal's color support:
# Enable 256-color support
export TERM=xterm-256color
# Or change theme
rice config set theme monokaiConfigure TUI behavior in .agent/config.yaml:
tui:
# Display settings
theme: dracula
font-size: 12
line-height: 1.5
# Behavior settings
auto-scroll: true
word-wrap: true
syntax-highlight: true
# Session settings
auto-save: true
auto-save-interval: 30s
max-history: 1000
# Streaming settings
streaming: true
chunk-size: 50
delay-ms: 10Customize keyboard shortcuts:
keybindings:
send-message: Enter
new-line: Shift+Enter
clear-screen: Ctrl+L
exit: Ctrl+C
scroll-up: Page Up
scroll-down: Page Down
previous-message: Ctrl+P
next-message: Ctrl+N
search-history: Ctrl+RCreate a custom theme:
themes:
my-theme:
background: "#1e1e1e"
foreground: "#d4d4d4"
primary: "#007acc"
secondary: "#ce9178"
error: "#f48771"
success: "#6a9955"Enable screen reader support:
rice config set accessibility.screen-reader trueUse high contrast theme:
rice config set theme high-contrastAll features are accessible via keyboard. No mouse required.
Adjust font size:
rice config set tui.font-size 14For sessions with many messages:
session:
max-history: 500 # Limit history
auto-save-interval: 60s # Save less frequently
compress-old-messages: true # Compress old messagestui:
streaming:
chunk-size: 25 # Smaller chunks
delay-ms: 20 # Longer delaytui:
auto-scroll: false # Disable auto-scroll
syntax-highlight: false # Disable highlighting- Quick Start Guide - Get started with RiceCoder
- Configuration Guide - Configure RiceCoder
- CLI Commands - Learn all CLI commands
- Troubleshooting Guide - Solve common problems
- FAQ - Frequently asked questions
Last updated: December 3, 2025