sorty CLI Reference
Thesorty command-line tool provides comprehensive control over the Sorty application from your terminal. It uses URL schemes to communicate with the main app.
Installation
sorty CLI script to your system PATH.
Usage
Environment Variables
When set to
1, prints the URL instead of opening it (useful for debugging)Commands
organize
Start organizing a directory with AI-powered file sorting.Path to the directory to organize. Can be relative or absolute.
Persona ID to use for organization. Options:
general- Standard categories (Documents, Media, Archives)developer- Groups by project, language, tech stackphotographer- Organizes by shoots, dates, camera metadatamusic_producer- Projects, samples, stems, sessionsstudent- By subject, course, semesterbusiness- By client, project, fiscal period
Automatically start organization without manual confirmation
Examples
Behavior
- Resolves the path to an absolute directory path
- Validates that the path exists and is a directory
- Opens Sorty with the organization view
- URL format:
sorty://organize?autostart={true|false}&path={encoded_path}&persona={encoded_persona}
duplicates
Scan a directory for duplicate files using SHA-256 content hashing.Path to the directory to scan for duplicates
Automatically start scanning without manual confirmation
Examples
Output
Opens the Duplicates view in Sorty, where you can:- Review duplicate file groups
- Choose which copies to keep
- Delete duplicates with safe deletion enabled
status / health
View Workspace Health metrics and analysis.What You’ll See
- Space distribution by file type
- Clutter growth rate
- Empty folders
- Very old files (1+ year)
- Broken symlinks
- Duplicate candidates
- Cleanup opportunities
list
View all watched folders.sorty watched (with no arguments).
watched
Manage watched folders for automatic organization.Add a new directory to the watched folders list
Absolute or relative path to the directory to watch
Examples
exclusions
Manage exclusion rules to protect files from organization.Add a new exclusion pattern
Glob pattern or filename to exclude. Supports wildcards.
Examples
Common Patterns
| Pattern | Description |
|---|---|
*.log | All log files |
*.tmp | Temporary files |
.DS_Store | macOS metadata files |
node_modules/* | Node.js dependencies |
.git/* | Git repository data |
*.temp | Temp files |
Desktop.ini | Windows metadata |
storage
Manage storage locations for organized files.Add a new storage location
Path to the storage directory
Examples
settings
Open the Settings panel, optionally to a specific section.Specific settings section to open. Options:
rules- Exclusion rulesprovider- AI provider configurationstrategy- Organization strategytuning- AI tuning (temperature, etc.)automation- Watched folders and automationfinder- Finder integrationnotifications- Notification preferencesadvanced- Advanced settingstroubleshooting- Troubleshooting toolshelp- Help and support
Examples
persona
Manage organization personas.Open the persona creator interface
Generate a new persona using AI from a natural language description
Description of the persona you want to create
Examples
Generated Personas
The AI analyzes your description and creates:- Custom system prompt
- Appropriate folder structure preferences
- File type handling rules
- Tagging strategy
rules
Add an exclusion rule (alias forsorty exclusions add).
Glob pattern to exclude from organization
Examples
learnings
Open The Learnings dashboard for managing your AI learning profile.- View learned preferences
- Start honing sessions
- Review corrections and feedback
- Manage learning data
history
View organization history and perform reverts.- Past organization sessions
- Files moved in each session
- Revert options (Undo with ⌘Z)
- Safe deletion recovery
help
Show CLI help message.update
Check for Sorty updates.Update Process
- Queries GitHub Releases API
- Compares installed version with latest release
- Shows release notes if update available
- Provides download link
version
Show the installed version of Sorty.Output Format
/Applications/Sorty.app/Contents/Info.plist.
Error Handling
The CLI provides clear error messages for common issues:Path Errors
Missing Arguments
Unknown Options
Extra Arguments
URL Encoding
The CLI handles special characters in paths and arguments:- Spaces:
My Documents→My%20Documents - Special chars:
/path/with spaces & symbols/→ URL-encoded - Unicode: Properly encoded for URL schemes
urllib.parse.quote).
Integration Examples
Shell Aliases
Git Hooks
Cron Jobs
Alfred Workflow
Requirements
- macOS 15.0+ (Sequoia)
- Sorty.app installed at
/Applications/Sorty.app - Python 3 (for URL encoding)
- Bash shell
Troubleshooting
Command Not Found
Python 3 Not Found
App Not Opening
Dry Run Mode
See Also
- learnings CLI Reference - The Learnings CLI tool
- Deeplinks Overview - URL scheme reference
- Personas - Persona customization guide