TreeMap
A free, open-source disk-space visualizer. Squarified treemap, duplicate hunting, disk-full forecasting, and cleanup that only ever moves files to the Trash.
翻译准备中
Sorty: free open-source AI folder organizer for macOS
翻译准备中
取自仓库 README
正在加载完整 README。
查看完整 README ↗A native macOS SwiftUI app that uses AI to organize files into relevant, semantically named folders.
Visit the Sorty website for the product overview, privacy details, comparisons, and latest release.
| Organize your workspace | Preview every move before applying it | Review duplicate files clearly |
sorty:// URL schemes for automation and shortcuts.Install the Sorty skill from onboarding or Settings > Features > Sorty Skill. Choose Codex, Claude Code, OpenCode, Pi, or a custom agent folder, then select which preferences and Learnings to import. Ask your agent to organize, rename, find exact duplicates, or restore recorded moves. These workflows run without the app; Finder integration and background watching still need the native app. See the Sorty skill guide for setup and safety rules.
.zip from the Releases page.Sorty.app to your /Applications folder.
Note: Moving the app to
/Applicationsis highly recommended. It ensures that security bookmarks for "Watched Folders" persist reliably across app restarts.
sudo xattr -cr /Applications/Sorty.app
Paste the command into Terminal, press Return, and enter your Mac password. Terminal does not show the password while you type it./Applications.[!NOTE] The command changes extended attributes only on the
Sorty.appcopy in/Applications, clearing the quarantine metadata that can block an unsigned app. Use it only for a copy downloaded from this repository.
Using Make (Recommended):
git clone https://github.com/sorty-organizer/Sorty.git
cd Sorty
make run
Using Xcode:
Sorty.xcodeproj in Xcode.Sorty scheme and your Mac as the destination.⌘R to build and run.Sorty includes Finder Integration as a core app feature:
[!IMPORTANT] The Finder extension requires App Groups to be configured in both the main app and extension targets using the identifier
group.com.sorty.app.
Sorty is designed with security and privacy in mind:
Data Handling:
Release Signing: Pre-built releases are NOT code-signed. You will need to remove macOS quarantine flags after installation (see Installation section). Build from source if you prefer complete control.
Best Practices:
For detailed security information, see SECURITY.md.
If you see an error indicating that access to a watched folder has been lost (e.g., "Permission Denied" or missing bookmarks):
/Applications folder.New installations use the version-independent Sorty.zip download. Move Sorty.app to /Applications; Sorty opens onboarding until setup is completed.
| Location | Responsibility |
|---|---|
Sources/SortyApp/ | SwiftUI lifecycle, windows, and background coordination |
Sources/SortyLib/ | App shell, organize flow, navigation, commands, and resources; re-exports the UI modules |
Sources/SortyUI/ | Shared SwiftUI components, AppState, and auxiliary windows |
Sources/Sorty*UI/ | Feature views in SortyPreviewUI, SortyHistoryUI, SortyRulesUI, SortyDuplicatesUI, SortyWatchedFoldersUI, SortySettingsUI, and SortyOnboardingUI |
Sources/SortyCore/ | Shared managers, view models, app services, and adapters for lower modules |
Sources/SortyOrganizer/ | FolderOrganizer, plan validation, and organization workflow |
Sources/SortyAI/ | Provider clients, prompts, model catalog, and response parsing |
Sources/SortyLearnings/ | Preference learning, profile storage, observation, and local rule inference |
Sources/SortyFS/ | Directory scanning, content and vision analysis, file operations, duplicates, and watching |
Sources/SortyModels/ | Data models, history, undo operations, and widget snapshots |
Sources/SortyFileSystem/ | File naming, hashing, and path primitives |
Sources/SortyFinderSync/, Sources/SortyWidgets/ | Finder Sync and WidgetKit extensions |
Sources/SortyQuality/, Sources/SortyQualitySupport/ | Organization quality CLI and support library |
Tests/SortyTests/, Tests/SortyUITests/ | Unit, integration, UI, and accessibility tests |
website/, scripts/ | Public Next.js website and build/automation scripts |
Sorty uses SwiftUI with MVVM and services. SortyApp creates shared managers and injects them into the view hierarchy. SortyLib composes the app shell from shared and feature UI modules. Feature modules compile separately so editing one view does not rebuild every SwiftUI module.
Arrows point from a module to its dependencies. The diagram shows the main layers; Package.swift lists all direct dependencies.
flowchart TD
App[SortyApp] --> Shell[SortyLib]
Shell --> Features["Feature UI modules<br/>Preview, History, Rules, Duplicates,<br/>Watched Folders, Settings, Onboarding"]
Shell --> UI["SortyUI<br/>Shared views and AppState"]
Features --> UI
UI --> Core["SortyCore<br/>Managers, services, and adapters"]
Core --> Organizer["SortyOrganizer<br/>Workflow and validation"]
Organizer --> AI["SortyAI<br/>Clients and prompts"]
Organizer --> Learnings["SortyLearnings<br/>Preferences and rules"]
Organizer --> FS["SortyFS<br/>Scanning and file operations"]
Learnings --> AI
AI --> Models["SortyModels<br/>Plans, history, and undo"]
Learnings --> Models
FS --> Models
Models --> Paths["SortyFileSystem<br/>File and path primitives"]
Widgets[SortyWidgets] --> Models
Each feature UI module depends on SortyUI. SortyHistoryUI also depends on SortyPreviewUI, and SortyWatchedFoldersUI depends on SortyHistoryUI. Shared views belong in SortyUI; cross-module implementation uses package access.
SortyCore connects lower modules to app services through injected hooks and adapters for Keychain, logging, analytics, notifications, and Finder integration. SortyModels depends only on SortyFileSystem; provider clients and network details stay in SortyAI.
Finder actions, sorty:// deeplinks, App Intents, menu bar actions, and watched-folder automation feed the app's organization workflow.
flowchart LR
Action[User or automation] --> State[View model or manager]
State --> Organizer[FolderOrganizer]
Organizer --> Scan["SortyFS<br/>Scan and analyze"]
Scan --> Request["SortyAI<br/>Build prompt and call provider"]
Learnings[Learnings context] --> Request
Request --> Plan[OrganizationPlan]
Plan --> Validate[Validate plan]
Validate --> Preview[Preview]
Preview --> Apply["SortyFS<br/>Apply file operations"]
Apply --> History[History and undo]
FolderOrganizer owns the state sequence idle → scanning → organizing → ready → applying → completed, including cancellation and error handling. AI clients implement AIClientProtocol and register with AIClientFactory.
Persistence uses files, UserDefaults/@AppStorage, security-scoped bookmarks, and Keychain. Finder and widget integration share data through the app group group.com.sorty.app; widgets read snapshots defined in SortyModels.
See the architecture guide for implementation patterns and startup performance guide for deferred loading rules.
We welcome contributions. See CONTRIBUTING.md for:
Please read our Code of Conduct before participating.
Blacksmith-backed GitHub Actions are the source of truth for commit, push, PR, and release confidence. The default Swift CI workflow runs security checks on Blacksmith Ubuntu and builds/tests/packages on Blacksmith macOS.
Prefer frequent small commits and pushes. Push each coherent change to the branch so Blacksmith validates the real PR state early; continue with follow-up commits when more work remains.
Use local commands only for fast diagnosis before pushing:
make dev # Fast debug build, no tests
make now # Fast debug build + launch, no tests
make daily # Optimized local build + launch, no tests
swift test --disable-sandbox --filter SortyTests.TestClass/testMethod
make ci, make test, and make test-full still exist for local troubleshooting, but they do not replace Blacksmith checks.
Run the reproducible filename, path, rename-rule, and AI response fuzzer with
bash scripts/fuzz.sh --seed 357813081177 --iterations 20000.
It compiles the production leaf sources without fetching app dependencies or
launching Sorty. See Fuzzing for coverage and replay.
Use make daily for everyday use or startup profiling. make now prioritizes
compile speed and leaves an unoptimized Debug app; make hot also embeds the
InjectionLite runtime. All three replace releases/Sorty.app, so run make daily
again after development to restore the optimized app.
For PRs and releases, rely on the GitHub Actions checks:
Tests are located in Tests/SortyTests/ and cover the following areas:
Key test files include:
SortyTests.swift - Core organization logicLearningsManagerTests.swift - Passive learning systemFinderIntegrationStatusTests.swift - Finder Sync diagnostics, registration parsing, and auto-repairStorageDestinationNormalizerTests.swift - Storage location path resolution and normalizationStorageLocationsReliabilityTests.swift - Storage validation and reliabilityPrivacyPathMaskerTests.swift - Privacy-sensitive path redactionCustomPersonaTests.swift - Persona managementDeeplinkTests.swift - URL scheme handlingSorty supports the sorty:// URL scheme for automation and external control:
| Deeplink | Description |
|---|---|
sorty://organize?path=<path>&persona=<id>&autostart=true | Start organization |
sorty://duplicates?path=<path>&autostart=true | Scan for duplicates |
sorty://learnings?action=stats | Open Learnings statistics |
sorty://settings?section=ai | Open specific settings section |
sorty://history | Open organization history |
sorty://history?entry=<uuid> | Open a specific history session |
sorty://persona?generate=true&prompt=<text> | Generate a persona |
sorty://watched?action=add&path=<path> | Add watched folder |
sorty://rules?action=add&pattern=<pattern> | Add exclusion rule |
sorty://help?section=<topic> | Open help section |
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.