Troubleshooting¶
Common issues and how to fix them.
Installation Issues¶
command not found: wtf¶
Problem: Shell can't find wtf after installation.
Solutions:
-
Restart your shell:
-
Check if installed:
-
Install in user mode:
-
Check PATH:
Name collision with existing wtf command¶
Problem: You already have a wtf command or alias.
Solutions:
The installer detects collisions automatically. If you see a warning:
⚠ Name collision detected!
'wtf' is already defined in ~/.zshrc
Would you like to:
1. Use 'wtfai' instead
2. Use 'wai' instead
3. Choose custom name
4. Cancel installation
Pick an alternative, or manually resolve:
# Option 1: Remove old alias
vim ~/.zshrc # Remove old 'alias wtf=...'
# Option 2: Install with different name
pip install wtf-ai
ln -s $(which wtf) ~/bin/wai
API Issues¶
Invalid API key¶
Problem: wtf can't authenticate with AI provider.
Solutions:
-
Re-run setup:
-
Check environment variables:
-
Set manually:
-
Get a new key:
- Anthropic: https://console.anthropic.com/settings/keys
- OpenAI: https://platform.openai.com/api-keys
- Google: https://makersuite.google.com/app/apikey
Rate limit exceeded¶
Problem: Too many requests to AI API.
Solutions:
- Wait a bit - Limits reset over time
- Upgrade your API plan - Free tiers have lower limits
- Switch providers temporarily:
Network error¶
Problem: Can't reach AI service.
Solutions:
-
Check internet connection:
-
Check service status:
- Anthropic: https://status.anthropic.com
-
OpenAI: https://status.openai.com
-
Try different provider:
-
Check proxy settings if behind corporate firewall
Permission Issues¶
Commands always ask for permission¶
Problem: wtf asks every time even after saying "yes always".
Solutions:
-
Check allowlist file exists:
-
Verify pattern was added:
-
Add manually:
wtf won't run safe commands¶
Problem: Even git status asks for permission.
Cause: Command might be chained or have redirection.
Solutions:
- Check command isn't chained:
git status && other(will ask) - Check no redirection:
git status > file(will ask) - Single commands should auto-execute:
git status(won't ask)
Shell History Issues¶
wtf says "No shell history available"¶
Problem: Can't access your command history.
Solutions:
-
Check history is enabled:
-
Enable history:
-
Check file permissions:
-
Restart shell after changes:
Memory Issues¶
wtf forgets things I told it¶
Problem: Memories not persisting.
Solutions:
-
Check memories file:
-
Verify save worked:
-
Check file permissions:
-
Manually fix broken file:
Hook Issues¶
Error hook not triggering¶
Problem: Installed error hook but nothing happens on failures.
Solutions:
-
Source your shell config:
-
Verify hook was added:
-
Re-install hook:
-
Check shell compatibility - Hooks work in zsh, bash, fish
Performance Issues¶
wtf is slow¶
Problem: Takes a long time to respond.
Causes & Solutions:
-
Slow AI provider - Try different model:
-
Large context - Reduce history size:
-
Network latency - Check connection quality
-
Large git repo - git status might be slow
Security¶
Is it safe to give wtf my API key?¶
Yes. Your API key is stored locally in ~/.config/wtf/config.json (mode 600).
It's never sent anywhere except to the AI provider you chose.
Best practices:
1. Use API keys with spending limits
2. Don't commit config.json to git (it's in .gitignore)
3. Rotate keys periodically
4. Use separate keys for different tools
Can wtf run dangerous commands?¶
Mostly no, but be careful.
Built-in protections:
- Denylist blocks dangerous patterns (rm -rf /, dd, etc.)
- Permission prompts for non-safe commands
- Safe readonly commands auto-execute
You can override: - Allowlist can permit anything (be careful!) - You can say "yes" to prompts
Best practices: 1. Review commands before saying yes 2. Don't allowlist destructive commands 3. Use denylist for commands you never want 4. Read command explanations
Still Stuck?¶
-
Check logs:
-
Reset config:
-
Report bug: https://github.com/davefowler/wtf-terminal-ai/issues
Include:
- Python version: python --version
- wtf version: wtf --version
- Shell: echo $SHELL
- OS: uname -a
- Error message and steps to reproduce