Skip to content
 
 

Repository files navigation

OneDisk

OneDisk

看清磁盘占用、增长来源,并安全地一键清理可再生成缓存。

Understand disk usage, trace what is growing, and safely clean regenerable caches in one click.

English · 下载最新版本 · 清理引擎研究

中文

OneDisk 是一款免费、开源、原生的 macOS 磁盘空间分析与安全清理工具,支持 macOS Sonoma 14 及以上版本。它基于 Radix 深度改造,默认提供更聚焦的逐层浏览方式,同时保留原始 Radix 的全深度 Treemap、Sunburst 和文件表格。

核心功能

  • 一键安全清理:按系统垃圾、应用缓存、浏览器缓存、开发者缓存聚合结果;只默认选中明确可再生成的安全项,未知应用缓存和浏览器缓存必须手动确认。
  • 通用 Mac 清理:发现用户级应用缓存、旧日志、诊断报告和主流浏览器缓存,同时继续保留开发者缓存优势。
  • 大文件排行:直接复用已完成的空间扫描,按 100 MB / 500 MB / 1 GB / 5 GB 门槛与文件类型筛选视频、安装包、App、开发产物和其他大文件。
  • 实时扫描进度:空间占用、大文件、增长和清理都显示真实百分比与当前阶段;切换页面后仍可从侧边栏跟踪同一个扫描任务。
  • 完整安全链路:清理前重新验证规则边界、symlink、文件系统 device/inode、时间条件和相关运行进程;执行只进入 macOS 废纸篓,不提供永久删除。
  • 清理后复核:区分候选的名义大小与清理前后可用空间变化,避免把 APFS 克隆、硬链接或可清除空间误报为真实释放量。
  • 磁盘空间分析:左侧按大小排序,右侧展示当前文件夹的一层 Treemap;点击文件夹继续深入,不一次铺满整棵目录树。
  • 完整面包屑:从物理卷根目录一直显示到当前文件夹;点击任意层级即可返回或重新扫描该位置。
  • 多磁盘切换:侧边栏列出当前挂载的磁盘卷,可直接切换扫描目标。
  • 先回答“多出来的空间去哪了”:打开增长页就能直接使用历史快照,不必先重新扫描;整盘 APFS 变化与可归因的文件夹变化分开显示。
  • 逐层增长归因:按净增长排序具体路径,并显示上次大小、当前大小与变化量;点击路径后用完整面包屑继续下钻,增长 Treemap 的面积代表增长量。
  • 开发者缓存识别:识别 Xcode、包管理器、浏览器运行时等可再生成缓存,同时把源码、Git 数据和个人内容明确标为受保护。
  • 经典视图:可切换到原 Radix 的全深度 Treemap 或 Sunburst。
  • 报告与 Codex:清理、空间、增长和大文件结果都可复制或导出为 Markdown/TXT,也可复制后直接打开 Codex。
  • 日常入口:菜单栏显示剩余空间,支持开机启动和用户主动开启的定时扫描。定时任务始终扫描用户选定的同一磁盘、只记录历史,不会后台清理。
  • 多语言:英语、简体中文、德语、西班牙语、法语和意大利语。

清理安全模型

OneDisk 没有引入第二套宽泛的“万能清理器”。清理功能采用单向、可审计的原生 Swift 管线:

CleanupCatalog 明确路径与风险
  → CleanupScanner 定向测量(不跟随 symlink、不跨卷、hard-link aware)
  → CleanupPlan(安全 / 需确认 / 受保护)
  → 用户确认
  → CleanupExecutor 再校验 path + identity + mtime + process
  → macOS Trash
  → CleanupReceipt + 可用空间复核

安全策略与开发缓存分类选择性适配自 BSD-3-Clause 许可的 MacSai。执行回执、分阶段交互和清理后复核参考了 MIT 项目 MacSift 与 ClearDisk 的设计思路,但删除入口由 OneDisk 独立实现并测试。

下列内容不会被一键清理:Downloads、照片、影片、Mail、Messages、应用容器文档、Chrome profile、项目源码、Git worktree、Xcode Archives、CoreSimulator 设备、Codex 会话、数据库、备份和废纸篓内容。

安装

  1. GitHub Releases 下载最新 DMG。
  2. 打开 DMG,将 OneDisk 拖到 Applications
  3. 第一次打开后,可按需授予“完全磁盘访问权限”,以扫描受 macOS 隐私保护的位置。

扫描与增长历史只保存在本机。报告在本机生成。“复制并打开 Codex”只会把报告复制到剪贴板并启动 Codex,不会由 OneDisk 上传数据。

构建与测试

需要 Xcode 26 或更新版本及 Swift 6.2+:

git clone https://github.com/OneApps-Studio/OneDisk.git
cd OneDisk
swift test
xcodebuild \
  -project OneDisk.xcodeproj \
  -scheme OneDisk \
  -configuration Debug \
  -destination 'platform=macOS' \
  build

