Conversation
|
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 10-15 business days. Once the PR is approved and merged, the extension will be available on our Store. |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a new Raycast extension (“Dev Cache Cleaner”) to scan developer-related caches/artifacts and optionally clean them, including a menu bar status command.
Changes:
- Introduces scanners for multiple cache categories (package managers, build artifacts, Xcode, Docker, language caches, system caches).
- Adds UI commands for interactive scanning/cleaning and a menu bar indicator with cached results.
- Adds extension configuration, types, utilities, and documentation/metadata.
Reviewed changes
Copilot reviewed 22 out of 29 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| extensions/dev-cache-cleaner/package.json | Defines the Raycast extension, commands, and preferences. |
| extensions/dev-cache-cleaner/tsconfig.json | TypeScript compilation settings for the extension. |
| extensions/dev-cache-cleaner/eslint.config.js | ESLint configuration for consistent linting. |
| extensions/dev-cache-cleaner/.prettierrc | Prettier formatting rules for the extension. |
| extensions/dev-cache-cleaner/.gitignore | Ignores build/runtime artifacts and dependencies. |
| extensions/dev-cache-cleaner/README.md | User-facing documentation for safety, commands, and scanned locations. |
| extensions/dev-cache-cleaner/CHANGELOG.md | Changelog for the extension release history. |
| extensions/dev-cache-cleaner/src/types/index.ts | Core types for scan results, categories, and risk levels. |
| extensions/dev-cache-cleaner/src/utils/disk.ts | Disk/tool helpers (sizes, age formatting, tool availability). |
| extensions/dev-cache-cleaner/src/utils/format.ts | Builds detail markdown shown in the list detail panel. |
| extensions/dev-cache-cleaner/src/utils/cleaner.ts | Implements cleaning actions for scan results. |
| extensions/dev-cache-cleaner/src/utils/cache-store.ts | Persists/retrieves scan results for fast menu bar rendering. |
| extensions/dev-cache-cleaner/src/scanners/index.ts | Orchestrates calling all scanners with progress updates. |
| extensions/dev-cache-cleaner/src/scanners/package-caches.ts | Scans common package manager caches (npm/Yarn/pnpm/brew/etc.). |
| extensions/dev-cache-cleaner/src/scanners/project-artifacts.ts | Scans project directories for older build artifacts (find-based). |
| extensions/dev-cache-cleaner/src/scanners/xcode.ts | Scans Xcode/iOS related directories and simulator cleanup. |
| extensions/dev-cache-cleaner/src/scanners/docker.ts | Scans Docker reclaimable space via docker CLI. |
| extensions/dev-cache-cleaner/src/scanners/language-caches.ts | Scans caches for Gradle/Maven/Cargo/Go/Ruby. |
| extensions/dev-cache-cleaner/src/scanners/system.ts | Scans user logs and large app caches under ~/Library/Caches. |
| extensions/dev-cache-cleaner/src/scan-caches.tsx | Main interactive UI for scanning, filtering, and per-item cleaning. |
| extensions/dev-cache-cleaner/src/clean-safe-caches.ts | One-shot command to clean all “safe” items after confirmation. |
| extensions/dev-cache-cleaner/src/menu-bar.tsx | Menu bar command showing reclaimable space and quick actions. |
Greptile SummaryThis PR adds a new Dev Cache Cleaner extension that scans and cleans developer caches, build artifacts, and language caches across 6 categories. The extension is well-structured with appropriate safety guards (risk levels, confirmation dialogs, tool-specific clean commands), but has one P1 bug that needs fixing before merge:
Confidence Score: 4/5Safe to merge after fixing the duplicate-entry bug in system.ts; all other findings are P2 style/rule issues. One P1 bug (duplicate scan results with conflicting risk levels) needs to be resolved before merge. The remaining findings are rule-compliance issues (unused dependency, manual preference typing, rm vs trash) that don't block functionality but should be addressed per repo standards. extensions/dev-cache-cleaner/src/scanners/system.ts — needs SKIP_ENTRIES guard to avoid re-scanning paths already covered by scanPackageCaches Important Files Changed
Prompt To Fix All With AIThis is a comment left during a code review.
Path: extensions/dev-cache-cleaner/src/scanners/system.ts
Line: 37-65
Comment:
**Duplicate entries with conflicting risk levels**
`scanSystem()` iterates all of `~/Library/Caches` without excluding the subdirectories already scanned by `scanPackageCaches()`. Yarn (`~/Library/Caches/Yarn`), Homebrew (`~/Library/Caches/Homebrew`), CocoaPods (`~/Library/Caches/CocoaPods`), pip (`~/Library/Caches/pip`), and Composer (`~/Library/Caches/composer`) will each appear twice in the results — once as `risk: "safe"` under "Package Manager Caches" and once as `risk: "moderate"` under "System Caches & Logs". The second entry's moderate classification contradicts the first's safe one, and if a user cleans both the freed-bytes accounting will be wrong.
Add the known package-cache folder names to a skip set so those entries are emitted exactly once:
```suggestion
/** System cache prefixes to skip (Apple-managed, regenerate quickly) */
const SKIP_PREFIXES = ["com.apple.", "CloudKit", "SiriTTS"];
/** Cache subdirectories already handled by scanPackageCaches — skip to avoid duplicates */
const SKIP_ENTRIES = new Set(["Yarn", "Homebrew", "CocoaPods", "pip", "composer"]);
```
Then in the loop:
```ts
if (SKIP_PREFIXES.some((prefix) => entry.startsWith(prefix))) continue;
if (SKIP_ENTRIES.has(entry)) continue;
```
How can I resolve this? If you propose a fix, please make it concise.
---
This is a comment left during a code review.
Path: extensions/dev-cache-cleaner/package.json
Line: 76
Comment:
**Unused `@raycast/utils` dependency**
`@raycast/utils` is listed as a runtime dependency but is never imported in any source file under `src/`. Remove it to keep the bundle lean.
```suggestion
"@raycast/api": "^1.104.12"
```
**Rule Used:** What: Every dependency listed in package.json must... ([source](https://app.greptile.com/review/custom-context?memory=bffc60eb-f9f2-4219-b804-76e29e267d43))
How can I resolve this? If you propose a fix, please make it concise.
---
This is a comment left during a code review.
Path: extensions/dev-cache-cleaner/src/scanners/project-artifacts.ts
Line: 60
Comment:
**Manually typed `getPreferenceValues` call**
Preference types are auto-generated in `raycast-env.d.ts` — inline type annotations like `<{ projectPaths?: string; minAgeDays?: string }>` can go out of sync with `package.json` and create maintenance overhead.
```suggestion
const prefs = getPreferenceValues<Preferences>();
```
**Rule Used:** What: Don't manually type `getPreferenceValues()` ... ([source](https://app.greptile.com/review/custom-context?memory=61aa4fa9-b8e8-41b4-8b27-f888b95b75af))
How can I resolve this? If you propose a fix, please make it concise.
---
This is a comment left during a code review.
Path: extensions/dev-cache-cleaner/src/utils/cleaner.ts
Line: 16-20
Comment:
**`rm -rf` instead of Raycast's `trash()` API**
The project guidelines prefer `trash()` from `@raycast/api` over shelling out to `rm`. For a cache cleaner, permanently deleting (rather than trashing) may be intentional since trashing large directories doesn't immediately free space, but the convention in this repo is to use `trash()`. If permanent deletion is required, at minimum document the rationale in a comment here so the pattern is clearly intentional and not an oversight.
**Rule Used:** What: Use Raycast's built-in `trash()` method inst... ([source](https://app.greptile.com/review/custom-context?memory=5c4ec1d2-9af4-490f-becf-e0030e4ba525))
How can I resolve this? If you propose a fix, please make it concise.
---
This is a comment left during a code review.
Path: extensions/dev-cache-cleaner/src/clean-safe-caches.ts
Line: 14-53
Comment:
**Confirmation dialog count/size overstates what will actually be cleaned**
`safeResults` is built with `r.risk === "safe" && r.size > 0`, but `cleanAllSafe` (called on line 51) additionally requires `result.available`. If any safe item has `available: false` (e.g., the npm cache directory exists but `npm` is not in `$PATH`), the confirmation dialog promises to free more bytes across more items than will actually be cleaned. Consider applying the same `available` filter when building `safeResults`:
```suggestion
const safeResults = results.filter((r) => r.risk === "safe" && r.available && r.size > 0);
```
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "Initial release of Dev Cache Cleaner ext..." | Re-trigger Greptile |
Description
Dev Cache Cleaner — Scan and clean developer caches, build artifacts, and orphaned dependencies to reclaim disk space. No external tools required — works out of the box.
Commands
What It Scans (6 categories)
Safety
Screencast
Checklist
npm run buildand tested this distribution build in Raycastassetsfolder are used by the extension itselfREADMEare placed outside of themetadatafolder