{"id":13801301,"url":"https://github.com/HuakunShen/devclean","last_synced_at":"2025-05-13T11:31:02.541Z","repository":{"id":237903732,"uuid":"794911057","full_name":"HuakunShen/devclean","owner":"HuakunShen","description":"A CLI and Desktop GUI app to clean dev dependencies (node_modules, cache) and more.","archived":false,"fork":false,"pushed_at":"2024-07-29T07:12:36.000Z","size":2144,"stargazers_count":16,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-15T15:47:39.916Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HuakunShen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-02T07:53:04.000Z","updated_at":"2025-03-29T16:04:31.000Z","dependencies_parsed_at":"2024-07-29T08:55:35.420Z","dependency_job_id":null,"html_url":"https://github.com/HuakunShen/devclean","commit_stats":null,"previous_names":["huakunshen/devclean"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HuakunShen%2Fdevclean","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HuakunShen%2Fdevclean/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HuakunShen%2Fdevclean/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HuakunShen%2Fdevclean/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HuakunShen","download_url":"https://codeload.github.com/HuakunShen/devclean/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253932792,"owners_count":21986448,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T00:01:21.369Z","updated_at":"2025-05-13T11:30:58.576Z","avatar_url":"https://github.com/HuakunShen.png","language":"TypeScript","funding_links":[],"categories":["Applications"],"sub_categories":["Developer tools"],"readme":"# devclean\n\n![Crates.io Version](https://img.shields.io/crates/v/devclean) [![Rust](https://github.com/HuakunShen/devclean/actions/workflows/ci.yml/badge.svg)](https://github.com/HuakunShen/devclean/actions/workflows/ci.yml) [![publish](https://github.com/HuakunShen/devclean/actions/workflows/tauri-ci.yml/badge.svg)](https://github.com/HuakunShen/devclean/actions/workflows/tauri-ci.yml)\n\n- [devclean](#devclean)\n  - [Contribution](#contribution)\n    - [Supported Languages/Projects](#supported-languagesprojects)\n    - [Adding Support for Other Languages](#adding-support-for-other-languages)\n  - [GUI App](#gui-app)\n  - [CLI](#cli)\n    - [Installation](#installation)\n    - [Features](#features)\n      - [Find Git Repo with Uncommitted Changes](#find-git-repo-with-uncommitted-changes)\n      - [Find Cache and Dependencies Directories To Clean](#find-cache-and-dependencies-directories-to-clean)\n        - [Supported Projects / Languages](#supported-projects--languages)\n        - [Usage](#usage)\n\n`devclean` is a tool and library for cleaning up development directories.\n\n## Contribution\n\n### Supported Languages/Projects\n\n- [x] Node.js `node_modules`\n- [x] Rust `target`\n\n### Adding Support for Other Languages\n\nI currently only support Node.js and Rust projects as these are the languages that contribute the most to my disk usage.\n\nIf you would like to see support for other languages, please open an issue or a PR.\n\nIt's very easy to add support for another language.\n\nLook at examples in [devclean/src/predicates/languages/node.rs](devclean/src/predicates/languages/node.rs) and [devclean/src/predicates/languages/rust.rs](devclean/src/predicates/languages/rust.rs)\n\nImplement the 4 traits for a language predicate struct\n\n- `LanguagePredicate`\n  - Check whether the current path is in a project of this language. \n  - e.g. Check if parent dir has a `package.json`\n- `Removable`\n  - Check if the current path is removable\n  - e.g. Check if the current path is a `node_modules` directory\n- `Stop`\n  - Check if path traversal should stop\n  - e.g. Stop scanning if the current path is a `node_modules` directory\n- `Reportable`\n  - Sometimes we don't want to remove a directory. This trait is designed as a wrapper layer over `Removable`. If the currently feature is trying to find removable directories to clean, reportable simply calls `is_removable` from `Removable`. In the scanner, `Reportable` is used to determine whether to report the directory as one of the results.\n  - For other features like `find-dirty-git`, reportable means the directory should be reported as a dirty git repo.\n\n\n\n## GUI App\n\nThe GUI App can be found in the [releases](https://github.com/HuakunShen/devclean/releases).\n\n\u003cimg src=\"./assets/gui-demo.png\" width=\"60%\" /\u003e\n\n## CLI\n\n### Installation\n\n```bash\ncargo install devclean\n```\n\n### Features\n\n#### Find Git Repo with Uncommitted Changes\n\nBefore removing a directory, it is important to check if there are any uncommitted changes in the directory. This feature finds all git repositories with uncommitted changes.\n\n```bash\ndevclean find-dirty-git \u003cpath\u003e\n```\n\n```\n❯ devclean find-dirty-git ..\n⠁ Scanning: /Users/xxx/Dev/projects/devclean\nPath                                | Depth | Size\n-------------------------------------+-------+---------\n /Users/xxx/Dev/projects/devclean | 0     | 1.3 GiB\n```\n\n#### Find Cache and Dependencies Directories To Clean\n\nCode projects can have large cache and dependency directories that can be cleaned up to save disk space.\n\n##### Supported Projects / Languages\n\n- [ ] Node.js `node_modules`\n- [ ] Rust `target`\n\n##### Usage\n\n```bash\ndevclean \u003cpath\u003e\ndevclean \u003cpath\u003e --dry-run   # Won't remove anything\ndevclean \u003cpath\u003e --all       # Select all found directories by default\ndevclean \u003cpath\u003e -y          # Skip confirmation\ndevclean \u003cpath\u003e -t          # Time Scanning and Cleaning\n```\n\n![](./assets/demo1.png)\n![](./assets/demo2.png)\n![](./assets/demo3.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHuakunShen%2Fdevclean","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FHuakunShen%2Fdevclean","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHuakunShen%2Fdevclean/lists"}