2

order:使用GPT-4自动清理文件目录

 9 months ago
source link: https://www.jdon.com/70921.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

order:使用GPT-4自动清理文件目录 - 极道

order是一个方便的 CLI 工具,您可以使用它来利用 LLM 来组织您的文件和文件夹。
使用GPT-4自动清理文件系统。它使用AI为您的桌面、文档和下载文件夹找到理想的文件夹结构,然后自动使您的文件保持有序。

1、制造问题:
可以使用 CLI 生成一个杂乱的文件夹:

$ bun run src/packages/cmd/index.ts generate-test-folder test-messy 
$ tree ./test-messy
test-messy
├── Backup_Old_Laptop
│   ├── Documents
│   │   ├── Untitled1.docx
│   │   └── report_final_final.docx
│   └── Photos
│       ├── img1.jpg
│       └── img2.jpg
├── Budget_2023.xlsx
├── Email_Drafts
│   └── Draft1.eml
├── Grocery List.txt
├── Ideas for Blog.txt
├── Invoice_Feb2023.pdf
├── Invoice_Jan2023.pdf
├── Meeting_Notes_2023-01-08.docx
├── Meeting_Notes_2023-01-15.docx
├── New Folder
├── New Folder (2)
├── Old_Essays
│   ├── Essay1.docx
│   └── Essay2.docx
├── Old_Project.zip
├── Party_Planning.docx
├── Random Notes.txt
├── Recipe.pdf
├── Screenshot_20230102.png
├── Screenshot_20230103.png
├── Scripts
│   ├── script1.py
│   └── test_script.js
├── Tax_Info_2022
│   ├── Donations.xlsx
│   └── W2.pdf
├── To Do List.xlsx
├── To Watch List.docx
├── Untitled Document.docx
├── Untitled Spreadsheet.xlsx
└── Vacation_Photos
    ├── IMG_1003.jpg
    ├── IMG_1004.jpg
    └── RandomImage.png

11 directories, 31 files

2、使用 config 命令设置 OpenAI API 密钥
这会将您的密钥存储在~/.order/config.json

$ bun run src/packages/cmd/index.ts config --openai-api-key sk-YOURKEY
$ cat ~/.order/config.json
{
  "openaiApiKey": "sk-YOURKEY"
}

3、使用copy命令组织文件夹
GPT3.5 产生幻觉很多并且有时会输出奇怪的建议。如果您使用 move 命令,请确认输出。

可以使用 --model 标志覆盖模型。

$ bun run src/packages/cmd/index.ts copy ./test-messy ./test-clean -d 1 --verbose
Copying files to ./test-clean
Cleaning ./test-messy to depth 1
Found 25 paths to clean
Cleaning ./test-messy to depth 1
Found 25 paths to clean

Found 8 files that will not be moved:
file
-------------------
/Backup_Old_Laptop/
/Email_Drafts/
/New Folder (2)/
/New Folder/
/Old_Essays/
/Scripts/
/Tax_Info_2022/
/Vacation_Photos/

Found 17 items that can be moved:
from                            to
----------------------------------------------------------------------------
/Budget_2023.xlsx               /Finance/Budget_2023.xlsx
/Grocery List.txt               /Personal/Grocery List.txt
/Ideas for Blog.txt             /Personal/Ideas for Blog.txt
/Invoice_Feb2023.pdf            /Finance/Invoices/Invoice_Feb2023.pdf
/Invoice_Jan2023.pdf            /Finance/Invoices/Invoice_Jan2023.pdf
/Meeting_Notes_2023-01-08.docx  /Work/Meetings/Meeting_Notes_2023-01-08.docx
/Meeting_Notes_2023-01-15.docx  /Work/Meetings/Meeting_Notes_2023-01-15.docx
/Old_Project.zip                /Projects/Old_Project.zip
/Party_Planning.docx            /Personal/Party_Planning.docx
/Random Notes.txt               /Personal/Random Notes.txt
/Recipe.pdf                     /Personal/Recipes/Recipe.pdf
/Screenshot_20230102.png        /Screenshots/Screenshot_20230102.png
/Screenshot_20230103.png        /Screenshots/Screenshot_20230103.png
/To Do List.xlsx                /Personal/To Do List.xlsx
/To Watch List.docx             /Personal/To Watch List.docx
/Untitled Document.docx         /Personal/Untitled Document.docx
/Untitled Spreadsheet.xlsx      /Personal/Untitled Spreadsheet.xlsx
Are you sure you want to copy these files?
(y/n): y

Directory has been cleaned :)


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK