thefuck-leeguoo 3.41__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (218) hide show
  1. thefuck/__init__.py +0 -0
  2. thefuck/ai.py +765 -0
  3. thefuck/argument_parser.py +96 -0
  4. thefuck/conf.py +141 -0
  5. thefuck/const.py +111 -0
  6. thefuck/corrector.py +92 -0
  7. thefuck/entrypoints/__init__.py +0 -0
  8. thefuck/entrypoints/alias.py +28 -0
  9. thefuck/entrypoints/fix_command.py +105 -0
  10. thefuck/entrypoints/main.py +50 -0
  11. thefuck/entrypoints/not_configured.py +201 -0
  12. thefuck/entrypoints/setup.py +227 -0
  13. thefuck/entrypoints/shell_logger.py +79 -0
  14. thefuck/exceptions.py +10 -0
  15. thefuck/logs.py +255 -0
  16. thefuck/output_readers/__init__.py +20 -0
  17. thefuck/output_readers/read_log.py +108 -0
  18. thefuck/output_readers/rerun.py +72 -0
  19. thefuck/output_readers/shell_logger.py +60 -0
  20. thefuck/rules/__init__.py +0 -0
  21. thefuck/rules/adb_unknown_command.py +54 -0
  22. thefuck/rules/ag_literal.py +10 -0
  23. thefuck/rules/apt_get.py +50 -0
  24. thefuck/rules/apt_get_search.py +14 -0
  25. thefuck/rules/apt_invalid_operation.py +63 -0
  26. thefuck/rules/apt_list_upgradable.py +16 -0
  27. thefuck/rules/apt_upgrade.py +16 -0
  28. thefuck/rules/aws_cli.py +17 -0
  29. thefuck/rules/az_cli.py +17 -0
  30. thefuck/rules/brew_cask_dependency.py +33 -0
  31. thefuck/rules/brew_install.py +24 -0
  32. thefuck/rules/brew_link.py +15 -0
  33. thefuck/rules/brew_reinstall.py +19 -0
  34. thefuck/rules/brew_uninstall.py +14 -0
  35. thefuck/rules/brew_unknown_command.py +82 -0
  36. thefuck/rules/brew_update_formula.py +12 -0
  37. thefuck/rules/cargo.py +6 -0
  38. thefuck/rules/cargo_no_command.py +15 -0
  39. thefuck/rules/cat_dir.py +14 -0
  40. thefuck/rules/cd_correction.py +61 -0
  41. thefuck/rules/cd_cs.py +21 -0
  42. thefuck/rules/cd_mkdir.py +21 -0
  43. thefuck/rules/cd_parent.py +16 -0
  44. thefuck/rules/chmod_x.py +15 -0
  45. thefuck/rules/choco_install.py +25 -0
  46. thefuck/rules/composer_not_command.py +22 -0
  47. thefuck/rules/conda_mistype.py +17 -0
  48. thefuck/rules/cp_create_destination.py +15 -0
  49. thefuck/rules/cp_omitting_directory.py +15 -0
  50. thefuck/rules/cpp11.py +12 -0
  51. thefuck/rules/dirty_untar.py +53 -0
  52. thefuck/rules/dirty_unzip.py +60 -0
  53. thefuck/rules/django_south_ghost.py +8 -0
  54. thefuck/rules/django_south_merge.py +8 -0
  55. thefuck/rules/dnf_no_such_command.py +37 -0
  56. thefuck/rules/docker_image_being_used_by_container.py +20 -0
  57. thefuck/rules/docker_login.py +13 -0
  58. thefuck/rules/docker_not_command.py +49 -0
  59. thefuck/rules/dry.py +15 -0
  60. thefuck/rules/fab_command_not_found.py +38 -0
  61. thefuck/rules/fix_alt_space.py +15 -0
  62. thefuck/rules/fix_file.py +80 -0
  63. thefuck/rules/gem_unknown_command.py +36 -0
  64. thefuck/rules/git_add.py +27 -0
  65. thefuck/rules/git_add_force.py +13 -0
  66. thefuck/rules/git_bisect_usage.py +16 -0
  67. thefuck/rules/git_branch_0flag.py +24 -0
  68. thefuck/rules/git_branch_delete.py +13 -0
  69. thefuck/rules/git_branch_delete_checked_out.py +19 -0
  70. thefuck/rules/git_branch_exists.py +25 -0
  71. thefuck/rules/git_branch_list.py +14 -0
  72. thefuck/rules/git_checkout.py +49 -0
  73. thefuck/rules/git_clone_git_clone.py +12 -0
  74. thefuck/rules/git_clone_missing.py +42 -0
  75. thefuck/rules/git_commit_add.py +17 -0
  76. thefuck/rules/git_commit_amend.py +11 -0
  77. thefuck/rules/git_commit_reset.py +11 -0
  78. thefuck/rules/git_diff_no_index.py +16 -0
  79. thefuck/rules/git_diff_staged.py +13 -0
  80. thefuck/rules/git_fix_stash.py +37 -0
  81. thefuck/rules/git_flag_after_filename.py +31 -0
  82. thefuck/rules/git_help_aliased.py +12 -0
  83. thefuck/rules/git_hook_bypass.py +27 -0
  84. thefuck/rules/git_lfs_mistype.py +18 -0
  85. thefuck/rules/git_main_master.py +16 -0
  86. thefuck/rules/git_merge.py +18 -0
  87. thefuck/rules/git_merge_unrelated.py +12 -0
  88. thefuck/rules/git_not_command.py +18 -0
  89. thefuck/rules/git_pull.py +16 -0
  90. thefuck/rules/git_pull_clone.py +13 -0
  91. thefuck/rules/git_pull_uncommitted_changes.py +14 -0
  92. thefuck/rules/git_push.py +44 -0
  93. thefuck/rules/git_push_different_branch_names.py +12 -0
  94. thefuck/rules/git_push_force.py +18 -0
  95. thefuck/rules/git_push_pull.py +20 -0
  96. thefuck/rules/git_push_without_commits.py +12 -0
  97. thefuck/rules/git_rebase_merge_dir.py +17 -0
  98. thefuck/rules/git_rebase_no_changes.py +13 -0
  99. thefuck/rules/git_remote_delete.py +13 -0
  100. thefuck/rules/git_remote_seturl_add.py +12 -0
  101. thefuck/rules/git_rm_local_modifications.py +19 -0
  102. thefuck/rules/git_rm_recursive.py +16 -0
  103. thefuck/rules/git_rm_staged.py +19 -0
  104. thefuck/rules/git_stash.py +15 -0
  105. thefuck/rules/git_stash_pop.py +18 -0
  106. thefuck/rules/git_tag_force.py +13 -0
  107. thefuck/rules/git_two_dashes.py +14 -0
  108. thefuck/rules/go_run.py +16 -0
  109. thefuck/rules/go_unknown_command.py +28 -0
  110. thefuck/rules/gradle_no_task.py +34 -0
  111. thefuck/rules/gradle_wrapper.py +13 -0
  112. thefuck/rules/grep_arguments_order.py +23 -0
  113. thefuck/rules/grep_recursive.py +10 -0
  114. thefuck/rules/grunt_task_not_found.py +37 -0
  115. thefuck/rules/gulp_not_task.py +22 -0
  116. thefuck/rules/has_exists_script.py +13 -0
  117. thefuck/rules/heroku_multiple_apps.py +12 -0
  118. thefuck/rules/heroku_not_command.py +11 -0
  119. thefuck/rules/history.py +15 -0
  120. thefuck/rules/hostscli.py +27 -0
  121. thefuck/rules/ifconfig_device_not_found.py +23 -0
  122. thefuck/rules/java.py +17 -0
  123. thefuck/rules/javac.py +18 -0
  124. thefuck/rules/lein_not_task.py +19 -0
  125. thefuck/rules/ln_no_hard_link.py +23 -0
  126. thefuck/rules/ln_s_order.py +26 -0
  127. thefuck/rules/long_form_help.py +27 -0
  128. thefuck/rules/ls_all.py +10 -0
  129. thefuck/rules/ls_lah.py +12 -0
  130. thefuck/rules/man.py +33 -0
  131. thefuck/rules/man_no_space.py +10 -0
  132. thefuck/rules/mercurial.py +27 -0
  133. thefuck/rules/missing_space_before_subcommand.py +21 -0
  134. thefuck/rules/mkdir_p.py +13 -0
  135. thefuck/rules/mvn_no_command.py +11 -0
  136. thefuck/rules/mvn_unknown_lifecycle_phase.py +30 -0
  137. thefuck/rules/nixos_cmd_not_found.py +15 -0
  138. thefuck/rules/no_command.py +41 -0
  139. thefuck/rules/no_such_file.py +30 -0
  140. thefuck/rules/npm_missing_script.py +17 -0
  141. thefuck/rules/npm_run_script.py +17 -0
  142. thefuck/rules/npm_wrong_command.py +42 -0
  143. thefuck/rules/omnienv_no_such_command.py +35 -0
  144. thefuck/rules/open.py +40 -0
  145. thefuck/rules/pacman.py +17 -0
  146. thefuck/rules/pacman_invalid_option.py +20 -0
  147. thefuck/rules/pacman_not_found.py +26 -0
  148. thefuck/rules/path_from_history.py +53 -0
  149. thefuck/rules/php_s.py +11 -0
  150. thefuck/rules/pip_install.py +15 -0
  151. thefuck/rules/pip_unknown_command.py +19 -0
  152. thefuck/rules/port_already_in_use.py +40 -0
  153. thefuck/rules/prove_recursively.py +27 -0
  154. thefuck/rules/python_command.py +17 -0
  155. thefuck/rules/python_execute.py +15 -0
  156. thefuck/rules/python_module_error.py +13 -0
  157. thefuck/rules/quotation_marks.py +12 -0
  158. thefuck/rules/rails_migrations_pending.py +14 -0
  159. thefuck/rules/react_native_command_unrecognized.py +34 -0
  160. thefuck/rules/remove_shell_prompt_literal.py +23 -0
  161. thefuck/rules/remove_trailing_cedilla.py +11 -0
  162. thefuck/rules/rm_dir.py +16 -0
  163. thefuck/rules/rm_root.py +16 -0
  164. thefuck/rules/scm_correction.py +32 -0
  165. thefuck/rules/sed_unterminated_s.py +18 -0
  166. thefuck/rules/sl_ls.py +14 -0
  167. thefuck/rules/ssh_known_hosts.py +37 -0
  168. thefuck/rules/sudo.py +47 -0
  169. thefuck/rules/sudo_command_from_user_path.py +21 -0
  170. thefuck/rules/switch_lang.py +117 -0
  171. thefuck/rules/systemctl.py +22 -0
  172. thefuck/rules/terraform_init.py +13 -0
  173. thefuck/rules/terraform_no_command.py +16 -0
  174. thefuck/rules/test.py.py +10 -0
  175. thefuck/rules/tmux.py +18 -0
  176. thefuck/rules/touch.py +14 -0
  177. thefuck/rules/tsuru_login.py +12 -0
  178. thefuck/rules/tsuru_not_command.py +15 -0
  179. thefuck/rules/unknown_command.py +13 -0
  180. thefuck/rules/unsudo.py +15 -0
  181. thefuck/rules/vagrant_up.py +21 -0
  182. thefuck/rules/whois.py +34 -0
  183. thefuck/rules/workon_doesnt_exists.py +32 -0
  184. thefuck/rules/wrong_hyphen_before_subcommand.py +20 -0
  185. thefuck/rules/yarn_alias.py +14 -0
  186. thefuck/rules/yarn_command_not_found.py +43 -0
  187. thefuck/rules/yarn_command_replaced.py +13 -0
  188. thefuck/rules/yarn_help.py +17 -0
  189. thefuck/rules/yum_invalid_operation.py +39 -0
  190. thefuck/shells/__init__.py +52 -0
  191. thefuck/shells/bash.py +94 -0
  192. thefuck/shells/fish.py +131 -0
  193. thefuck/shells/generic.py +154 -0
  194. thefuck/shells/powershell.py +43 -0
  195. thefuck/shells/tcsh.py +44 -0
  196. thefuck/shells/zsh.py +98 -0
  197. thefuck/specific/__init__.py +0 -0
  198. thefuck/specific/apt.py +3 -0
  199. thefuck/specific/archlinux.py +48 -0
  200. thefuck/specific/brew.py +15 -0
  201. thefuck/specific/dnf.py +3 -0
  202. thefuck/specific/git.py +32 -0
  203. thefuck/specific/nix.py +3 -0
  204. thefuck/specific/npm.py +21 -0
  205. thefuck/specific/sudo.py +18 -0
  206. thefuck/specific/yum.py +3 -0
  207. thefuck/system/__init__.py +7 -0
  208. thefuck/system/unix.py +57 -0
  209. thefuck/system/win32.py +43 -0
  210. thefuck/types.py +261 -0
  211. thefuck/ui.py +116 -0
  212. thefuck/utils.py +385 -0
  213. thefuck_leeguoo-3.41.dist-info/METADATA +681 -0
  214. thefuck_leeguoo-3.41.dist-info/RECORD +218 -0
  215. thefuck_leeguoo-3.41.dist-info/WHEEL +6 -0
  216. thefuck_leeguoo-3.41.dist-info/entry_points.txt +3 -0
  217. thefuck_leeguoo-3.41.dist-info/licenses/LICENSE.md +22 -0
  218. thefuck_leeguoo-3.41.dist-info/top_level.txt +1 -0
@@ -0,0 +1,681 @@
1
+ Metadata-Version: 2.4
2
+ Name: thefuck-leeguoo
3
+ Version: 3.41
4
+ Summary: Magnificent app which corrects your previous console command
5
+ Home-page: https://github.com/nvbn/thefuck
6
+ Author: Vladimir Iakovlev
7
+ Author-email: nvbn.rm@gmail.com
8
+ Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*
9
+ Description-Content-Type: text/markdown
10
+ License-File: LICENSE.md
11
+ Requires-Dist: psutil
12
+ Requires-Dist: colorama
13
+ Requires-Dist: six
14
+ Requires-Dist: rich; python_version >= "3.8"
15
+ Requires-Dist: pathlib2; python_version < "3.4"
16
+ Requires-Dist: backports.shutil_get_terminal_size; python_version < "3.3"
17
+ Requires-Dist: decorator<5; python_version <= "2.7"
18
+ Requires-Dist: pyte<0.8.1; python_version <= "2.7"
19
+ Requires-Dist: decorator; python_version > "2.7"
20
+ Requires-Dist: pyte; python_version > "2.7"
21
+ Requires-Dist: win_unicode_console; sys_platform == "win32"
22
+ Provides-Extra: dev
23
+ Requires-Dist: flake8>=6; python_version >= "3.8.1" and extra == "dev"
24
+ Requires-Dist: pytest<9; python_version >= "3.8" and extra == "dev"
25
+ Requires-Dist: mock; python_version >= "3.8" and extra == "dev"
26
+ Requires-Dist: pytest-mock; python_version >= "3.8" and extra == "dev"
27
+ Requires-Dist: wheel; python_version >= "3.8" and extra == "dev"
28
+ Requires-Dist: setuptools>=17.1; python_version >= "3.8" and extra == "dev"
29
+ Requires-Dist: pexpect; python_version >= "3.8" and extra == "dev"
30
+ Requires-Dist: pypandoc; python_version >= "3.8" and extra == "dev"
31
+ Requires-Dist: pytest-benchmark; python_version >= "3.8" and extra == "dev"
32
+ Requires-Dist: pytest-docker-pexpect; python_version >= "3.8" and extra == "dev"
33
+ Requires-Dist: twine; python_version >= "3.8" and extra == "dev"
34
+ Dynamic: author
35
+ Dynamic: author-email
36
+ Dynamic: home-page
37
+ Dynamic: license-file
38
+ Dynamic: requires-python
39
+
40
+ # The Fuck [![Version][version-badge]][version-link] [![Build Status][workflow-badge]][workflow-link] [![Coverage][coverage-badge]][coverage-link] [![MIT License][license-badge]](LICENSE.md)
41
+
42
+ *The Fuck* is a magnificent app, inspired by a [@liamosaur](https://twitter.com/liamosaur/)
43
+ [tweet](https://twitter.com/liamosaur/status/506975850596536320),
44
+ that corrects errors in previous console commands.
45
+
46
+
47
+ Is *The Fuck* too slow? [Try the experimental instant mode!](#experimental-instant-mode)
48
+
49
+ [![gif with examples][examples-link]][examples-link]
50
+
51
+ More examples:
52
+
53
+ ```bash
54
+ ➜ apt-get install vim
55
+ E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
56
+ E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
57
+
58
+ ➜ fuck
59
+ sudo apt-get install vim [enter/↑/↓/ctrl+c]
60
+ [sudo] password for nvbn:
61
+ Reading package lists... Done
62
+ ...
63
+ ```
64
+
65
+ ```bash
66
+ ➜ git push
67
+ fatal: The current branch master has no upstream branch.
68
+ To push the current branch and set the remote as upstream, use
69
+
70
+ git push --set-upstream origin master
71
+
72
+
73
+ ➜ fuck
74
+ git push --set-upstream origin master [enter/↑/↓/ctrl+c]
75
+ Counting objects: 9, done.
76
+ ...
77
+ ```
78
+
79
+ ```bash
80
+ ➜ puthon
81
+ No command 'puthon' found, did you mean:
82
+ Command 'python' from package 'python-minimal' (main)
83
+ Command 'python' from package 'python3' (main)
84
+ zsh: command not found: puthon
85
+
86
+ ➜ fuck
87
+ python [enter/↑/↓/ctrl+c]
88
+ Python 3.4.2 (default, Oct 8 2014, 13:08:17)
89
+ ...
90
+ ```
91
+
92
+ ```bash
93
+ ➜ git brnch
94
+ git: 'brnch' is not a git command. See 'git --help'.
95
+
96
+ Did you mean this?
97
+ branch
98
+
99
+ ➜ fuck
100
+ git branch [enter/↑/↓/ctrl+c]
101
+ * master
102
+ ```
103
+
104
+ ```bash
105
+ ➜ lein rpl
106
+ 'rpl' is not a task. See 'lein help'.
107
+
108
+ Did you mean this?
109
+ repl
110
+
111
+ ➜ fuck
112
+ lein repl [enter/↑/↓/ctrl+c]
113
+ nREPL server started on port 54848 on host 127.0.0.1 - nrepl://127.0.0.1:54848
114
+ REPL-y 0.3.1
115
+ ...
116
+ ```
117
+
118
+ If you're not afraid of blindly running corrected commands, the
119
+ `require_confirmation` [settings](#settings) option can be disabled:
120
+
121
+ ```bash
122
+ ➜ apt-get install vim
123
+ E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
124
+ E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
125
+
126
+ ➜ fuck
127
+ sudo apt-get install vim
128
+ [sudo] password for nvbn:
129
+ Reading package lists... Done
130
+ ...
131
+ ```
132
+
133
+ ## Contents
134
+
135
+ 1. [Requirements](#requirements)
136
+ 2. [Installations](#installation)
137
+ 3. [Updating](#updating)
138
+ 4. [How it works](#how-it-works)
139
+ 5. [Creating your own rules](#creating-your-own-rules)
140
+ 6. [Settings](#settings)
141
+ 7. [Third party packages with rules](#third-party-packages-with-rules)
142
+ 8. [Experimental instant mode](#experimental-instant-mode)
143
+ 9. [Developing](#developing)
144
+ 10. [License](#license-mit)
145
+
146
+ ## Requirements
147
+
148
+ - python (3.5+)
149
+ - pip
150
+ - python-dev
151
+
152
+ ##### [Back to Contents](#contents)
153
+
154
+ ## Installation
155
+
156
+ ### Install via PyPI (Recommended)
157
+
158
+ ```bash
159
+ pip install thefuck-leeguoo
160
+ ```
161
+
162
+ Or with [uv](https://github.com/astral-sh/uv):
163
+
164
+ ```bash
165
+ uv tool install thefuck-leeguoo
166
+ ```
167
+
168
+ **That's it!** Just run `fuck` after a failed command - it works immediately without any configuration!
169
+
170
+ The first time you run `fuck`, it will:
171
+ 1. Read your last command from shell history
172
+ 2. Re-run it to get the error output
173
+ 3. Suggest a fix and ask for confirmation
174
+ 4. Auto-configure your shell for faster experience next time
175
+
176
+ ### Other Installation Methods
177
+
178
+ On macOS or Linux, you can install *The Fuck* via [Homebrew][homebrew]:
179
+
180
+ ```bash
181
+ brew install thefuck
182
+ ```
183
+
184
+ On Ubuntu / Mint, install *The Fuck* with the following commands:
185
+ ```bash
186
+ sudo apt update
187
+ sudo apt install python3-dev python3-pip python3-setuptools
188
+ pip3 install thefuck --user
189
+ ```
190
+
191
+ On FreeBSD, install *The Fuck* with the following commands:
192
+ ```bash
193
+ pkg install thefuck
194
+ ```
195
+
196
+ On ChromeOS, install *The Fuck* using [chromebrew](https://github.com/skycocker/chromebrew) with the following command:
197
+ ```bash
198
+ crew install thefuck
199
+ ```
200
+
201
+ On Arch based systems, install *The Fuck* with the following command:
202
+ ```
203
+ sudo pacman -S thefuck
204
+ ```
205
+
206
+ On other systems, install *The Fuck* by using `pip`:
207
+
208
+ ```bash
209
+ pip install thefuck
210
+ ```
211
+
212
+ If you use [uv](https://github.com/astral-sh/uv), you can run it without a
213
+ global install:
214
+
215
+ ```bash
216
+ uvx thefuck --help
217
+ uvx thefuck --setup
218
+ ```
219
+
220
+ [Alternatively, you may use an OS package manager (OS X, Ubuntu, Arch).](https://github.com/nvbn/thefuck/wiki/Installation)
221
+
222
+ <a href='#manual-installation' name='manual-installation'>#</a>
223
+ It is recommended that you place this command in your `.bash_profile`,
224
+ `.bashrc`, `.zshrc` or other startup script:
225
+
226
+ ```bash
227
+ eval $(thefuck --alias)
228
+ # You can use whatever you want as an alias, like for Mondays:
229
+ eval $(thefuck --alias FUCK)
230
+ ```
231
+
232
+ [Or in your shell config (Bash, Zsh, Fish, Powershell, tcsh).](https://github.com/nvbn/thefuck/wiki/Shell-aliases)
233
+
234
+ Changes are only available in a new shell session. To make changes immediately
235
+ available, run `source ~/.bashrc` (or your shell config file like `.zshrc`).
236
+
237
+ ### AI setup (optional)
238
+
239
+ Run the interactive setup to configure AI settings and shell integration:
240
+
241
+ ```bash
242
+ thefuck setup
243
+ # or:
244
+ thefuck --setup
245
+ ```
246
+
247
+ This writes an env file to `$XDG_CONFIG_HOME/thefuck/env.fish` (Fish) or
248
+ `$XDG_CONFIG_HOME/thefuck/env.sh` (Bash/Zsh) and a wrapper to
249
+ `$XDG_CONFIG_HOME/thefuck/bin/thefuck`. Source the env file in your shell
250
+ config:
251
+
252
+ ```bash
253
+ source $XDG_CONFIG_HOME/thefuck/env.fish
254
+ # or:
255
+ source $XDG_CONFIG_HOME/thefuck/env.sh
256
+ ```
257
+
258
+ To run fixed commands without confirmation, use the `--yeah` option (or just `-y` for short, or `--hard` if you're especially frustrated):
259
+
260
+ ```bash
261
+ fuck --yeah
262
+ ```
263
+
264
+ To fix commands recursively until succeeding, use the `-r` option:
265
+
266
+ ```bash
267
+ fuck -r
268
+ ```
269
+
270
+ ##### [Back to Contents](#contents)
271
+
272
+ ## Updating
273
+
274
+ ```bash
275
+ pip install thefuck-leeguoo --upgrade
276
+ ```
277
+
278
+ **Note: Alias functionality was changed in v1.34 of *The Fuck***
279
+
280
+ ## Uninstall
281
+
282
+ To remove *The Fuck*, reverse the installation process:
283
+ - erase or comment *thefuck* alias line from your Bash, Zsh, Fish, Powershell, tcsh, ... shell config
284
+ - use your package manager (brew, pip3, pkg, crew, pip) to uninstall the binaries
285
+
286
+ ## How it works
287
+
288
+ *The Fuck* attempts to match the previous command with a rule. If a match is
289
+ found, a new command is created using the matched rule and executed. The
290
+ following rules are enabled by default:
291
+
292
+ * `adb_unknown_command` &ndash; fixes misspelled commands like `adb logcta`;
293
+ * `ag_literal` &ndash; adds `-Q` to `ag` when suggested;
294
+ * `aws_cli` &ndash; fixes misspelled commands like `aws dynamdb scan`;
295
+ * `az_cli` &ndash; fixes misspelled commands like `az providers`;
296
+ * `cargo` &ndash; runs `cargo build` instead of `cargo`;
297
+ * `cargo_no_command` &ndash; fixes wrong commands like `cargo buid`;
298
+ * `cat_dir` &ndash; replaces `cat` with `ls` when you try to `cat` a directory;
299
+ * `cd_correction` &ndash; spellchecks and corrects failed cd commands;
300
+ * `cd_cs` &ndash; changes `cs` to `cd`;
301
+ * `cd_mkdir` &ndash; creates directories before cd'ing into them;
302
+ * `cd_parent` &ndash; changes `cd..` to `cd ..`;
303
+ * `chmod_x` &ndash; adds execution bit;
304
+ * `choco_install` &ndash; appends common suffixes for chocolatey packages;
305
+ * `composer_not_command` &ndash; fixes composer command name;
306
+ * `conda_mistype` &ndash; fixes conda commands;
307
+ * `cp_create_destination` &ndash; creates a new directory when you attempt to `cp` or `mv` to a non-existent one
308
+ * `cp_omitting_directory` &ndash; adds `-a` when you `cp` directory;
309
+ * `cpp11` &ndash; adds missing `-std=c++11` to `g++` or `clang++`;
310
+ * `dirty_untar` &ndash; fixes `tar x` command that untarred in the current directory;
311
+ * `dirty_unzip` &ndash; fixes `unzip` command that unzipped in the current directory;
312
+ * `django_south_ghost` &ndash; adds `--delete-ghost-migrations` to failed because ghosts django south migration;
313
+ * `django_south_merge` &ndash; adds `--merge` to inconsistent django south migration;
314
+ * `docker_login` &ndash; executes a `docker login` and repeats the previous command;
315
+ * `docker_not_command` &ndash; fixes wrong docker commands like `docker tags`;
316
+ * `docker_image_being_used_by_container` &dash; removes the container that is using the image before removing the image;
317
+ * `dry` &ndash; fixes repetitions like `git git push`;
318
+ * `fab_command_not_found` &ndash; fixes misspelled fabric commands;
319
+ * `fix_alt_space` &ndash; replaces Alt+Space with Space character;
320
+ * `fix_file` &ndash; opens a file with an error in your `$EDITOR`;
321
+ * `gem_unknown_command` &ndash; fixes wrong `gem` commands;
322
+ * `git_add` &ndash; fixes *"pathspec 'foo' did not match any file(s) known to git."*;
323
+ * `git_add_force` &ndash; adds `--force` to `git add <pathspec>...` when paths are .gitignore'd;
324
+ * `git_bisect_usage` &ndash; fixes `git bisect strt`, `git bisect goood`, `git bisect rset`, etc. when bisecting;
325
+ * `git_branch_delete` &ndash; changes `git branch -d` to `git branch -D`;
326
+ * `git_branch_delete_checked_out` &ndash; changes `git branch -d` to `git checkout master && git branch -D` when trying to delete a checked out branch;
327
+ * `git_branch_exists` &ndash; offers `git branch -d foo`, `git branch -D foo` or `git checkout foo` when creating a branch that already exists;
328
+ * `git_branch_list` &ndash; catches `git branch list` in place of `git branch` and removes created branch;
329
+ * `git_branch_0flag` &ndash; fixes commands such as `git branch 0v` and `git branch 0r` removing the created branch;
330
+ * `git_checkout` &ndash; fixes branch name or creates new branch;
331
+ * `git_clone_git_clone` &ndash; replaces `git clone git clone ...` with `git clone ...`
332
+ * `git_clone_missing` &ndash; adds `git clone` to URLs that appear to link to a git repository.
333
+ * `git_commit_add` &ndash; offers `git commit -a ...` or `git commit -p ...` after previous commit if it failed because nothing was staged;
334
+ * `git_commit_amend` &ndash; offers `git commit --amend` after previous commit;
335
+ * `git_commit_reset` &ndash; offers `git reset HEAD~` after previous commit;
336
+ * `git_diff_no_index` &ndash; adds `--no-index` to previous `git diff` on untracked files;
337
+ * `git_diff_staged` &ndash; adds `--staged` to previous `git diff` with unexpected output;
338
+ * `git_fix_stash` &ndash; fixes `git stash` commands (misspelled subcommand and missing `save`);
339
+ * `git_flag_after_filename` &ndash; fixes `fatal: bad flag '...' after filename`
340
+ * `git_help_aliased` &ndash; fixes `git help <alias>` commands replacing <alias> with the aliased command;
341
+ * `git_hook_bypass` &ndash; adds `--no-verify` flag previous to `git am`, `git commit`, or `git push` command;
342
+ * `git_lfs_mistype` &ndash; fixes mistyped `git lfs <command>` commands;
343
+ * `git_main_master` &ndash; fixes incorrect branch name between `main` and `master`
344
+ * `git_merge` &ndash; adds remote to branch names;
345
+ * `git_merge_unrelated` &ndash; adds `--allow-unrelated-histories` when required
346
+ * `git_not_command` &ndash; fixes wrong git commands like `git brnch`;
347
+ * `git_pull` &ndash; sets upstream before executing previous `git pull`;
348
+ * `git_pull_clone` &ndash; clones instead of pulling when the repo does not exist;
349
+ * `git_pull_uncommitted_changes` &ndash; stashes changes before pulling and pops them afterwards;
350
+ * `git_push` &ndash; adds `--set-upstream origin $branch` to previous failed `git push`;
351
+ * `git_push_different_branch_names` &ndash; fixes pushes when local branch name does not match remote branch name;
352
+ * `git_push_pull` &ndash; runs `git pull` when `push` was rejected;
353
+ * `git_push_without_commits` &ndash; creates an initial commit if you forget and only `git add .`, when setting up a new project;
354
+ * `git_rebase_no_changes` &ndash; runs `git rebase --skip` instead of `git rebase --continue` when there are no changes;
355
+ * `git_remote_delete` &ndash; replaces `git remote delete remote_name` with `git remote remove remote_name`;
356
+ * `git_rm_local_modifications` &ndash; adds `-f` or `--cached` when you try to `rm` a locally modified file;
357
+ * `git_rm_recursive` &ndash; adds `-r` when you try to `rm` a directory;
358
+ * `git_rm_staged` &ndash; adds `-f` or `--cached` when you try to `rm` a file with staged changes
359
+ * `git_rebase_merge_dir` &ndash; offers `git rebase (--continue | --abort | --skip)` or removing the `.git/rebase-merge` dir when a rebase is in progress;
360
+ * `git_remote_seturl_add` &ndash; runs `git remote add` when `git remote set_url` on nonexistent remote;
361
+ * `git_stash` &ndash; stashes your local modifications before rebasing or switching branch;
362
+ * `git_stash_pop` &ndash; adds your local modifications before popping stash, then resets;
363
+ * `git_tag_force` &ndash; adds `--force` to `git tag <tagname>` when the tag already exists;
364
+ * `git_two_dashes` &ndash; adds a missing dash to commands like `git commit -amend` or `git rebase -continue`;
365
+ * `go_run` &ndash; appends `.go` extension when compiling/running Go programs;
366
+ * `go_unknown_command` &ndash; fixes wrong `go` commands, for example `go bulid`;
367
+ * `gradle_no_task` &ndash; fixes not found or ambiguous `gradle` task;
368
+ * `gradle_wrapper` &ndash; replaces `gradle` with `./gradlew`;
369
+ * `grep_arguments_order` &ndash; fixes `grep` arguments order for situations like `grep -lir . test`;
370
+ * `grep_recursive` &ndash; adds `-r` when you try to `grep` directory;
371
+ * `grunt_task_not_found` &ndash; fixes misspelled `grunt` commands;
372
+ * `gulp_not_task` &ndash; fixes misspelled `gulp` tasks;
373
+ * `has_exists_script` &ndash; prepends `./` when script/binary exists;
374
+ * `heroku_multiple_apps` &ndash; adds `--app <app>` to `heroku` commands like `heroku pg`;
375
+ * `heroku_not_command` &ndash; fixes wrong `heroku` commands like `heroku log`;
376
+ * `history` &ndash; tries to replace command with the most similar command from history;
377
+ * `hostscli` &ndash; tries to fix `hostscli` usage;
378
+ * `ifconfig_device_not_found` &ndash; fixes wrong device names like `wlan0` to `wlp2s0`;
379
+ * `java` &ndash; removes `.java` extension when running Java programs;
380
+ * `javac` &ndash; appends missing `.java` when compiling Java files;
381
+ * `lein_not_task` &ndash; fixes wrong `lein` tasks like `lein rpl`;
382
+ * `long_form_help` &ndash; changes `-h` to `--help` when the short form version is not supported
383
+ * `ln_no_hard_link` &ndash; catches hard link creation on directories, suggest symbolic link;
384
+ * `ln_s_order` &ndash; fixes `ln -s` arguments order;
385
+ * `ls_all` &ndash; adds `-A` to `ls` when output is empty;
386
+ * `ls_lah` &ndash; adds `-lah` to `ls`;
387
+ * `man` &ndash; changes manual section;
388
+ * `man_no_space` &ndash; fixes man commands without spaces, for example `mandiff`;
389
+ * `mercurial` &ndash; fixes wrong `hg` commands;
390
+ * `missing_space_before_subcommand` &ndash; fixes command with missing space like `npminstall`;
391
+ * `mkdir_p` &ndash; adds `-p` when you try to create a directory without a parent;
392
+ * `mvn_no_command` &ndash; adds `clean package` to `mvn`;
393
+ * `mvn_unknown_lifecycle_phase` &ndash; fixes misspelled life cycle phases with `mvn`;
394
+ * `npm_missing_script` &ndash; fixes `npm` custom script name in `npm run-script <script>`;
395
+ * `npm_run_script` &ndash; adds missing `run-script` for custom `npm` scripts;
396
+ * `npm_wrong_command` &ndash; fixes wrong npm commands like `npm urgrade`;
397
+ * `no_command` &ndash; fixes wrong console commands, for example `vom/vim`;
398
+ * `no_such_file` &ndash; creates missing directories with `mv` and `cp` commands;
399
+ * `omnienv_no_such_command` &ndash; fixes wrong commands for `goenv`, `nodenv`, `pyenv` and `rbenv` (eg.: `pyenv isntall` or `goenv list`);
400
+ * `open` &ndash; either prepends `http://` to address passed to `open` or creates a new file or directory and passes it to `open`;
401
+ * `pip_install` &ndash; fixes permission issues with `pip install` commands by adding `--user` or prepending `sudo` if necessary;
402
+ * `pip_unknown_command` &ndash; fixes wrong `pip` commands, for example `pip instatl/pip install`;
403
+ * `php_s` &ndash; replaces `-s` by `-S` when trying to run a local php server;
404
+ * `port_already_in_use` &ndash; kills process that bound port;
405
+ * `prove_recursively` &ndash; adds `-r` when called with directory;
406
+ * `python_command` &ndash; prepends `python` when you try to run non-executable/without `./` python script;
407
+ * `python_execute` &ndash; appends missing `.py` when executing Python files;
408
+ * `python_module_error` &ndash; fixes ModuleNotFoundError by trying to `pip install` that module;
409
+ * `quotation_marks` &ndash; fixes uneven usage of `'` and `"` when containing args';
410
+ * `path_from_history` &ndash; replaces not found path with a similar absolute path from history;
411
+ * `rails_migrations_pending` &ndash; runs pending migrations;
412
+ * `react_native_command_unrecognized` &ndash; fixes unrecognized `react-native` commands;
413
+ * `remove_shell_prompt_literal` &ndash; removes leading shell prompt symbol `$`, common when copying commands from documentations;
414
+ * `remove_trailing_cedilla` &ndash; removes trailing cedillas `ç`, a common typo for European keyboard layouts;
415
+ * `rm_dir` &ndash; adds `-rf` when you try to remove a directory;
416
+ * `scm_correction` &ndash; corrects wrong scm like `hg log` to `git log`;
417
+ * `sed_unterminated_s` &ndash; adds missing '/' to `sed`'s `s` commands;
418
+ * `sl_ls` &ndash; changes `sl` to `ls`;
419
+ * `ssh_known_hosts` &ndash; removes host from `known_hosts` on warning;
420
+ * `sudo` &ndash; prepends `sudo` to the previous command if it failed because of permissions;
421
+ * `sudo_command_from_user_path` &ndash; runs commands from users `$PATH` with `sudo`;
422
+ * `switch_lang` &ndash; switches command from your local layout to en;
423
+ * `systemctl` &ndash; correctly orders parameters of confusing `systemctl`;
424
+ * `terraform_init.py` &ndash; runs `terraform init` before plan or apply;
425
+ * `terraform_no_command.py` &ndash; fixes unrecognized `terraform` commands;
426
+ * `test.py` &ndash; runs `pytest` instead of `test.py`;
427
+ * `touch` &ndash; creates missing directories before "touching";
428
+ * `tsuru_login` &ndash; runs `tsuru login` if not authenticated or session expired;
429
+ * `tsuru_not_command` &ndash; fixes wrong `tsuru` commands like `tsuru shell`;
430
+ * `tmux` &ndash; fixes `tmux` commands;
431
+ * `unknown_command` &ndash; fixes hadoop hdfs-style "unknown command", for example adds missing '-' to the command on `hdfs dfs ls`;
432
+ * `unsudo` &ndash; removes `sudo` from previous command if a process refuses to run on superuser privilege.
433
+ * `vagrant_up` &ndash; starts up the vagrant instance;
434
+ * `whois` &ndash; fixes `whois` command;
435
+ * `workon_doesnt_exists` &ndash; fixes `virtualenvwrapper` env name os suggests to create new.
436
+ * `wrong_hyphen_before_subcommand` &ndash; removes an improperly placed hyphen (`apt-install` -> `apt install`, `git-log` -> `git log`, etc.)
437
+ * `yarn_alias` &ndash; fixes aliased `yarn` commands like `yarn ls`;
438
+ * `yarn_command_not_found` &ndash; fixes misspelled `yarn` commands;
439
+ * `yarn_command_replaced` &ndash; fixes replaced `yarn` commands;
440
+ * `yarn_help` &ndash; makes it easier to open `yarn` documentation;
441
+
442
+ ##### [Back to Contents](#contents)
443
+
444
+ The following rules are enabled by default on specific platforms only:
445
+
446
+ * `apt_get` &ndash; installs app from apt if it not installed (requires `python-commandnotfound` / `python3-commandnotfound`);
447
+ * `apt_get_search` &ndash; changes trying to search using `apt-get` with searching using `apt-cache`;
448
+ * `apt_invalid_operation` &ndash; fixes invalid `apt` and `apt-get` calls, like `apt-get isntall vim`;
449
+ * `apt_list_upgradable` &ndash; helps you run `apt list --upgradable` after `apt update`;
450
+ * `apt_upgrade` &ndash; helps you run `apt upgrade` after `apt list --upgradable`;
451
+ * `brew_cask_dependency` &ndash; installs cask dependencies;
452
+ * `brew_install` &ndash; fixes formula name for `brew install`;
453
+ * `brew_reinstall` &ndash; turns `brew install <formula>` into `brew reinstall <formula>`;
454
+ * `brew_link` &ndash; adds `--overwrite --dry-run` if linking fails;
455
+ * `brew_uninstall` &ndash; adds `--force` to `brew uninstall` if multiple versions were installed;
456
+ * `brew_unknown_command` &ndash; fixes wrong brew commands, for example `brew docto/brew doctor`;
457
+ * `brew_update_formula` &ndash; turns `brew update <formula>` into `brew upgrade <formula>`;
458
+ * `dnf_no_such_command` &ndash; fixes mistyped DNF commands;
459
+ * `nixos_cmd_not_found` &ndash; installs apps on NixOS;
460
+ * `pacman` &ndash; installs app with `pacman` if it is not installed (uses `yay`, `pikaur` or `yaourt` if available);
461
+ * `pacman_invalid_option` &ndash; replaces lowercase `pacman` options with uppercase.
462
+ * `pacman_not_found` &ndash; fixes package name with `pacman`, `yay`, `pikaur` or `yaourt`.
463
+ * `yum_invalid_operation` &ndash; fixes invalid `yum` calls, like `yum isntall vim`;
464
+
465
+ The following commands are bundled with *The Fuck*, but are not enabled by
466
+ default:
467
+
468
+ * `git_push_force` &ndash; adds `--force-with-lease` to a `git push` (may conflict with `git_push_pull`);
469
+ * `rm_root` &ndash; adds `--no-preserve-root` to `rm -rf /` command.
470
+
471
+ ##### [Back to Contents](#contents)
472
+
473
+ ## Creating your own rules
474
+
475
+ To add your own rule, create a file named `your-rule-name.py`
476
+ in `~/.config/thefuck/rules`. The rule file must contain two functions:
477
+
478
+ ```python
479
+ match(command: Command) -> bool
480
+ get_new_command(command: Command) -> str | list[str]
481
+ ```
482
+
483
+ Additionally, rules can contain optional functions:
484
+
485
+ ```python
486
+ side_effect(old_command: Command, fixed_command: str) -> None
487
+ ```
488
+ Rules can also contain the optional variables `enabled_by_default`, `requires_output` and `priority`.
489
+
490
+ `Command` has three attributes: `script`, `output` and `script_parts`.
491
+ Your rule should not change `Command`.
492
+
493
+
494
+ **Rules api changed in 3.0:** To access a rule's settings, import it with
495
+ `from thefuck.conf import settings`
496
+
497
+ `settings` is a special object assembled from `~/.config/thefuck/settings.py`,
498
+ and values from env ([see more below](#settings)).
499
+
500
+ A simple example rule for running a script with `sudo`:
501
+
502
+ ```python
503
+ def match(command):
504
+ return ('permission denied' in command.output.lower()
505
+ or 'EACCES' in command.output)
506
+
507
+
508
+ def get_new_command(command):
509
+ return 'sudo {}'.format(command.script)
510
+
511
+ # Optional:
512
+ enabled_by_default = True
513
+
514
+ def side_effect(command, fixed_command):
515
+ subprocess.call('chmod 777 .', shell=True)
516
+
517
+ priority = 1000 # Lower first, default is 1000
518
+
519
+ requires_output = True
520
+ ```
521
+
522
+ [More examples of rules](https://github.com/nvbn/thefuck/tree/master/thefuck/rules),
523
+ [utility functions for rules](https://github.com/nvbn/thefuck/tree/master/thefuck/utils.py),
524
+ [app/os-specific helpers](https://github.com/nvbn/thefuck/tree/master/thefuck/specific/).
525
+
526
+ ##### [Back to Contents](#contents)
527
+
528
+ ## Settings
529
+
530
+ Several *The Fuck* parameters can be changed in the file `$XDG_CONFIG_HOME/thefuck/settings.py`
531
+ (`$XDG_CONFIG_HOME` defaults to `~/.config`):
532
+
533
+ * `rules` &ndash; list of enabled rules, by default `thefuck.const.DEFAULT_RULES`;
534
+ * `exclude_rules` &ndash; list of disabled rules, by default `[]`;
535
+ * `require_confirmation` &ndash; requires confirmation before running new command, by default `True`;
536
+ * `wait_command` &ndash; the max amount of time in seconds for getting previous command output;
537
+ * `no_colors` &ndash; disable colored output;
538
+ * `priority` &ndash; dict with rules priorities, rule with lower `priority` will be matched first;
539
+ * `debug` &ndash; enables debug output, by default `False`;
540
+ * `history_limit` &ndash; the numeric value of how many history commands will be scanned, like `2000`;
541
+ * `alter_history` &ndash; push fixed command to history, by default `True`;
542
+ * `wait_slow_command` &ndash; max amount of time in seconds for getting previous command output if it in `slow_commands` list;
543
+ * `slow_commands` &ndash; list of slow commands;
544
+ * `num_close_matches` &ndash; the maximum number of close matches to suggest, by default `3`.
545
+ * `excluded_search_path_prefixes` &ndash; path prefixes to ignore when searching for commands, by default `[]`.
546
+ * `ai_enabled` &ndash; enable AI suggestions, by default `False`;
547
+ * `ai_url` &ndash; AI endpoint URL;
548
+ * `ai_token` &ndash; AI token (bearer);
549
+ * `ai_model` &ndash; AI model name;
550
+ * `ai_timeout` &ndash; AI timeout in seconds;
551
+ * `ai_reasoning_effort` &ndash; `low`, `medium`, or `high`;
552
+ * `ai_stream` &ndash; use SSE streaming, by default `True`;
553
+ * `ai_stream_output` &ndash; stream AI output while waiting, by default `True`;
554
+ * `ai_mode` &ndash; `prefer` (prepend AI suggestions) or `fallback`.
555
+
556
+ An example of `settings.py`:
557
+
558
+ ```python
559
+ rules = ['sudo', 'no_command']
560
+ exclude_rules = ['git_push']
561
+ require_confirmation = True
562
+ wait_command = 10
563
+ no_colors = False
564
+ priority = {'sudo': 100, 'no_command': 9999}
565
+ debug = False
566
+ history_limit = 9999
567
+ wait_slow_command = 20
568
+ slow_commands = ['react-native', 'gradle']
569
+ num_close_matches = 5
570
+ ```
571
+
572
+ Or via environment variables:
573
+
574
+ * `THEFUCK_RULES` &ndash; list of enabled rules, like `DEFAULT_RULES:rm_root` or `sudo:no_command`;
575
+ * `THEFUCK_EXCLUDE_RULES` &ndash; list of disabled rules, like `git_pull:git_push`;
576
+ * `THEFUCK_REQUIRE_CONFIRMATION` &ndash; require confirmation before running new command, `true/false`;
577
+ * `THEFUCK_WAIT_COMMAND` &ndash; the max amount of time in seconds for getting previous command output;
578
+ * `THEFUCK_NO_COLORS` &ndash; disable colored output, `true/false`;
579
+ * `THEFUCK_PRIORITY` &ndash; priority of the rules, like `no_command=9999:apt_get=100`,
580
+ rule with lower `priority` will be matched first;
581
+ * `THEFUCK_DEBUG` &ndash; enables debug output, `true/false`;
582
+ * `THEFUCK_HISTORY_LIMIT` &ndash; how many history commands will be scanned, like `2000`;
583
+ * `THEFUCK_ALTER_HISTORY` &ndash; push fixed command to history `true/false`;
584
+ * `THEFUCK_WAIT_SLOW_COMMAND` &ndash; the max amount of time in seconds for getting previous command output if it in `slow_commands` list;
585
+ * `THEFUCK_SLOW_COMMANDS` &ndash; list of slow commands, like `lein:gradle`;
586
+ * `THEFUCK_NUM_CLOSE_MATCHES` &ndash; the maximum number of close matches to suggest, like `5`.
587
+ * `THEFUCK_EXCLUDED_SEARCH_PATH_PREFIXES` &ndash; path prefixes to ignore when searching for commands, by default `[]`.
588
+ * `THEFUCK_AI_ENABLED` &ndash; enable AI suggestions, `true/false`;
589
+ * `THEFUCK_AI_URL` &ndash; AI endpoint URL;
590
+ * `THEFUCK_AI_TOKEN` &ndash; AI token (bearer);
591
+ * `THEFUCK_AI_MODEL` &ndash; AI model name;
592
+ * `THEFUCK_AI_TIMEOUT` &ndash; AI timeout in seconds;
593
+ * `THEFUCK_AI_REASONING_EFFORT` &ndash; `low`, `medium`, or `high`;
594
+ * `THEFUCK_AI_STREAM` &ndash; use SSE streaming, `true/false`;
595
+ * `THEFUCK_AI_STREAM_OUTPUT` &ndash; stream AI output while waiting, `true/false`;
596
+ * `THEFUCK_AI_MODE` &ndash; `prefer` or `fallback`.
597
+
598
+ For example:
599
+
600
+ ```bash
601
+ export THEFUCK_RULES='sudo:no_command'
602
+ export THEFUCK_EXCLUDE_RULES='git_pull:git_push'
603
+ export THEFUCK_REQUIRE_CONFIRMATION='true'
604
+ export THEFUCK_WAIT_COMMAND=10
605
+ export THEFUCK_NO_COLORS='false'
606
+ export THEFUCK_PRIORITY='no_command=9999:apt_get=100'
607
+ export THEFUCK_HISTORY_LIMIT='2000'
608
+ export THEFUCK_NUM_CLOSE_MATCHES='5'
609
+ export THEFUCK_AI_ENABLED='true'
610
+ export THEFUCK_AI_URL='http://127.0.0.1:8000/v1/chat/completions'
611
+ export THEFUCK_AI_TOKEN='devtoken'
612
+ export THEFUCK_AI_MODEL='gpt-5.2'
613
+ export THEFUCK_AI_STREAM='true'
614
+ export THEFUCK_AI_STREAM_OUTPUT='true'
615
+ export THEFUCK_AI_MODE='prefer'
616
+ ```
617
+
618
+ ##### [Back to Contents](#contents)
619
+
620
+ ## Third-party packages with rules
621
+
622
+ If you'd like to make a specific set of non-public rules, but would still like
623
+ to share them with others, create a package named `thefuck_contrib_*` with
624
+ the following structure:
625
+
626
+ ```
627
+ thefuck_contrib_foo
628
+ thefuck_contrib_foo
629
+ rules
630
+ __init__.py
631
+ *third-party rules*
632
+ __init__.py
633
+ *third-party-utils*
634
+ setup.py
635
+ ```
636
+
637
+ *The Fuck* will find rules located in the `rules` module.
638
+
639
+ ##### [Back to Contents](#contents)
640
+
641
+ ## Experimental instant mode
642
+
643
+ The default behavior of *The Fuck* requires time to re-run previous commands.
644
+ When in instant mode, *The Fuck* saves time by logging output with [script](https://en.wikipedia.org/wiki/Script_(Unix)),
645
+ then reading the log.
646
+
647
+ [![gif with instant mode][instant-mode-gif-link]][instant-mode-gif-link]
648
+
649
+ Currently, instant mode only supports Python 3 with bash or zsh. zsh's autocorrect function also needs to be disabled in order for thefuck to work properly.
650
+
651
+ To enable instant mode, add `--enable-experimental-instant-mode`
652
+ to the alias initialization in `.bashrc`, `.bash_profile` or `.zshrc`.
653
+
654
+ For example:
655
+
656
+ ```bash
657
+ eval $(thefuck --alias --enable-experimental-instant-mode)
658
+ ```
659
+
660
+ ##### [Back to Contents](#contents)
661
+
662
+ ## Developing
663
+
664
+ See [CONTRIBUTING.md](CONTRIBUTING.md)
665
+
666
+ ## License MIT
667
+ Project License can be found [here](LICENSE.md).
668
+
669
+
670
+ [version-badge]: https://img.shields.io/pypi/v/thefuck.svg?label=version
671
+ [version-link]: https://pypi.python.org/pypi/thefuck/
672
+ [workflow-badge]: https://github.com/nvbn/thefuck/workflows/Tests/badge.svg
673
+ [workflow-link]: https://github.com/nvbn/thefuck/actions?query=workflow%3ATests
674
+ [coverage-badge]: https://img.shields.io/coveralls/nvbn/thefuck.svg
675
+ [coverage-link]: https://coveralls.io/github/nvbn/thefuck
676
+ [license-badge]: https://img.shields.io/badge/license-MIT-007EC7.svg
677
+ [examples-link]: https://raw.githubusercontent.com/nvbn/thefuck/master/example.gif
678
+ [instant-mode-gif-link]: https://raw.githubusercontent.com/nvbn/thefuck/master/example_instant_mode.gif
679
+ [homebrew]: https://brew.sh/
680
+
681
+ ##### [Back to Contents](#contents)