Environment Variables
oops uses the same environment variables as thefuck for full compatibility. All settings can be overridden via environment variables.
thefuck Compatible
These variables work identically in both oops and thefuck, making migration seamless.
Complete Reference
| Variable | Type | Default | Description |
|---|---|---|---|
THEFUCK_RULES |
String | ALL |
Colon-separated list of enabled rules |
THEFUCK_EXCLUDE_RULES |
String | none | Colon-separated list of rules to disable |
THEFUCK_REQUIRE_CONFIRMATION |
Boolean | true |
Require confirmation before executing |
THEFUCK_WAIT_COMMAND |
Number | 3 |
Command timeout in seconds |
THEFUCK_WAIT_SLOW_COMMAND |
Number | 15 |
Timeout for slow commands |
THEFUCK_NO_COLORS |
Boolean | false |
Disable colored output |
THEFUCK_DEBUG |
Boolean | false |
Enable debug output |
THEFUCK_NUM_CLOSE_MATCHES |
Number | 3 |
Max suggestions to show |
TF_SHELL |
String | auto | Override detected shell |
TF_ALIAS |
String | oops |
Custom alias name |
TF_HISTORY |
String | auto | Recent command history |
Rule Configuration
THEFUCK_RULES
Enable specific rules (colon-separated):
# Enable only these rules
export THEFUCK_RULES="sudo:git_push:git_checkout"
# Enable all rules (default)
export THEFUCK_RULES="ALL"
THEFUCK_EXCLUDE_RULES
Disable specific rules:
# Disable dangerous or unwanted rules
export THEFUCK_EXCLUDE_RULES="rm_root:git_push_force"
Behavior Settings
THEFUCK_REQUIRE_CONFIRMATION
# Require confirmation (default)
export THEFUCK_REQUIRE_CONFIRMATION=true
# Auto-execute first suggestion
export THEFUCK_REQUIRE_CONFIRMATION=false
THEFUCK_WAIT_COMMAND
# Wait 5 seconds for command output
export THEFUCK_WAIT_COMMAND=5
THEFUCK_NO_COLORS
# Disable colored output
export THEFUCK_NO_COLORS=true
THEFUCK_DEBUG
# Enable debug output
export THEFUCK_DEBUG=true
Shell Settings
TF_SHELL
Override automatic shell detection:
export TF_SHELL=zsh
Valid values: bash, zsh, fish, powershell, tcsh
TF_ALIAS
Use a custom alias instead of oops:
# Use 'fuck' as the command (thefuck compatibility)
export TF_ALIAS=fuck
# Then in your shell config:
eval "$(oops --alias)"
# Now you can use:
$ fuck
Examples
Minimal Config (Bash/Zsh)
# ~/.bashrc or ~/.zshrc
export THEFUCK_REQUIRE_CONFIRMATION=false
eval "$(oops --alias)"
Full Config
# ~/.bashrc or ~/.zshrc
export THEFUCK_RULES="ALL"
export THEFUCK_EXCLUDE_RULES="rm_root"
export THEFUCK_REQUIRE_CONFIRMATION=true
export THEFUCK_WAIT_COMMAND=3
export THEFUCK_NO_COLORS=false
export TF_ALIAS=oops
eval "$(oops --alias)"
thefuck Compatibility
# Keep using 'fuck' command
export TF_ALIAS=fuck
eval "$(oops --alias)"
# Your existing environment variables work!
# export THEFUCK_RULES=... (already set? it works!)
Precedence
Settings are applied in this order (later overrides earlier):
- Built-in defaults
- Config file (
~/.config/oops/config.toml) - Environment variables