OneDiskCore 不依赖第三方 Swift Package。发布前请同时运行完整 Swift 测试、Debug/Release 构建、签名校验和真实应用交互检查。 签名、公证与 Universal DMG 的完整流程见 发布说明

项目结构

OneDisk/
├── OneDisk/
│   ├── App/                 # App 场景、菜单栏、开机启动与定时扫描
│   ├── CleanupKit/          # 清理目录、扫描、计划、安全门、执行与回执
│   ├── Features/            # 空间、增长、清理、报告、设置与交互
│   ├── Models/              # 扫描树、历史、增长与面包屑模型
│   ├── Services/            # 扫描、比较、持久化、系统操作与报告
│   └── ViewModels/          # 主状态与导航协调
├── OneDiskCoreTests/
├── scripts/
├── Package.swift
└── OneDisk.xcodeproj/

English

OneDisk is a free, open-source, native macOS disk analyzer and safety-first cleaner for macOS Sonoma 14 and later. It is a substantial fork of Radix. OneDisk makes focused, folder-by-folder navigation the default while keeping Radix’s original full-depth Treemap, Sunburst, and file table as the Classic view.

Highlights

  • One-click safe cleanup: groups System Junk, Application Caches, Browser Caches, and Developer Caches. Only explicitly regenerable safe items are selected by default.
  • General Mac cleanup: discovers user application caches, old logs, diagnostics, and major browser caches without losing developer-specific coverage.
  • Large-file ranking: reuses completed storage scans and filters videos, installers, apps, developer artifacts, and other files at 100 MB / 500 MB / 1 GB / 5 GB thresholds.
  • End-to-end validation: rechecks the cleanup rule boundary, symlinks, filesystem device/inode, age requirements, and related running processes immediately before execution.
  • Trash only: cleanup uses the native macOS Trash. There is no permanent-delete mode and no fallback to rm.
  • Post-clean verification: reports nominal candidate size separately from the observed change in available disk capacity.
  • Focused disk analysis: folders are sorted by size beside a one-level interactive Treemap. Enter a folder to redraw both views for that folder.
  • Complete breadcrumbs: navigation starts at the physical volume root and continues to the current folder.
  • Multiple disks: mounted volumes appear in the sidebar and can be selected directly.
  • Answer “where did the extra space go?” first: Growth opens directly from saved history, without forcing a new scan, and separates APFS volume change from attributable folder change.
  • Drill-down growth attribution: ranks concrete paths by net change, shows before/current/delta, and lets users follow full breadcrumbs into a Treemap whose area represents growth.
  • Developer-cache awareness: identifies regenerable Xcode, package-manager, and browser-runtime caches while marking source code, Git data, and personal content as protected.
  • Classic Radix view: the original full-depth Treemap and Sunburst remain available.
  • AI-ready reports: copy or export cleanup, storage, growth, and large-file reports as Markdown/TXT, or copy and open Codex.
  • Everyday convenience: menu bar free-space status, launch at login, and opt-in scheduled scans. Scheduled work always scans the same user-selected disk, records history only, and never cleans in the background.
  • Localized UI: English, Simplified Chinese, German, Spanish, French, and Italian.

Safety architecture

Explicit CleanupCatalog
  → targeted CleanupScanner (no symlink following, no volume crossing, hard-link aware)
  → CleanupPlan (Safe / Review / Protected)
  → user confirmation
  → CleanupExecutor revalidates path + identity + mtime + process
  → native macOS Trash
  → CleanupReceipt + available-capacity verification

OneDisk selectively adapts its safety guard and developer-cache taxonomy from BSD-3-Clause-licensed MacSai. Receipt, staged interaction, and post-clean verification ideas were informed by the MIT projects MacSift and ClearDisk; OneDisk independently implements and tests its deletion boundary.

Downloads, photos, movies, Mail, Messages, application-container documents, Chrome profiles, source code, Git worktrees, Xcode Archives, CoreSimulator devices, Codex sessions, databases, backups, and Trash contents are never part of one-click cleanup.

Install

Download the latest DMG from GitHub Releases, open it, and drag OneDisk to Applications.

Scans and growth history stay on the Mac. Reports are generated locally. “Copy and Open Codex” copies the report to the pasteboard and activates Codex; OneDisk does not upload it.

Build and test

OneDisk requires Xcode 26 or later with Swift 6.2+.

git clone https://github.com/OneApps-Studio/OneDisk.git
cd OneDisk
swift test
xcodebuild \
  -project OneDisk.xcodeproj \
  -scheme OneDisk \
  -configuration Debug \
  -destination 'platform=macOS' \
  build

OneDiskCore has no external package dependencies. See the release process for the signed, notarized Universal DMG workflow.

Attribution and license

OneDisk is based on Radix by Colin Kim and adapts selected MacSai safety/catalog code. Original MIT and BSD notices are preserved in THIRD_PARTY_NOTICES.md.

OneDisk is released under the MIT License. Contributions are welcome.

About

Modern, extremely fast macOS disk space analyzer.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages