AI-powered command correction assistant for thefuck
Project description
TheFuck AI Rule
TheFuck AI Rule 是一个基于 AI 的命令修正插件,为 thefuck 工具提供智能命令修复功能。
功能特点
- 使用 AI 模型分析命令错误并提供修复建议
- 支持多种 AI 模型和 API 服务
- 自动环境检测和配置
- 简单易用的安装和设置流程
安装
pip install thefuck-ai-rule
或者直接从 GitHub 安装:
pip install git+https://github.com/huchiyv/thefuckAiRule.git
自动安装和配置
安装后,运行以下命令完成初始化配置:
thefuck-ai-install
此命令将:
- 检查是否安装了 thefuck
- 自动识别您的操作系统
- 将规则文件复制到适当的位置
- 帮助您配置必要的 API 密钥和设置
手动配置
您可以手动设置以下环境变量:
THEFUCK_AI_API_URL: AI API 的 URL (默认: https://api.siliconflow.cn/v1/chat/completions)THEFUCK_AI_API_KEY: 您的 AI API 密钥THEFUCK_AI_MODEL: 要使用的 AI 模型 (默认: Qwen/QwQ-32B)
使用方法
安装和配置完成后,正常使用 thefuck 命令即可。当您输入错误命令后:
$ cd /nonexistent-directory
bash: cd: /nonexistent-directory: No such file or directory
$ fuck
✨✨✨ AI 提示 ✨✨✨
>>> 这是 AI 生成的修复命令 <<<
✨✨✨✨✨✨✨✨✨✨
mkdir -p /nonexistent-directory && cd /nonexistent-directory
$ mkdir -p /nonexistent-directory && cd /nonexistent-directory
许可证
此项目采用 MIT 许可证 - 详见 LICENSE 文件。
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
thefuck_ai_rule-0.1.2.tar.gz
(9.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file thefuck_ai_rule-0.1.2.tar.gz.
File metadata
- Download URL: thefuck_ai_rule-0.1.2.tar.gz
- Upload date:
- Size: 9.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9eca1f672ff7a09198c47686107fecfe68b3ed9bb13619da18162bd460ad4878
|
|
| MD5 |
4b4f5e5203c3576a6c23ad6d94b5c1f5
|
|
| BLAKE2b-256 |
05c61043ce237d54bc4bcffe57e449370ab51b5c0d7278fb0f1c740de1425bfc
|
File details
Details for the file thefuck_ai_rule-0.1.2-py3-none-any.whl.
File metadata
- Download URL: thefuck_ai_rule-0.1.2-py3-none-any.whl
- Upload date:
- Size: 13.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
16d3a880823f8128c25dae06d9976b4a2fa9a6cdf59b3c6cfa4b491fc97b2c64
|
|
| MD5 |
7338cd3c4346a89445806c7297b5eae2
|
|
| BLAKE2b-256 |
70adce28a7343b1afba366b6e11620d84ba7514d98b85e28071f19e933a198e0
|