CLI Troubleshooting
This guide helps you diagnose and resolve common issues with . Follow the systematic approach to identify and fix problems.
Quick Diagnosis​
System Health Check​
Run the comprehensive health check first:
# Start and run:
system-info
This command shows:
- Environment variables status
- Configuration file validity
- API key configuration
- Agent and tool availability
- Overall health score
LLM Provider Status​
Check LLM provider configuration:
# Start and run:
llm-status
This shows:
- Available providers
- API key status (masked)
- Default provider
- Fallback chain configuration
Configuration Issues​
Configuration File Problems​
Invalid JSON Syntax​
Symptoms:
- Configuration loading errors
- CLI fails to start
Diagnosis:
# Start spoon-cli and run:
validate-config
Solutions:
- Check JSON syntax with online validator
- Ensure proper quoting of strings
- Validate file encoding (should be UTF-8)
Configuration Not Loading​
Symptoms:
- Settings not applied
- Default values used instead
Diagnosis:
# Check if config file exists and is readable
ls -la config.json
# Start spoon-cli and run:
check-config
Solutions:
- Ensure
config.jsonis in current directory or~/.spoon/config.json - Check file permissions:
chmod 644 config.json - Validate JSON format
Environment Variable Issues​
API Keys Not Recognized​
Symptoms:
- LLM provider unavailable
- Authentication errors
Diagnosis:
# Check environment variables
env | grep -E "(OPENAI|ANTHROPIC|DEEPSEEK)"
# Test specific provider
llm-status
Solutions:
-
Set environment variables correctly:
export OPENAI_API_KEY="sk-your-key-here"
export ANTHROPIC_API_KEY="sk-ant-your-key-here" -
Use
.envfile for persistent configuration:echo "OPENAI_API_KEY=sk-your-key-here" > .env -
Restart shell or reload environment
Migration Issues​
Legacy Configuration Detected​
Symptoms:
- Migration warnings
- Some features not working
Diagnosis:
# Start spoon-cli and run:
check-config
Solutions:
# Preview migration
# Start spoon-cli and run:
migrate-config --dry-run
# Perform migration
# Start spoon-cli and run:
migrate-config
# Validate after migration
# Start spoon-cli and run:
validate-config
Agent Loading Issues​
Agent Not Found​
Symptoms:
- "Agent not found" error
- Cannot load specific agent
Diagnosis:
# Start spoon-cli and run:
# List available agents
list-agents
# Check configuration
config agents
Solutions:
- Verify agent name in configuration
- Check agent class name is correct
- Ensure required dependencies are installed
Tool Loading Failures​
Symptoms:
- Tools not available after loading
- Agent lacks expected capabilities
Diagnosis:
# Start spoon-cli and run:
# Check tool loading status
tool-status
# List available toolkits
list-toolkit-categories
Solutions:
- Reload agent configuration:
Start spoon-cli and run:
reload-config
2. Reinstall toolkits:
```bash
pip install --upgrade spoon-toolkits
- Check network connectivity for external tools
Network and Connectivity Issues​
MCP Server Connection Problems​
Symptoms:
- MCP tools unavailable
- Server connection timeouts
Diagnosis:
# Start spoon-cli and run:
# Validate MCP configuration
validate-config --check-servers
# Test specific server
# Start spoon-cli and run:
load-agent mcp_agent
Solutions:
-
Verify server commands are installed:
which npx
which uvx -
Check server environment variables
-
Update server configurations in
config.json
API Rate Limiting​
Symptoms:
- Requests failing with rate limit errors
- Intermittent connectivity issues
Solutions:
-
Implement request throttling:
{
"llm": {
"rate_limiting": {
"requests_per_minute": 30,
"burst_limit": 5
}
}
} -
Switch to different provider temporarily
-
Upgrade API plan for higher limits
Performance Issues​
Slow Startup​
Symptoms:
- CLI takes long time to start
- Agent loading is slow
Diagnosis:
# Enable profiling
export SPOON_CLI_PROFILE=1
system-info
Solutions:
- Load fewer tools initially
- Use faster LLM providers
- Enable caching:
{
"llm": {
"caching": {
"enabled": true,
"ttl": 3600
}
}
}
High Memory Usage​
Symptoms:
- System running out of memory
- Performance degradation
Solutions:
-
Reduce chat history size:
{
"memory": {
"max_chat_history": 50,
"compress_old_messages": true
}
} -
Enable memory cleanup:
{
"memory": {
"cleanup_temp_files": true,
"auto_save_interval": 300
}
}
Slow Response Times​
Diagnosis:
# Start spoon-cli and run:
# Check LLM provider status
llm-status
# Test response time
time spoon-cli action chat <<< "Hello"
Solutions:
-
Switch to faster models
-
Adjust timeout settings:
{
"llm": {
"timeout": 60,
"retry_attempts": 2
}
} -
Enable response streaming for better perceived performance
Installation Issues​
Import Errors​
Symptoms:
- "Module not found" errors
- CLI fails to start
Diagnosis:
# Check Python path
python -c "import spoon_ai; print(spoon_ai.__file__)"
# Verify installation
pip list | grep spoon
Solutions:
- Reinstall packages:
pip uninstall spoon-ai-sdk spoon-toolkits
pip install ``` - Check Python version compatibility
- Use virtual environment to avoid conflicts
Permission Issues​
Symptoms:
- Cannot write configuration files
- Installation fails
Solutions:
- Use user installation:
pip install --user ``` - Fix directory permissions:
chmod 755 ~/.spoon/
chmod 644 ~/.spoon/config.json
Platform-Specific Issues​
Windows Issues​
Command Prompt Problems​
Symptoms:
- Interactive features not working
- Display issues
Solutions:
- Use PowerShell instead of CMD
- Install Windows Terminal
- Enable ANSI color support
Path Issues​
Solutions:
- Add Python to PATH during installation
- Use absolute paths in configuration
- Avoid spaces in installation paths
macOS Issues​
SIP (System Integrity Protection)​
Solutions:
- Install in user directory:
pip install --user ``` - Use Homebrew for Python:
brew install python
Linux Issues​
Shared Library Problems​
Diagnosis:
ldd $(which python) | grep "not found"
Solutions:
- Install missing system libraries
- Use system package manager:
# Ubuntu/Debian
sudo apt-get install python3-dev build-essential
# CentOS/RHEL
sudo yum install python3-devel gcc
Debugging Techniques​
Enable Debug Mode​
# Enable debug logging
export SPOON_CLI_DEBUG=1
# Or use flag
--debug system-info
Log Analysis​
# Check log files
tail -f spoon_cli.log
# Increase log verbosity
export SPOON_CLI_LOG_LEVEL=DEBUG
Network Debugging​
# Test network connectivity
curl -I https://api.openai.com/v1/models
# Check proxy settings
env | grep -i proxy
Configuration Debugging​
# Show full configuration with debug
--debug config
# Validate with detailed output
validate-config --verbose
Common Error Messages​
"Configuration validation failed"​
Cause: Invalid configuration syntax or missing required fields
Solution:
validate-config
# Fix reported issues
reload-config
"Agent class not found"​
Cause: Invalid agent class name in configuration
Solution:
- Check class name spelling
- Ensure correct module imports
- Update to valid class names
"Tool loading failed"​
Cause: Tool dependencies not available
Solution:
pip install --upgrade spoon-toolkits
reload-config
"MCP server connection timeout"​
Cause: Network issues or server configuration problems
Solution:
validate-config --check-servers
# Fix server configurations
reload-config
Getting Help​
Community Resources​
- GitHub Issues: Report bugs and request features
- Documentation: Check the full documentation
- Discord/Forum: Community discussions
Debug Information Collection​
When reporting issues, include:
# System information
system-info
# Configuration (mask sensitive data)
config
# Error logs
tail -n 50 spoon_cli.log
# Python environment
python --version
pip list | grep spoon
Preventive Maintenance​
Regular Updates​
# Update CLI and dependencies
pip install --upgrade spoon-ai-sdk spoon-toolkits
# Update configuration if needed
migrate-config
Configuration Backup​
# Backup configuration
cp config.json config.json.backup
# Backup environment
env | grep SPOON > spoon_env.backup
Health Monitoring​
# Regular health checks
system-info
# Monitor for issues
validate-config
Emergency Recovery​
Reset Configuration​
# Remove corrupted config
rm config.json
# Start with minimal config
echo '{"default_agent": "react"}' > config.json
# Test basic functionality
list-agents
Clean Reinstall​
# Complete cleanup
pip uninstall spoon-ai-sdk spoon-toolkits
rm -rf ~/.spoon/
rm -rf chat_logs/
# Fresh install
pip install
# Basic setup
config api_key openai "your-key"
Next Steps​
- Installation - Reinstall if needed
- Configuration - Review configuration options
- Basic Usage - Verify basic functionality works