Configuration
oops can be configured via a TOML config file or environment variables. Configuration is optional—oops works out of the box with sensible defaults.
Config File
Create a configuration file at ~/.config/oops/config.toml:
# ~/.config/oops/config.toml
# Enable all rules (default)
rules = ["ALL"]
# Disable specific rules
exclude_rules = []
# Require confirmation before executing (default: true)
require_confirmation = true
# Command timeout in seconds
wait_command = 3
wait_slow_command = 15
# Disable colored output
no_colors = false
# Number of suggestions to show
num_close_matches = 3
# Commands that take longer to run
slow_commands = ["lein", "react-native", "gradle", "vagrant"]
Configuration Options
rules
List of enabled rules. Use ["ALL"] to enable all rules, or specify individual rules:
# Enable all rules
rules = ["ALL"]
# Or enable specific rules only
rules = ["git_push", "sudo", "cd_mkdir"]
exclude_rules
List of rules to disable, even if they would otherwise be enabled:
exclude_rules = ["git_push_force", "rm_root"]
require_confirmation
Whether to show a confirmation prompt before executing corrections:
# Ask before running (default)
require_confirmation = true
# Auto-execute first suggestion
require_confirmation = false
wait_command
Timeout in seconds for commands to complete before capturing output:
wait_command = 3
wait_slow_command
Timeout for commands in the slow_commands list:
wait_slow_command = 15
no_colors
Disable colored terminal output:
no_colors = false
num_close_matches
Maximum number of suggestions to show:
num_close_matches = 3
slow_commands
Commands that need more time to execute:
slow_commands = ["lein", "react-native", "gradle", "vagrant", "docker-compose"]
Environment Variables
All settings can be overridden with environment variables (same names as thefuck for compatibility):
| Variable | Description | Example |
|---|---|---|
THEFUCK_RULES |
Colon-separated list of enabled rules | sudo:git_push |
THEFUCK_EXCLUDE_RULES |
Rules to disable | rm_root:git_push_force |
THEFUCK_REQUIRE_CONFIRMATION |
Require confirmation | true or false |
THEFUCK_WAIT_COMMAND |
Command timeout | 5 |
THEFUCK_NO_COLORS |
Disable colors | true |
THEFUCK_DEBUG |
Enable debug output | true |
TF_SHELL |
Override detected shell | zsh |
TF_ALIAS |
Custom alias name | fuck |
Example
# Disable confirmation and specific rules
export THEFUCK_REQUIRE_CONFIRMATION=false
export THEFUCK_EXCLUDE_RULES="rm_root:git_push_force"
Configuration Priority
Settings are loaded in this order (later overrides earlier):
- Built-in defaults
- Config file (
~/.config/oops/config.toml) - Environment variables
Debugging
Enable debug mode to see which rules are matching:
export THEFUCK_DEBUG=true
oops
Or use the debug flag directly:
oops --debug