Troubleshooting
This page covers common issues you might encounter while using Flux-CLI and how to resolve them.
Configuration Issues
"No API key found"
Error:
Configuration Error: No API key found. Set API_KEY environment variableSolutions:
- Create a
.envfile withAPI_KEY=your-key - Run
python main.py configto use the setup wizard - Set the environment variable:
export API_KEY=your-key(Linux/macOS) orset API_KEY=your-key(Windows)
"Invalid TOML in config file"
Error:
Configuration Error: Invalid TOML in {path}: {details}Solutions:
- Check the syntax of your TOML file
- Use a TOML validator:
pip install toml-sort && toml-sort -c config.toml - Ensure all strings are properly quoted
Connection Issues
"Rate Limit Exceeded"
Error:
Rate Limit Exceeded: {details}Solutions:
- Wait and retry — the agent uses exponential backoff
- Check your provider's rate limits
- Consider upgrading your API plan
- Use a less popular model to avoid rate limits
"Connection Error"
Error:
Connection Error: {details}Solutions:
- Check your internet connection
- Verify the
BASE_URLis correct - Ensure the API endpoint is accessible
- Check firewall/proxy settings
Tool Issues
"Command blocked for safety"
Error:
Command blocked for safety: {command}Solutions:
- This is a safety feature — the command matched a dangerous pattern
- If you need to run this command, use the
yoloapproval policy - Consider using a safer alternative command
"File not found"
Error:
File not found: {path}Solutions:
- Check that the file path is correct
- Use
list_dirto explore the directory structure - Use absolute paths or paths relative to the working directory
"Path is outside working directory"
Error:
Path is outside working directory: {path}Solutions:
- This is a safety feature — the agent is restricted to the working directory
- Change the working directory with
--cwdflag - Explicitly approve the operation if it's safe
Performance Issues
"Maximum turns reached"
Error:
Maximum turns (100) reachedSolutions:
- Increase
max_turnsin the configuration - Break complex tasks into smaller steps
- Use more specific prompts to reduce iterations
- Check if the agent is stuck in a loop
"Command timed out"
Error:
Command timed out after {timeout}sSolutions:
- Increase the
timeoutparameter for the shell command - Check if the command is hanging indefinitely
- Use more efficient commands
Common Mistakes
"I forgot to activate the virtual environment"
Always activate your virtual environment before running Flux-CLI:
# Windows
.venv\Scripts\activate
# macOS/Linux
source .venv/bin/activate"I committed my API key"
Add .env to your .gitignore (it's already included by default):
# .gitignore
.env"The agent is not using the right model"
Check the current model with /config and switch with /model <name>:
❯ /config
❯ /model anthropic/claude-3.5-sonnetGetting Help
If you encounter issues not covered here: