Skip to content

Add Clean Folders extension - #30721

Open
chomamateusz wants to merge 6 commits into
raycast:mainfrom
chomamateusz:ext/clean-folders
Open

chomamateusz wants to merge 6 commits into
raycast:mainfrom
chomamateusz:ext/clean-folders

Conversation

@chomamateusz

@chomamateusz chomamateusz commented Sep 2, 2026 •

Copy link
Copy Markdown

Description

Clean Folders moves the contents of configured folders (by default ~/Downloads and ~/Desktop) to the Trash in one hit. It only ever moves items to the macOS Trash, so they can be restored.

Downloads and Desktop fill up fast - every download and every screenshot lands there, especially with screenshot-heavy workflows. Two commands:

  • Clean All shows per-folder item counts, asks for confirmation, then moves everything to the Trash.
  • Clean Folder lists the configured folders with item counts and cleans the one you pick.

Folders are configurable as a comma-separated list in the extension preferences.

Screencast

Store metadata screenshots (included in metadata/):

Clean Folder list

Clean All confirmation

Root search with the commands

Checklist

@raycastbot raycastbot added new extension Label for PRs with new extensions platform: macOS labels Sep 2, 2026
@raycastbot

Copy link
Copy Markdown
Collaborator

Congratulations on your new Raycast extension! 🚀

We're currently experiencing a high volume of incoming requests. As a result, the initial review may take up to 15 business days.

Once the PR is approved and merged, the extension will be available on our Store.

@socket-security

socket-security Bot commented Sep 2, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​@​raycast/​api@​2.1.39910084100100

View full report

@greptile-apps

greptile-apps Bot commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

Adds Clean Folders with two commands:

  • Clean All moves configured folder contents to the Trash after confirmation.
  • Clean Folder lists configured folders so a person can choose one to clean.

The latest change removes the outdated /usr/bin/trash claim from README.md. Both earlier findings are fixed: cleanup uses Raycast’s trash() API, and folders.ts uses the generated Preferences type. No new issues were found.

Reviews (3) · Last reviewed commit: "📝 Describe Trash behaviour without impl..." · Reviewed by Greptile

Comment thread extensions/clean-folders/src/folders.ts Resolved
@pernielsentikaer pernielsentikaer self-assigned this Sep 14, 2026

@pernielsentikaer pernielsentikaer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @chomamateusz 👋

Thanks for your contribution 💪

We already have Folder Cleaner in the Store by @StereoPT. It organizes files in a configured folder and supports cleaning one or all files.

This PR moves all contents to the Trash instead, which is a useful difference, but it still fits the same configurable-folder cleaning workflow. Could you look into adding this as another command in the existing extension? If combining them would be impractical, could you explain why here? 🙂


I’ll convert this PR into a draft after submitting this review. Please press Ready for review when it’s ready and we’ll have a look 😊

@pernielsentikaer
pernielsentikaer marked this pull request as draft September 14, 2026 09:10
@chomamateusz

Copy link
Copy Markdown
Author

Hi @chomamateusz 👋

Thanks for your contribution 💪

We already have Folder Cleaner in the Store by @StereoPT. It organizes files in a configured folder and supports cleaning one or all files.

This PR moves all contents to the Trash instead, which is a useful difference, but it still fits the same configurable-folder cleaning workflow. Could you look into adding this as another command in the existing extension? If combining them would be impractical, could you explain why here? 🙂

I’ll convert this PR into a draft after submitting this review. Please press Ready for review when it’s ready and we’ll have a look 😊

Thanks @pernielsentikaer!

I looked at Folder Cleaner now — and I still think the two workflows are near-opposites:

  • Folder Cleaner organizes files (moves them into subfolders by extension; everything is kept)
  • Clean Folders empties folders wholesale to the Trash.

Putting "sort my files" and "remove everything" behind one icon and one preference pane seems like a footgun :)

Folder Cleaner users configure rules precisely because they want to keep their files. The preference models also don't overlap (per-extension rules vs a flat folder list).

If you still prefer consolidation, I can open a PR adding this as a command to Folder Cleaner instead — but I'd argue a destructive-by-design tool deserves its own clearly named listing :)

@chomamateusz
chomamateusz marked this pull request as ready for review September 16, 2026 18:07

@pernielsentikaer pernielsentikaer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @chomamateusz 👋

Thanks for explaining how this differs from Folder Cleaner 💪 You're right that Folder Cleaner only sorts files into subfolders and never deletes anything, so we're happy to keep Clean Folders as its own listing.

I found one more thing while reviewing: the README still says "Clean Folders uses /usr/bin/trash and has no rm path anywhere in its implementation". Since 998ccef switched to Raycast's built-in trash() API, that line isn't accurate anymore, and the PR description says the same. Could you update both? Something like "It only ever moves items to the macOS Trash" keeps the point without naming a binary the extension no longer uses 🙂


I’ll convert this PR into a draft after submitting this review. Please press Ready for review when it’s ready and we’ll have a look 😊

@pernielsentikaer
pernielsentikaer marked this pull request as draft October 8, 2026 10:59
@chomamateusz
chomamateusz marked this pull request as ready for review November 14, 2026 21:47

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new extension Label for PRs with new extensions platform: macOS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants