{"id":51216168,"url":"https://github.com/a7garden/oxicleaner","last_synced_at":"2026-06-28T04:03:17.968Z","repository":{"id":364952705,"uuid":"1269877233","full_name":"a7garden/oxicleaner","owner":"a7garden","description":"Recursive Rust target/ cleaner with launchd scheduling","archived":false,"fork":false,"pushed_at":"2026-06-15T07:54:48.000Z","size":42,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-06-15T09:14:12.297Z","etag":null,"topics":["cargo","cargo-sweep","launchd","macos","rust","scheduler","target-cleanup"],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/a7garden.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-15T07:19:28.000Z","updated_at":"2026-06-15T07:54:52.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/a7garden/oxicleaner","commit_stats":null,"previous_names":["a7garden/oxicleaner"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/a7garden/oxicleaner","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a7garden%2Foxicleaner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a7garden%2Foxicleaner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a7garden%2Foxicleaner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a7garden%2Foxicleaner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/a7garden","download_url":"https://codeload.github.com/a7garden/oxicleaner/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a7garden%2Foxicleaner/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34876273,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-28T02:00:05.809Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cargo","cargo-sweep","launchd","macos","rust","scheduler","target-cleanup"],"created_at":"2026-06-28T04:03:16.570Z","updated_at":"2026-06-28T04:03:17.956Z","avatar_url":"https://github.com/a7garden.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# oxicleaner\n\n[![Crates.io](https://img.shields.io/badge/crates.io-coming%20soon-orange)](https://crates.io)\n[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n\n\u003e **Recursive Rust `target/` cleaner with launchd scheduling.**\n\u003e\n\u003e Wraps [cargo-sweep](https://github.com/holmgr/cargo-sweep) to clean stale build\n\u003e artifacts across **all** Cargo projects under a root, while preserving recently\n\u003e used artifacts so your next build stays fast. Installs and manages its own macOS\n\u003e `launchd` schedule, records history, and refuses to run while a build is in\n\u003e progress.\n\n`oxicleaner` was built for the [oxios](https://github.com/a7garden/oxios) dev\nmachine, where dozens of worktrees and sibling Rust projects had quietly amassed\n**~280 GB** of duplicated, feature-combination-specific build artifacts.\n\n## Why\n\n`cargo` doesn't garbage-collect `target/`. Every feature combination, toolchain,\nprofile, and codegen-unit split produces a fresh set of `.rlib` / `.rcgu.o`\nfiles. Over months these accumulate until a single project can balloon to dozens\nof duplicate variants of the same crate:\n\n| crate | duplicate `.rlib` variants found |\n|-------|----------------------------------:|\n| oxios_gateway | 124 |\n| oxios_kernel | 115 |\n| oxios_ouroboros | 97 |\n| … | … |\n\n`oxicleaner` automates the cleanup so the disk never fills up again — on a\nschedule, safely, with a record of what it did.\n\n## How it works\n\n1. **Recursive scan** — finds every `Cargo.toml` under the configured root and\n   the matching `target/` for each.\n2. **cargo-sweep** — for each project, deletes build artifacts **older than N\n   days** (default 30). Anything you built recently is kept, so the next\n   incremental build is still fast.\n3. **Safety guard** — if any `cargo`/`rustc` process is running under the root,\n   the run is skipped (rescheduled to next cycle) instead of risking corruption.\n4. **launchd schedule** — `oxicleaner enable` writes and loads its own plist.\n   The scheduled binary lives in `~/.oxicleaner/` (outside any `target/`), so it\n   can never delete itself.\n5. **History** — every run (including skips) is appended to\n   `~/.oxicleaner/history.jsonl` and queryable via `oxicleaner history`.\n\n## Install\n\n```bash\n# 1. runtime dependency\ncargo install cargo-sweep\n\n# 2. build oxicleaner\ngit clone https://github.com/a7garden/oxicleaner\ncd oxicleaner\ncargo build --release\n\n# 3. (optional) put it on PATH\ncp target/release/oxicleaner ~/.cargo/bin/\n```\n\n\u003e **Platform:** macOS only (launchd scheduling). The `sweep` command itself\n\u003e works anywhere cargo-sweep does.\n\n## Usage\n\n```bash\n# 🆕 Interactive setup wizard (recommended first run)\noxicleaner setup\n#   → walks you through root, retention, schedule, weekday/time\n#   → writes config.toml, enables launchd, optionally runs first sweep\n\n# Clean now, keeping artifacts from the last 30 days\noxicleaner sweep\noxicleaner sweep --days 60\noxicleaner sweep --dry-run          # preview only — deletes nothing\noxicleaner sweep --root ~/projects  # override scan root\n\n# Enable the weekly schedule (non-interactive)\noxicleaner enable\noxicleaner enable --weekday 5 --hour 4 --days 45   # Fridays 04:00, keep 45d\n\n# Inspect\noxicleaner status       # is the schedule loaded? what did the last run do?\noxicleaner history      # recent runs (timestamp, mode, freed, disk delta)\noxicleaner history -n 20\n\n# Disable the schedule\noxicleaner disable\n\n# Run with no subcommand → sweep (handy for the scheduled invocation)\noxicleaner\n```\n\n### Flags\n\n| Flag | Scope | Description |\n|------|-------|-------------|\n| `-r, --root \u003cPATH\u003e` | global | Scan root (defaults to `config.toml`) |\n| `--days \u003cN\u003e` | sweep, enable | Keep artifacts newer than N days |\n| `--dry-run` | sweep | Preview without deleting |\n| `--force` | sweep | Run even if a build is in progress |\n| `--weekday \u003c0-6\u003e` | enable | 0=Sun … 6=Sat (default 0) |\n| `--hour \u003c0-23\u003e` | enable | Hour of day (default 3) |\n| `-n, --limit \u003cN\u003e` | history | Number of records to show |\n\n## File locations\n\n| Path | Purpose |\n|------|---------|\n| `~/.oxicleaner/config.toml` | Root + retention setting (written by `enable`) |\n| `~/.oxicleaner/oxicleaner` | Scheduled binary copy (kept out of any `target/`) |\n| `~/.oxicleaner/history.jsonl` | One JSON line per run |\n| `~/Library/LaunchAgents/local.oxicleaner.plist` | launchd schedule |\n| `~/Library/Logs/oxicleaner/` | launchd stdout/stderr + scheduled-run output |\n\n## Example output\n\n```\n$ oxicleaner sweep --dry-run --days 30\noxicleaner: root=/Volumes/MERCURY/PROJECTS, keep=30d, mode=dry-run\n\n   ✓   10.10 GiB  /Volumes/MERCURY/PROJECTS/cardion/src-tauri/target\n   ✓   17.17 GiB  /Volumes/MERCURY/PROJECTS/clawgarden/target\n      —          /Volumes/MERCURY/PROJECTS/oxi/target\n   ✓    4.04 GiB  /Volumes/MERCURY/PROJECTS/session-a-web-platform/target\n   ✓   10.66 GiB  /Volumes/MERCURY/PROJECTS/session-b-cdp-perf/target\n\n총 확보: 42.47 GiB   (disk: 35% 사용, 607Gi 여유 → 35% 사용, 607Gi 여유)\n```\n\n```\n$ oxicleaner history\n시각                모드             확보    disk 변화\n----------------------------------------------------------------------\n2026-06-15 16:11   live      42.47 GiB  35% 사용, 607Gi 여유 → 32% 사용, 634Gi 여유\n2026-06-14 03:00   live       0.00 B    32% 사용, 634Gi 여유 → 32% 사용, 634Gi 여유\n2026-06-07 03:00   SKIP       프로세스 빌드 중\n```\n\n## Building\n\n```bash\ncargo build --release\ncargo test\ncargo clippy -D warnings\ncargo fmt --check\n```\n\n## Alternatives\n\n- **`cargo clean`** — deletes the entire `target/`. Reliable, but forces a full\n  rebuild every time. Fine for occasional use, painful as a schedule.\n- **`cargo-sweep`** directly — the underlying engine. `oxicleaner` adds the\n  multi-project recursive scan, launchd scheduling, build-detection safety guard,\n  and history.\n\n## License\n\nMIT. See [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa7garden%2Foxicleaner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fa7garden%2Foxicleaner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa7garden%2Foxicleaner/lists"}