This guide helps you diagnose and fix common issues with Rust TUI Coder.
- Installation Issues
- Configuration Problems
- API Connection Issues
- Tool Execution Errors
- UI/Display Problems
- Performance Issues
- Platform-Specific Issues
Problem: cargo install rust_tui_coder fails
Solutions:
-
Update Rust
rustup update stable
-
Check Rust version
rustc --version # Should be 1.70 or higher -
Clear cargo cache
rm -rf ~/.cargo/registry/index/* cargo install rust_tui_coder
Problem: Build fails during installation
Solutions:
-
Check system dependencies
# Ubuntu/Debian sudo apt-get install build-essential pkg-config libssl-dev # macOS xcode-select --install # Fedora sudo dnf install gcc openssl-devel
-
Use specific version
cargo install rust_tui_coder --version 1.0.0
-
Build from source
git clone https://github.com/yourusername/rust_tui_coder.git cd rust_tui_coder cargo build --release ./target/release/rct
Problem: Application can't find config.toml
Diagnostic:
# Check current directory
pwd
# List files
ls -la | grep configSolutions:
-
Create config file
cat > config.toml << EOF [llm] api_key = "your-api-key" api_base_url = "https://api.openai.com/v1" model_name = "gpt-4" EOF
-
Use example config
cp config_example.toml config.toml # Edit with your details nano config.toml -
Check file location
- Config must be in the directory where you run the app
- Or use environment variables instead
Problem: Config file has syntax errors
Diagnostic:
# Validate TOML
cat config.tomlCommon Issues:
-
Missing quotes
# Wrong api_key = sk-abc123 # Correct api_key = "sk-abc123"
-
Wrong section headers
# Wrong [LLM] # Correct [llm]
-
Extra characters
# Wrong api_key = "key", # Correct api_key = "key"
Solution:
# Minimal valid config
[llm]
api_key = "your-key-here"
api_base_url = "https://api.openai.com/v1"
model_name = "gpt-4"Problem: Config is missing a required field
Solution: Ensure all required fields are present:
[llm]
api_key = "required"
api_base_url = "required"
model_name = "required"
provider = "optional"Problem: API authentication fails
Diagnostic:
# Check API key format
cat config.toml | grep api_keySolutions:
-
OpenAI keys
- Should start with
sk- - Get from: https://platform.openai.com/api-keys
- Check for extra spaces or newlines
- Should start with
-
Anthropic keys
- Should start with
sk-ant- - Get from: https://console.anthropic.com/
- Should start with
-
Verify key is active
# Test OpenAI key curl https://api.openai.com/v1/models \ -H "Authorization: Bearer YOUR_API_KEY"
Problem: Can't connect to API server
Diagnostic:
# Test connectivity
ping api.openai.com
# Test API endpoint
curl -I https://api.openai.com/v1/modelsSolutions:
-
Check internet connection
ping google.com
-
Check firewall
- Ensure port 443 (HTTPS) is open
- Check corporate firewall/proxy
-
Verify API base URL
# OpenAI api_base_url = "https://api.openai.com/v1" # Anthropic api_base_url = "https://api.anthropic.com" # Local (Ollama) api_base_url = "http://localhost:11434/v1"
-
Use proxy (if needed)
export HTTPS_PROXY=http://proxy.company.com:8080 rct
Problem: Too many API requests
Solutions:
-
Wait and retry
- OpenAI: Wait 60 seconds
- Anthropic: Check your rate limits
-
Check your usage
- OpenAI: https://platform.openai.com/usage
- Anthropic: https://console.anthropic.com/
-
Use slower model
model_name = "gpt-3.5-turbo" # Instead of gpt-4
Problem: Specified model doesn't exist or you don't have access
Solutions:
-
Check model name spelling
# Correct model_name = "gpt-4" # Wrong model_name = "gpt4" model_name = "gpt-4-turbo" # Use correct model ID
-
Verify model access
- GPT-4: Requires paid OpenAI account
- Claude: Check Anthropic access
-
Use available model
# OpenAI (always available) model_name = "gpt-3.5-turbo" # Anthropic model_name = "claude-3-opus-20240229"
Problem: Can't read/write files
Diagnostic:
# Check file permissions
ls -la filename
# Check directory permissions
ls -la .Solutions:
-
Check ownership
# Make file writable chmod 644 filename # Make directory writable chmod 755 directory
-
Run with correct user
# Don't run as root unnecessarily whoami -
Check file locks
- Close other programs using the file
- Check for
.lockfiles
Problem: Required interpreter not installed
Diagnostic:
# Check if installed
python3 --version
node --version
ruby --versionSolutions:
-
Install missing interpreter
# Python sudo apt-get install python3 # Ubuntu brew install python3 # macOS # Node.js sudo apt-get install nodejs brew install node # Ruby sudo apt-get install ruby brew install ruby
-
Check PATH
echo $PATH which python3
Problem: Tool can't find specified file
Diagnostic:
# Check if file exists
ls -la path/to/file
# Check current directory
pwdSolutions:
-
Use correct path
- Relative paths:
src/main.rs - Absolute paths:
/home/user/project/src/main.rs
- Relative paths:
-
Create missing directories
mkdir -p path/to/directory
-
Check working directory
- App runs in the directory where you launched it
- Use
/statsto see current context
Symptoms:
- Strange characters:
^[[0m - Colors don't work
- Box drawing characters broken
Solutions:
-
Set TERM variable
export TERM=xterm-256color rct -
Use compatible terminal
- Good: iTerm2, GNOME Terminal, Alacritty, Windows Terminal
- Poor: Basic terminals, old terminal emulators
-
Check terminal capabilities
echo $TERM tput colors # Should show 256
Solutions:
-
Restart application
- Press
Ctrl+Cto quit - Launch again
- Press
-
Check terminal size
# Terminal should be at least 80x24 tput cols # Should be >= 80 tput lines # Should be >= 24
-
Resize terminal window
- Make it larger
- Restart app after resizing
Solutions:
-
Check input area
- Scroll to bottom with
Endkey - Input area is at the very bottom
- Scroll to bottom with
-
Clear screen
- Restart the application
- Check if other programs are interfering
Solutions:
-
Use correct keys
Up/Down: Line by linePgUp/PgDn: Page by pageHome/End: Top / Bottom
-
Check if conversation has content
- No scrolling if conversation is short
-
Focus on correct area
- Scrolling affects conversation area only
Diagnostic:
- Check usage with
/stats - Note: First request is always slower (cold start)
Solutions:
-
Check model
# Faster model_name = "gpt-3.5-turbo" # Slower but better model_name = "gpt-4"
-
Check network
# Test latency ping api.openai.com # Test speed curl -w "@curl-format.txt" -o /dev/null -s https://api.openai.com/v1/models
-
Use local model
# Install Ollama curl -fsSL https://ollama.com/install.sh | sh # Run a model ollama run codellama # Configure [llm] api_base_url = "http://localhost:11434/v1" model_name = "codellama"
Diagnostic:
# Check memory
top | grep rctSolutions:
-
Restart application periodically
- Long conversations use more memory
- Quit and restart to clear
-
Limit conversation length
- Keep interactions focused
- Start new sessions for new tasks
Diagnostic:
- Check error message
- Look for panic messages
Solutions:
-
Update to latest version
cargo install rust_tui_coder --force
-
Check logs
# Run with backtrace RUST_BACKTRACE=1 rct -
Report bug
- Create GitHub issue with:
- Error message
- Steps to reproduce
- System information
- Create GitHub issue with:
Problem: "Cannot open shared object file"
Solution:
# Install missing libraries
sudo apt-get install libssl-dev pkg-configProblem: Terminal colors don't work
Solution:
# Install 256-color support
sudo apt-get install ncurses-term
export TERM=xterm-256colorProblem: "xcrun: error: invalid active developer path"
Solution:
xcode-select --installProblem: OpenSSL linking errors
Solution:
brew install openssl
export OPENSSL_DIR=$(brew --prefix openssl)
cargo build --releaseProblem: PowerShell execution policy
Solution:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUserProblem: ANSI colors not working
Solution:
- Use Windows Terminal (not cmd.exe)
- Enable ANSI colors:
Set-ItemProperty HKCU:\Console VirtualTerminalLevel -Type DWORD 1
Problem: Git commands don't work
Solution:
- Install Git for Windows
- Ensure git.exe is in PATH
# Run with verbose output
RUST_LOG=debug rct
# Or with backtrace
RUST_BACKTRACE=full rct# OpenAI
curl https://api.openai.com/v1/models \
-H "Authorization: Bearer YOUR_API_KEY"
# Anthropic
curl https://api.anthropic.com/v1/messages \
-H "x-api-key: YOUR_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{
"model": "claude-3-opus-20240229",
"max_tokens": 1024,
"messages": [{"role": "user", "content": "Hello"}]
}'# Check installed version
cargo install --list | grep rust_tui_coder
# Verify binary
which rct
rct --version # If version flag is implementedIf you're still experiencing issues:
-
Check documentation
- README.md - General information
- GETTING_STARTED.md - Setup guide
- API.md - API reference
-
Search existing issues
- Check GitHub issues for similar problems
- See if solution already exists
-
Create an issue
- Provide detailed information:
- Operating system and version
- Rust version (
rustc --version) - Application version
- Configuration (remove API key!)
- Complete error message
- Steps to reproduce
- Use the bug report template
- Provide detailed information:
-
Community help
- Join discussions on GitHub
- Ask in community forums
Problem: Files aren't where you expect
Solution: Application runs in the directory where you launch it
cd /path/to/your/project
rctProblem: Copy-paste added spaces or newlines
Solution: Check carefully
# Wrong - has space at end
api_key = "sk-abc123 "
# Correct
api_key = "sk-abc123"Problem: GPT-4 can take 10-30 seconds to respond
Solution: This is normal! GPT-4 is slower but more capable
Problem: String values without quotes
Solution: Always quote strings in TOML
model_name = "gpt-4" # Not: model_name = gpt-4Still need help? Open an issue on GitHub with detailed information!