AI File Sorter

AI File Sorter is a cross-platform desktop application that uses AI to organize files and suggest cleaner, more consistent names for images, documents, and supported audio/video files. It is designed to reduce clutter, improve consistency, and make files easier to find later, whether for review, archiving, or long-term storage.
The app can analyze picture files locally with built-in visual LLM backends and suggest meaningful, human-readable names. For example, a generic file like IMG_2048.jpg can be renamed to something descriptive such as clouds_over_lake.jpg. It can also analyze supported document files and propose clearer names based on their text content. AI File Sorter can also clean up messy audio and video filenames by using the metadata already stored inside supported media files. If tags such as year, artist, album, or title are available, the app can turn them into a clear suggestion like 2024_artist_album_title.mp3, which you can review, edit, or ignore before any change is applied.
AI File Sorter helps tidy up cluttered folders such as Downloads, external drives, or NAS storage by grouping files based on their names, file types, folder context, and past sorting results.
Instead of relying only on fixed rules, the app combines AI suggestions with optional whitelists, recent similar results, and your approved review decisions. This helps keep sorting more consistent over time while still letting you review and adjust everything before anything is changed.
Categories (and optional subcategories) are suggested for each file, and for supported file types, rename suggestions are provided as well. Once you confirm, the required folders are created automatically and files are sorted accordingly.
You can also sort into an existing folder structure, choose a separate destination,
and decide whether the app may suggest new folders. Starter structures and optional
folder-structure plugins help you set up and maintain archives such as Johnny.Decimal.
Privacy-first by design:
AI File Sorter can run entirely on your device. With local text and visual models and online photo place lookup disabled, analysis inputs stay on your computer, and no telemetry is sent.
Enabling Add photo date and place to filename (if available) sends photo GPS coordinates, rounded to three decimal places, to OpenStreetMap’s Nominatim service to obtain place names, even with local models. The provider can also see your IP address and request time. This lookup sends no photo files, filenames, or capture dates. Date-only category enrichment stays local.
API connections send analysis data to the configured server; selecting an API visual backend also sends image contents there. A server on your own computer can work without public internet access.
How It Works
- Point the app at a folder or drive
- Files (and image content, when applicable) are analyzed using the selected local or remote model
- Category and rename suggestions are generated
- You review and adjust if needed before anything is changed
Hover over sorting controls, checkbox labels, or filename-length sliders for
plain-language explanations. Settings-menu entries also show help when hovered.
These explanations follow the interface language.
Sorting stray files into existing folders
This Windows walkthrough follows 60 files from Downloads into an existing library.
It shows folder routing, a destination correction, a dry-run preview, and confirmed
moves. Pauses at the key steps make the 44-second loop easier to follow; long
processing waits are omitted.
See the Windows screenshot gallery for all eight
steps in English and French, including model selection, analysis, review, and
the organized library.
Safe First Run
If you are trying AI File Sorter for the first time, start with a small test folder instead of a full archive or drive. Copy 20-50 files from Downloads, screenshots, photos, or documents into a temporary folder, run the analysis, and inspect the review table before applying anything.
This keeps the first run low risk: your files stay on your computer when you use local models, the AI only suggests categories and filenames, and no move or rename happens until you approve it. If you do apply changes and then want to reverse them, use Edit -> Undo last run.


Technical reference
The main README stays focused on installation, features, and normal everyday
use. For contributor-facing and integration-facing details that are too deep for
the main entry page, use these technical references:
Changelog
See what’s new in 2.0.0 for the latest release
highlights, or the full changelog for earlier releases.
Features
- AI-powered categorization: Sort files using either local AI models on your computer or remote models with your own API key.
- Flexible destinations: Generate category folders or sort into an existing folder structure, with a separate destination and optional new-folder suggestions.
- Folder structures and plugins: Create starter layouts and add optional Johnny.Decimal guidance, numbered-folder tools, archive indexes, and validation reports.
- Offline-Friendly: Use a local LLM to categorize files entirely - no internet or API key required.
- Robust categorization: Built-in rules and category matching help keep results more consistent across runs.
- Configurable categorization controls: Use whitelists, taxonomy normalization, consistency modes, and review-time edits to steer categories and subcategories.
- Two categorization modes: Pick More Refined for more specific labels with less pressure to stay in broad default categories, or More Consistent for steadier top-level categories across similar files.
- Category whitelists: Define named whitelists of allowed categories/subcategories, including smart branching lists where each main category has its own allowed subcategories. Manage them under Settings → Manage category whitelists…, then toggle/select them in the main window when you want to constrain model output for a session.
- Category and rename languages: Categories are chosen in English behind the scenes and then shown in your selected category language. Suggested filenames for images, documents, and supported audio/video files are localized the same way. The available languages depend on the selected local model.
- Custom local LLMs: Register your own local GGUF models directly from the Select LLM dialog. Add a matching MMProj file to make a custom model available for image analysis as well.
- Grouped model selection: The Select LLM dialog has a Local LLMs tab for built-in models and custom GGUF files, and an API connections tab for Gemini, OpenAI, and custom OpenAI-compatible endpoints. Each tab uses a dropdown and shows the selected option’s description and settings.
- Image content analysis (Visual LLM): Analyze supported picture files with built-in visual backends including the default Qwen3.5 4B, Gemma 3 4B IT, and LLaVA 1.6 Mistral 7B, with special handling for screenshots and UI captures so categories describe on-screen content more accurately (rename-only mode supported).
- Image date-to-category suffix (optional): Append image creation date metadata to image category names when available.
- Document content analysis (Text LLM): Analyze supported document files to summarize content and suggest filenames; uses the same selected LLM (local or remote).
- Filename length controls: Set independent maximum word limits for image and document name suggestions, from 3 to 6 words, defaulting to 3.
- Audio/video metadata filename suggestions: Turn embedded media tags into clean, library-style filenames for supported audio and video files, with full review before anything is renamed.
- Sortable review: Sort the Categorization Review table by file name, category, or subcategory to triage faster.
- Qt6 Interface: Lightweight and responsive UI with refreshed menus and icons.
- Interface languages: English, Danish, Dutch, Finnish, French, German, Hindi, Icelandic, Italian, Korean, Norwegian, Polish, Portuguese (Portugal), Russian, Simplified Chinese, Spanish, Swedish, Turkish, and Ukrainian.
- Cross-Platform Compatibility: Works on Windows, macOS, and Linux.
- Windows File Explorer integration: Use the separately installed AI File Sorter for File Explorer extension to analyze selections and review changes. Extension version 1.1.0 uses the sorting and filename settings available in AI File Sorter 2.0.0. Legacy 1.0.x Explorer jobs retain generated-category sorting so their review destinations and category edits remain compatible.
- Local Database Caching: Speeds up repeated categorization, preserves approved labels and rename suggestions, and provides recent-category hints for consistency.
- Local learning from approved reviews: Approved category decisions can be stored locally and reused as hints for future runs without modifying the underlying model.
- Cache maintenance tools: Use Settings → Clear cache… to inspect and clear categorization cache, image location cache, and logs, or Settings → Reset learned behavior… to remove the separate learned-review database.
- Sorting Preview: See how files will be organized before confirming changes.
- Dry run / preview-only mode to inspect planned moves without touching files.
- Persistent Undo (“Undo last run”) even after closing the sort dialog.
- Project-folder protection: Recursive scans skip recognized structured project roots such as Unity, Unreal, Godot, Blender project folders, Git repositories, and common source-code projects so files that depend on project-relative paths are not moved independently.
- Bring your own remote credentials: Store your OpenAI key, Gemini key, or custom OpenAI-compatible endpoint details locally for reuse in later runs.
- Update Notifications: Get notified about updates - with optional or required update flows.
- Storage plugin support: Install provider-specific compatibility modes from the Plugins menu when the app detects supported cloud-backed folders.
- In-app help: Open the localized Help → Quick Start Guide for a guided walkthrough or Help → FAQ for troubleshooting and common questions.
Categorization
Sorting modes and destinations
Choose whether the app should generate category folders or place files into an
existing folder structure. You can use the analyzed folder as the destination or
select a separate destination folder.
In existing-folder mode, the app considers the destination’s folder names and
structure when choosing a target. Enable Suggest new folders when needed if
you want it to propose missing folders. Review the target folder and routing
explanation before applying changes; rename-only entries stay in their source folder.
When you select existing-folder sorting with another local model, the app recommends
Qwen3.5 4B for more reliable folder choices. Gemma 1.1 7B and models accessed
through an API are also suitable choices and do not trigger this advisory. The
recommendation is informational; you can keep your current model. The app also
checks after accepting an LLM selection while existing-folder sorting is active.
Open Sorting rules… to adjust categorization preferences and the separate
image and document filename word limits. Both limits range from 3 to 6 words and
default to 3. You can edit each suggested name during review.
Folder structures and plugins
Use Create folder structure… to preview and create an available starter
layout. Johnny.Decimal support includes tools for creating the next numbered
folder, browsing an archive index, and checking the archive for structural issues.
Optional folder-structure plugins provide additional guidance for supported
archives. Install and manage them from the Plugins menu. The app can suggest
Johnny.Decimal support when it recognizes a matching archive; some plugins require
a separate license and activation.
Existing-folder sorting supports destination folders up to eight levels below
the selected destination root. The app checks the destination in the background
and checks it again before analysis. If a deeper folder is found, select a more
specific destination root or reorganize the indicated branch before starting.
Sorting styles
- More refined: The flexible, detail-oriented mode. It is less tied to the default category structure, so it can choose a more specific top-level category when that fits better. For example:
Security / PCI DSS, Manuals / Camera Guides, or Wildlife / Lions. This works well for mixed, specialized, or long-tail folders.
- More consistent: The uniform mode. It uses recent similar results to favor stable broad folder categories, so related files are more likely to land under the same top-level folders. For example:
Documents / PCI DSS, Documents / Camera Guides, or Images / Lions. This works well when you want a cleaner, more uniform folder layout.
- Switch between the two via the Sorting style radio buttons in Sorting rules…; your choice is saved for the next run.
Example without a whitelist:
More refined
- pci_dss_quick_reference.pdf -> Security / PCI DSS
- camera_setup_manual.pdf -> Manuals / Camera Guides
- lion_photo.jpg -> Wildlife / Lions
More consistent
- pci_dss_quick_reference.pdf -> Documents / PCI DSS
- camera_setup_manual.pdf -> Documents / Camera Guides
- lion_photo.jpg -> Images / Lions
Category language selection
- Category labels are chosen in English first behind the scenes, then shown in the category language you selected under Settings → Category language.
- Suggested filenames for image, document, and supported audio/video rename flows are also localized into the selected Settings → Category language target before review/apply.
- Image and document naming prompts initially request English descriptive words while preserving proper nouns and identifiers. The desktop app can then localize the suggestions before review.
- The list is model-dependent for built-in local models. Gemma 3 4B IT, Qwen3.5 4B, and Custom local models expose the full app-supported category-language list. Legacy Mistral 7B configurations expose a smaller supported subset, and Gemma 1.1 7B stays English-only.
- When the supported list is long, the menu is grouped into alphabetical submenus to keep it usable on smaller screens.
Category whitelists
- In Create category folders mode, enable Use a whitelist to limit suggested category and subcategory names. Whitelists are disabled and ignored in Use existing folder structure mode; switching modes preserves your saved whitelist preference.
- Manage lists (add, edit, remove) under Settings → Manage category whitelists…. Built-in
Default and Documents lists are auto-created only when no lists exist, and multiple named lists can be kept for different projects.
- The whitelist editor has three sections. Main categories / top-level folders defines the destination category folders. Global subcategories defines subcategories that may be used under any main category. Category-specific subcategories defines smart branching rows where each main category has its own allowed subcategories.
- Global subcategories and Category-specific subcategories are alternatives. If you enter values in one section, the other section is disabled/ignored for that whitelist so the app does not mix two incompatible constraint styles.
- Smart branching is useful when the same broad top-level folders should contain different allowed subfolders. For example,
Documents -> Invoices, Receipts, Taxes and Images -> Screenshots, Photos tells the app that Screenshots is valid under Images, but not under Documents.
- The built-in
Documents whitelist uses smart branching: the only top-level category is Documents, while topics such as invoices, receipts, taxes, contracts, reports, and notes are stored as Documents subcategories.
- Narrow whitelists are still easiest for smaller local models, but large whitelists no longer need to dump every label into every prompt. When needed, the app reduces large and smart branching whitelists to relevant candidates plus valid category/subcategory pair guidance.
- In category-folder mode, whitelists work with both More refined and More consistent sorting styles. Pair them with More consistent for the strongest adherence to a constrained vocabulary.
Image analysis (Visual LLM)
Image analysis can run locally to understand what a picture shows and suggest a better category or filename. It does not require an API key.
Qwen3.5 4B is the default local text and visual backend and appears first in model selection, marked Recommended. Its description highlights high precision and its suitability for sorting into existing folder structures. The app also gives screenshots, webpage captures, dashboards, forms, mockups, and other UI-like images extra prompt guidance so categories describe what is shown on screen instead of misclassifying the image as the software artifact itself.
The app exposes three built-in visual backends: the default Qwen3.5 4B, Gemma 3 4B IT, and LLaVA 1.6 Mistral 7B. All supported local visual backends require two GGUF files: the main text model and a matching mmproj projector file.
The Gemma 3 4B IT GGUF is also available as a built-in local text/categorization model. When used only for categorization or document analysis, it runs as a normal text model and does not need mmproj. If you already downloaded the Gemma 3 text GGUF for image analysis, the local text-model entry reuses that same file automatically. The extra mmproj file is only required for visual image analysis.
Custom local GGUF models can also be used for image analysis when their custom LLM entry includes a matching MMProj file. Those entries appear in the Visual model selector as custom visual backends and use the files you selected instead of the built-in download controls.
You can also use a vision-capable OpenAI-compatible API connection, including a local llama.cpp, LM Studio, or Ollama server. Add or edit the connection in Select LLM, check Vision-capable model, then expand Downloads and choose Connection: <name> in Image analysis models → Visual model. Click OK and enable image-content analysis in the main window. The text/categorization model and visual model are selected independently. Existing API connections require this explicit vision opt-in. Enabling Vision-capable model opens an OK / Cancel notice explaining that images will be sent to the configured server. Cancel leaves the option off. Saved enabled connections do not prompt again during scans.
For an API visual backend, AI File Sorter sends the image contents to that connection; the server must already have a vision model and any required projector loaded. No local GGUF or MMProj download is required in AI File Sorter. Requests use /chat/completions with an embedded PNG image, resized to at most 1536 pixels on its longest side with orientation applied and source metadata removed. A second, text-only request creates the filename from the description. Original file extensions and the configured filename word limit are preserved. API keys are optional for servers that do not require authentication, and AI_FILE_SORTER_CUSTOM_LLM_TIMEOUT applies to each request (60 seconds by default).
Required visual LLM files
The Select LLM dialog includes an “Image analysis models” section with backend-specific downloads:
- Visual text model (GGUF): The language model that produces the description and the filename suggestion.
- Matching
mmproj file (GGUF): The multimodal projector that maps image embeddings into the model token space so the backend can accept images.
Both files are required for a local visual backend. API visual backends use the server’s model instead. If either local file is missing, image analysis is disabled and the app will prompt to open the Select LLM dialog to download them. The download URLs can be overridden with backend-specific environment variables such as LLAVA_MODEL_URL / LLAVA_MMPROJ_URL, GEMMA3_4B_MODEL_URL / GEMMA3_4B_MMPROJ_URL, or QWEN35_4B_MODEL_URL / QWEN35_4B_MMPROJ_URL (see Environment variables).
Download sections show file size, status, and actions. Expand See details for a file’s download URL, local path, model identifier, file type, runtime, and download URL setting. Details are collapsed by default, and long values wrap within the dialog.
The same dialog also includes Model storage, which changes where built-in local text and visual model downloads are stored. Leave it empty to use the platform default.
Main window options
Image analysis adds six related checkboxes to the main window:
- Analyze picture files by content: Runs the visual LLM on supported picture files and reports progress in the analysis dialog.
- Process picture files only (ignore any other files): Restricts the run to supported picture files. File sorting remains available; folder sorting and options for other file types are disabled.
- Add image creation date (if available) to category name: Appends
YYYY-MM-DD from image metadata to the category label when available. Disabled when rename-only is enabled.
- Add photo date and place to filename (if available): Adds date/place prefixes when available. Dates are read locally; online place lookup sends photo GPS coordinates rounded to three decimal places to OpenStreetMap’s Nominatim service. Leave this option off to keep photo locations local, including when adding dates to category names.
- Offer to rename picture files: Shows a Suggested filename column in the Review dialog with the visual LLM proposal. You can edit it before confirming.
- Rename pictures without moving: Skips text categorization for images and keeps them in place while applying (optional) renames.
The separate top-level checkbox Add audio/video metadata to file name (if available) controls metadata-based rename suggestions for supported audio/video files. See Audio/video metadata filename suggestions.
Document analysis (Text LLM)
Document analysis uses the same selected LLM (local or remote) to extract text from supported document files, summarize content, and optionally suggest a better filename. No extra model downloads are required.
- Plain text:
.txt, .md, .rtf, .csv, .tsv, .json, .xml, .yml/.yaml, .ini/.cfg/.conf, .log, .html/.htm, .tex, .rst
- PDF:
.pdf (embedded PDFium by default for upstream builds; distro builds default to the pdftotext CLI fallback)
- Office/OpenOffice:
.docx, .xlsx, .pptx, .odt, .ods, .odp (embedded libzip+pugixml in bundled builds; CLI fallback uses unzip if you build without vendored libs)
- Legacy binary formats like
.doc, .xls, .ppt are not currently supported.
Source builds: embedded extractors are used by default. If the vendored PDFium artifacts are missing for your target platform, CMake now fails loudly instead of silently disabling PDF content extraction. Use -DAI_FILE_SORTER_PDF_BACKEND=pdftotext for the CLI fallback, system-pdfium for a distro-provided PDFium, or auto to try PDFium and fall back to pdftotext.
Main window options (documents)
- Analyze document files by content: Extracts document text and feeds it into the LLM for summary + rename suggestion.
- Process document files only (ignore any other files): Restricts the run to supported document files. File sorting remains available; folder sorting and options for other file types are disabled.
- Offer to rename document files: Shows a Suggested filename column in the Review dialog with the LLM proposal. You can edit it before confirming.
- Rename documents without moving: Skips text categorization for documents and keeps them in place while applying (optional) renames.
- Add document creation date (if available) to category name: Appends
YYYY-MM from metadata when available. Disabled when rename-only is enabled.
Let AI File Sorter turn embedded media tags into clean, consistent filenames for your music and video library. When enabled, the app reads supported metadata fields and builds a polished suggested name in the format year_artist_album_title.ext. As with all rename suggestions, nothing is changed until you review and confirm it.
- Audio extensions:
.aac, .aif, .aiff, .alac, .ape, .flac, .m4a, .mp3, .ogg, .oga, .opus, .wav, .wma
- Video extensions:
.3gp, .avi, .flv, .m4v, .mkv, .mov, .mp4, .mpeg, .mpg, .mts, .m2ts, .ts, .webm, .wmv
- Built-in tag readers currently cover MP3 (
ID3v1/ID3v2), FLAC (Vorbis comments), OGG/OGA/Opus (Vorbis comments), and MP4-family containers such as .m4a, .mp4, .m4v, .mov, and .3gp (MP4/MOV metadata atoms).
- When compiled with package-managed
MediaInfoLib, the same rename flow can also use metadata exposed by MediaInfo for additional supported containers when available.
System compatibility check
The System compatibility check runs a quick benchmark that estimates how well your system can handle:
- Categorization with downloaded built-in models and registered custom GGUF models
- Document analysis by content
- Image analysis (visual LLM)
You can launch it from the menu (File → System compatibility check…). It runs when any built-in, custom GGUF, or visual model is available, regardless of the selected text or visual model. A completed check prevents future automatic prompts; stopping an initial check does not mark it completed. You can rerun it manually after changing models or hardware.
What it does:
- Detects available CPU threads and GPU backends (CUDA, Vulkan, and Metal)
- Times a small categorization and document-analysis workload per available local text model
- Times an image-analysis pass for every installed built-in or custom visual model with both a valid model file and its matching projector
- Reports speed tiers (optimal / acceptable / a bit long) and suggests a recommended local LLM
Results are tracked separately for every model/backend pair, including every available image-analysis model. Custom visual rows show the registered model’s name. Changing the selected visual model does not discard other models’ measurements or prevent their retries. Failed pairs are excluded from recommendations; a successful CPU, CUDA, Vulkan, or Metal result for the same model remains eligible. Recommendations show the backend alongside the model name. In existing-folder sorting mode, local recommendations are limited to Qwen3.5 4B and Gemma 1.1 7B. The benchmark measures local performance, not API service speed or folder-routing accuracy.
Use the Backend dropdown to choose a specific backend or All available backends. Automatic tries the preferred GPU first and tests CPU separately if the GPU attempt fails. Explicit backend tests never count a silent CPU fallback as a GPU success. Only backends available in the running app can be measured.
Select a row in the results table to Retry selected, or use Retry failed to rerun only failed pairs. Try chosen backend tests the selected model using the backend chosen above. Retrying replaces that pair’s latest measurement and preserves other pairs. Results and retry choices survive reopening the dialog. Changed or removed model files invalidate their previous measurements when the next check starts.
The check shares the analysis runtime lock and cannot run alongside active analysis. Finish the active job before starting the check. Stop Benchmark or Escape requests a stop after the current step, with temporary files cleaned up when the worker finishes.
Qwen3.5 4B uses the same default speed targets as Gemma 4B: 2/5 seconds per categorization and 4/7 seconds per document for the optimal/acceptable limits. Override these with BENCH_CAT_LOCAL_QWEN35_4B_OPTIMAL_MAX, BENCH_CAT_LOCAL_QWEN35_4B_ACCEPTABLE_MAX, BENCH_DOC_LOCAL_QWEN35_4B_OPTIMAL_MAX, and BENCH_DOC_LOCAL_QWEN35_4B_ACCEPTABLE_MAX. Values must be finite positive seconds.
Tip: quit CPU/GPU‑intensive apps before running the check for more accurate results.
Requirements
- Operating System: Linux, macOS, or Windows. Linux/macOS source builds use the Makefile flow below; Windows source builds use the native Qt/MSVC + CMake flow in the Windows section. HTTPS uses maintained platform trust: distribution CA certificates on Linux, Secure Transport on macOS, and Schannel with strict revocation on Windows. The app ships no static CA bundle. Windows builds verify the active linked backend and loaded DLL path.
- Compiler: A C++20-capable compiler (
g++ or clang++ on Linux/macOS, MSVC 2022 on Windows).
- Qt 6: Core, Gui, Widgets modules and the Qt resource compiler (
qt6-base-dev / qt6-tools on Linux, brew install qt on macOS, or a Qt 6 MSVC kit / qtbase via vcpkg on Windows).
- Libraries:
curl, sqlite3, fmt, spdlog, libmediainfo (required for full source builds), and the prebuilt llama libraries shipped under app/lib/precompiled on Linux/Windows or app/lib/precompiled-* for macOS variant builds. On Windows, these non-Qt libraries are supplied through the app/vcpkg.json manifest.
- MediaInfo policy: MediaInfo must be installed through a package manager (
apt/dnf/pacman/brew/vcpkg). The build rejects vendored MediaInfo submodules and checked-in binaries.
- Document analysis libraries: PDFium, libzip, and pugixml. PDFium is embedded by default for upstream builds so PDF extraction stays in-process on Windows, macOS, and Linux. Set
-DAI_FILE_SORTER_PDF_BACKEND=pdftotext for the CLI fallback or -DAI_FILE_SORTER_PDF_BACKEND=system-pdfium when a distro ships a compatible PDFium package.
- Optional GPU backends: CUDA 12.x for NVIDIA cards or a Vulkan 1.2+ runtime. On Windows installer/standalone builds,
aifilesorter.exe auto-detects the best available backend and now prefers CUDA over Vulkan when both are available, falling back to CPU/OpenBLAS automatically. On Linux, the same applies through run_aifilesorter.sh; when a dedicated CPU runtime bundle is absent, the launcher can also reuse the staged Vulkan payload for CPU/OpenBLAS fallback, so CUDA is never required to run the app.
- Git (optional): For cloning this repository. Archives can also be downloaded.
- Remote model credentials (optional): Required only when using ChatGPT, Gemini, or a custom OpenAI-compatible API endpoint.
Installation
File categorization with local LLMs is completely free of charge. If you prefer to use a remote workflow (ChatGPT, Gemini, or a custom OpenAI-compatible endpoint) you will need your own API credentials or endpoint configuration with a suitable quota or local server setup (see Using your OpenAI API key, Using your Gemini API key, or Using a custom OpenAI-compatible API).
Linux
HTTPS uses the distribution’s certificate trust store. Install and keep the
ca-certificates package updated, including when running a tarball or a manual
source install. Debian and RPM packages declare this runtime dependency.
Prebuilt Debian/Ubuntu package
- Install runtime prerequisites (Qt6, networking, database, math libraries):
- Ubuntu 24.04 / Debian 12:
sudo apt update && sudo apt install -y \
libqt6widgets6 libcurl4 libjsoncpp25 libfmt9 libopenblas0-pthread \
libvulkan1 mesa-vulkan-drivers patchelf
- Debian 13 (trixie):
sudo apt update && sudo apt install -y \
libqt6widgets6 libcurl4t64 libjsoncpp26 libfmt10 libopenblas0-pthread \
libvulkan1 mesa-vulkan-drivers patchelf
If you build the Vulkan backend from source, install glslc (Debian/Ubuntu package: glslc; on some distros: shaderc or shaderc-tools).
On Debian 13, use libjsoncpp26, libfmt10, and libcurl4t64 (APT may auto-select libcurl4t64 if libcurl4 is not available).
Ensure that the Qt platform plugins are installed (on Ubuntu 22.04 this is provided by qt6-wayland).
GPU acceleration additionally requires either a working Vulkan 1.2+ stack (Mesa, AMD/Intel/NVIDIA drivers) or, for NVIDIA users, the matching CUDA runtime (nvidia-cuda-toolkit or vendor packages). The launcher automatically prefers CUDA when both are present and falls back to CPU if neither is available.
- Install the package
sudo apt install ./aifilesorter_*.deb
Using apt install (rather than dpkg -i) ensures any missing dependencies listed above are installed automatically.
Build from source
-
Install dependencies
sudo apt update && sudo apt install -y \
build-essential cmake git qt6-base-dev qt6-base-dev-tools qt6-l10n-tools qt6-tools-dev qt6-tools-dev-tools \
libcurl4-gnutls-dev libjsoncpp-dev libsqlite3-dev libssl-dev libfmt-dev libspdlog-dev libmediainfo-dev \
libwebp7 zlib1g-dev patchelf dpkg-dev
export PATH="/usr/lib64/qt6/libexec:$PATH"
sudo dnf install -y gcc-c++ cmake git pkgconf-pkg-config qt6-qtbase-devel qt6-qttools-devel \
libcurl-devel jsoncpp-devel sqlite-devel openssl-devel fmt-devel spdlog-devel libmediainfo-devel openblas-devel patchelf
openblas-devel provides the OpenBLAS headers/libs used for the CPU baseline and for
explicit blas=on llama builds on Fedora.
If you plan to build the Vulkan llama runtime on Fedora, also install the Vulkan tools
and shader compiler, plus a working Vulkan driver/runtime:
sudo dnf install -y vulkan-tools glslc
# AMD / Intel / Mesa-based Vulkan runtime
sudo dnf install -y mesa-vulkan-drivers
# NVIDIA proprietary driver users should install the vendor Vulkan runtime instead
vulkaninfo >/dev/null
If you plan to build the CUDA llama runtime on Linux, install an NVIDIA driver plus the
full NVIDIA CUDA Toolkit (not just Python wheels/runtime packages), then verify both the
driver and compiler in the same shell you will use for the build:
export PATH="/usr/local/cuda/bin:$PATH"
nvidia-smi
nvcc --version
Debian/Ubuntu users can use the distro-packaged toolkit (nvidia-cuda-toolkit) if it
matches the driver/runtime they intend to build against. The Linux helper can also fall
back to the toolkit’s libcuda stubs when libcuda.so.1 is not on the default linker
path, which is useful on CI or build-only hosts, but running the CUDA backend still
requires a real NVIDIA driver installation. Fedora/RHEL users should use a supported CUDA
Toolkit install from NVIDIA’s Linux installation guide because the NVIDIA CUDA repository
setup varies by release. On Fedora, enable the NVIDIA CUDA repository first or
sudo dnf install cuda-toolkit will fail with “No match for argument”:
distro="fedora$(rpm -E %fedora)"
sudo dnf install -y dnf-plugins-core
sudo dnf config-manager addrepo \
--from-repofile="https://developer.download.nvidia.com/compute/cuda/repos/${distro}/x86_64/cuda-${distro}.repo"
sudo dnf clean expire-cache
Once that repository is enabled for your Fedora release, the toolkit install itself is:
sudo dnf install -y cuda-toolkit
If you also want NVIDIA’s packaged driver path from the same guide rather than a
separately installed proprietary driver, the documented Fedora command is:
sudo dnf module install -y nvidia-driver:latest-dkms
The official Fedora instructions, including repo enablement and RPMFusion caveats, are:
https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html
On Linux, the helper also needs a CUDA-supported g++ host compiler. It auto-selects
/usr/bin/g++-15, g++-14, g++-13, g++-12, g++-11, g++-10, then g++, and
will stop with an error if none of those are suitable. Current CUDA 13.2 supports GCC
6.x through 15.x. If your installed CUDA release supports an older range than your distro
default compiler, install a compatibility package such as Fedora gcc14-c++ or
gcc13-c++ and rerun with NVCC_CCBIN=/usr/bin/g++-14 or NVCC_CCBIN=/usr/bin/g++-13
in the same shell.
sudo pacman -S --needed base-devel git cmake qt6-base qt6-tools curl jsoncpp sqlite openssl fmt spdlog mediainfo patchelf
Optional GPU acceleration also requires either the distro Vulkan 1.2+ driver/runtime (Mesa, AMD, Intel, NVIDIA) or CUDA packages for NVIDIA cards. Install whichever stack you plan to use; the app will fall back to CPU automatically if none are detected.
MediaInfo is enforced as package-managed only; vendored MediaInfoLib folders or repo-local binaries are rejected by the build.
-
Clone the repository
git clone https://github.com/hyperfield/ai-file-sorter.git
cd ai-file-sorter
git submodule update --init --recursive
Submodule tip: If you previously downloaded llama.cpp or Catch2 manually, remove or rename app/include/external/llama.cpp and external/Catch2 before running the git submodule command. Git needs those directories to be empty so it can populate them with the tracked submodules.
-
Build vendored libzip (generates zipconf.h and libzip.a)
cmake -S external/libzip -B external/libzip/build \
-DBUILD_SHARED_LIBS=OFF \
-DBUILD_DOC=OFF \
-DENABLE_BZIP2=OFF \
-DENABLE_LZMA=OFF \
-DENABLE_ZSTD=OFF \
-DENABLE_OPENSSL=OFF \
-DENABLE_GNUTLS=OFF \
-DENABLE_MBEDTLS=OFF \
-DENABLE_COMMONCRYPTO=OFF \
-DENABLE_WINDOWS_CRYPTO=OFF
cmake --build external/libzip/build
On Ubuntu/Debian you will also need the Zlib development headers (zlib1g-dev) or
the libzip configure step will fail.
If you prefer system headers instead, install libzip-dev and ensure zipconf.h is on your include path.
-
Build the llama runtime variants (run once per backend you plan to ship/test)
The submodule is pinned to llama.cpp b11669 (620d2225). Rebuild all shipped
runtime variants after updating it; do not mix old and new llama, llama-common,
ggml, or mtmd libraries. Native chat formatting uses the embedded Jinja
template with thinking disabled. Qwen3.5 4B is the default local text and visual
model; image analysis also requires its matching projector.
The Linux helper accepts either cuda=on / vulkan=on / blas=on or the GNU-style
--cuda=on / --vulkan=on / --blas=on forms.
It defaults to four build workers. Set AI_FILE_SORTER_LINUX_RUNTIME_JOBS=8
to use eight, and compile the app with make -j8. Variant build directories
are retained for incremental rebuilds.
# CPU / OpenBLAS
./app/scripts/build_llama_linux.sh cuda=off vulkan=off
# CUDA (optional; runtime use requires NVIDIA driver + full CUDA Toolkit; verify
# `nvidia-smi` and `nvcc --version` first. If `nvcc` is not on PATH after install,
# run `export PATH=/usr/local/cuda/bin:$PATH` in this shell. The Linux helper can
# use toolkit libcuda stubs on build-only hosts, and it also needs a CUDA-supported
# g++ host compiler, preferring /usr/bin/g++-15 first.)
./app/scripts/build_llama_linux.sh cuda=on vulkan=off
# Vulkan (optional; requires a working Vulkan 1.2+ stack and glslc; on Fedora install
# vulkan-tools + glslc and ensure `vulkaninfo` succeeds. Mesa-based systems also need
# mesa-vulkan-drivers.)
./app/scripts/build_llama_linux.sh cuda=off vulkan=on
Each invocation stages the corresponding llama/ggml libraries under app/lib/precompiled/<variant> and the runtime DLL/SO copies under app/lib/ggml/w<variant>. On x64 Linux, the helper now keeps the shared ggml runtime generic and SSE4.2-safe instead of forcing AVX, F16C, FMA, AVX2, or BMI2 across every packaged backend. The script refuses to enable CUDA and Vulkan simultaneously, so run it separately for each backend. Shipping both directories lets the launcher pick CUDA when available, then Vulkan, and otherwise stay on CPU. If you only ship the Vulkan payload, the Linux launcher can reuse its bundled CPU/OpenBLAS libraries as the CPU fallback, matching the Windows launcher behavior.
-
Compile the application
cd app
make -j4
The binary is produced at app/bin/aifilesorter.
The Makefile requires pkg-config + package-managed libmediainfo; it intentionally rejects vendored MediaInfo copies.
-
Install system-wide (optional)
sudo make install
-
Build a Debian package (optional)
./app/scripts/package_deb.sh
The packaging script always bundles the CPU runtime and auto-includes any staged GPU
variants already present under app/lib/precompiled (for example vulkan after
./app/scripts/build_llama_linux.sh cuda=off vulkan=on). Use
./app/scripts/package_deb.sh --cpu-only for a smaller CPU-only package, or
--include-vulkan / --include-cuda if you want the script to fail when a specific
staged variant is missing. Use --include-all for a combined CPU + Vulkan + CUDA
package that requires all three staged variants. The installed launcher selects
the runtime at startup, so separate GPU downloads are optional.
Ubuntu release packages target Ubuntu 24.04 / Linux Mint 22. Build the app
and every bundled llama/ggml runtime on that baseline; compiling on a newer
distribution and repacking the files does not lower their library requirements.
The Ubuntu CI container is pinned to ubuntu:24.04 and uses GCC 12 as the
host compiler for Noble’s CUDA 12 toolkit. MediaInfo’s development package
requires the GnuTLS curl development package on this baseline.
For a manual CUDA build on Ubuntu 24.04, install g++-12 and set
NVCC_CCBIN=/usr/bin/g++-12 when running build_llama_linux.sh.
Debian CI targets Debian 13 using debian:13. Its MediaInfo development
package also requires libcurl4-gnutls-dev; selecting the OpenSSL curl
development package causes a dependency conflict.
Debian packaging requires dpkg-dev, binutils, pkg-config, Python 3, and
the build dependencies above. app/scripts/deb_dependencies.py validates
every staged ELF file against the build system’s glibc, C++ and Qt ABIs,
then runs dpkg-shlibdeps across the executable and bundled libraries.
CUDA toolkit/driver libraries remain optional so the package can run on CPU-only
machines. For CUDA acceleration with the Ubuntu 24.04 build, install the CUDA 12
runtime packages libcudart12 and libcublas12 alongside a compatible NVIDIA
driver; the full CUDA development toolkit is not required. The CI package check
installs the generated .deb into a separate
Ubuntu 24.04 container with runtime dependencies only, checks bundled CPU
library dependencies with the system loader, and runs --self-test and
--headless-help through the installed launcher.
-
Build an RPM package (optional; Fedora / RHEL)
./app/scripts/create_rpm.sh
The RPM packaging script follows the same runtime-selection model as the Debian packager:
CPU is always bundled, staged CUDA/Vulkan runtime dirs are auto-included when present, and
the installed run_aifilesorter.sh launcher chooses CUDA first, then Vulkan, then CPU at
runtime. Use ./app/scripts/create_rpm.sh --cpu-only for a smaller CPU-only package, or
--include-vulkan / --include-cuda if you want the script to fail when a specific
staged variant is missing. The RPM payload is built under dist/aifilesorter_rpm/.
Requirements satisfied by bundled private libraries are filtered using their ELF
SONAMEs; ordinary system-library dependencies remain generated by RPM. GPU
runtime dependencies stay optional so the combined package installs on CPU-only systems.
The RPM explicitly requires libwebp for WebP decoding when Qt has no WebP plugin.
Fedora CI uses fedora:44 for both building and installation checks, matching
the validated release baseline and NVIDIA’s available CUDA toolkit repository.
-
Build an Arch Linux package (optional)
Build the app on an up-to-date Arch system with the Linux dependencies above,
then install the packaging tools and create a native pacman package:
sudo pacman -S --needed desktop-file-utils libarchive patchelf python zstd
./app/scripts/package_arch.sh --include-all
sudo pacman -U dist/aifilesorter_arch/final/aifilesorter-*.pkg.tar.zst
The app version is read from app/include/app_version.hpp; PKGREL defaults
to 1, and PACKAGER defaults to AI File Sorter Team <[email protected]>.
CPU is required. Use --cpu-only to exclude staged GPU runtimes, or
--include-vulkan / --include-cuda to require a particular staged backend.
The package installs the app under /opt/aifilesorter, an aifilesorter
launcher in /usr/bin, and a desktop-menu entry with icons. System libraries
and certificate trust come from Arch packages; CUDA and Vulkan driver/runtime
packages remain optional so CPU-only systems can install it.
CI installs the generated package into a separate Arch container with runtime
dependencies only. It checks pacman file integrity, validates the desktop
entry, resolves bundled CPU library dependencies, runs --self-test and
--headless-help through the installed launcher, and verifies removal.
macOS
Apple Silicon Macs running macOS 26 or later are supported for macOS source builds and release bundles.
HTTPS uses Apple’s certificate trust service. The selected libcurl must use
Secure Transport; both CMake and Make check the actual linked runtime and reject
unsupported builds. Use the macOS SDK/system libcurl. AppleSecTrust support in an
OpenSSL build is insufficient because native verification can be supplemented by
OpenSSL CA anchors. Remove a cached Homebrew CURL_ROOT when reconfiguring.
Release packaging also runs the signed application’s
--self-test=tls with its packaged libraries and no developer library search
overrides. Linux/macOS builds do not embed or install a separate CA bundle.
-
Install Xcode command-line tools (xcode-select --install) with a macOS 26 or newer SDK.
-
Install Homebrew (if required).
-
Install dependencies
brew install qt curl jsoncpp sqlite openssl fmt spdlog mediainfo cmake git pkgconfig libffi
Add Qt to your environment if it is not already present:
export PATH="$(brew --prefix)/opt/qt/bin:$PATH"
export PKG_CONFIG_PATH="$(brew --prefix)/lib/pkgconfig:$(brew --prefix)/share/pkgconfig:$PKG_CONFIG_PATH"
-
Clone the repository and submodules (same commands as Linux).
The macOS build defaults to a minimum deployment target of 26.0 in Make, CMake, and release bundles. This is required by the standard library’s floating-point std::from_chars used for inference controls. Set MACOSX_DEPLOYMENT_TARGET (or CMAKE_OSX_DEPLOYMENT_TARGET for CMake) to select a newer minimum.
-
Build vendored libzip (generates zipconf.h and libzip.a)
cmake -S external/libzip -B external/libzip/build \
-DBUILD_SHARED_LIBS=OFF \
-DBUILD_DOC=OFF \
-DENABLE_BZIP2=OFF \
-DENABLE_LZMA=OFF \
-DENABLE_ZSTD=OFF \
-DENABLE_OPENSSL=OFF \
-DENABLE_GNUTLS=OFF \
-DENABLE_MBEDTLS=OFF \
-DENABLE_COMMONCRYPTO=OFF \
-DENABLE_WINDOWS_CRYPTO=OFF
cmake --build external/libzip/build
-
Build the llama runtime
./app/scripts/build_llama_macos.sh
Architecture-specific examples:
./app/scripts/build_llama_macos.sh --arm64 # Apple Silicon
The macOS app and .app bundles use the runtime staged under app/lib/precompiled*; they do not need Homebrew ggml or llama.cpp libraries.
The runtime helper defaults to four build workers; set AI_FILE_SORTER_MACOS_RUNTIME_JOBS=8 for eight.
If you have older ggml / llama.cpp copies installed in generic library locations, prefer unlinking or removing them instead of relying on them implicitly.
-
Compile the application
cd app
make -j8 # use -jN to control parallelism
sudo make install # optional
The default build places the binary at app/bin/aifilesorter.
Variant targets:
make -j8 MACOS_LLAMA_M1 # outputs app/bin/m1/aifilesorter
make -j8 MACOS_LLAMA_M2 # outputs app/bin/m2/aifilesorter
These targets rebuild the llama.cpp runtime before compiling the app.
sudo make install places the macOS runtime libraries under /usr/local/lib/aifilesorter to avoid collisions with unrelated system or Homebrew ggml libraries.
Create an ad hoc signed .app on macOS with Python 3.10 or newer:
bash scripts/create_macos_bundle.sh --default
Set EXECUTABLE_SRC and BUNDLE_OUTPUT_DIR for a CMake executable or a separate
output directory. The packager copies the linked dependency closure, verifies
architectures, removes developer search paths, and checks actual loaded images
from / with all DYLD_* overrides removed. System library references remain
system references. Developer ID signing, notarization, and DMG creation are
separate release steps.
Each variant uses distinct build directories to avoid cross-arch collisions:
- llama.cpp libs:
app/lib/precompiled-m1, app/lib/precompiled-m2
- object files:
app/obj/arm64
Windows
Build now targets native MSVC + Qt6 without MSYS2. Two options are supported; the vcpkg route is simplest.
Option A - CMake + vcpkg (recommended)
-
Install prerequisites:
-
Visual Studio 2022 or newer with Desktop C++ workload
-
CMake 3.21+ (Visual Studio ships a recent version)
-
vcpkg: https://github.com/microsoft/vcpkg (clone and bootstrap)
-
package-managed libmediainfo via vcpkg manifest (no vendored MediaInfo submodule/binaries)
-
MSYS2 UCRT64 or MINGW64 + OpenBLAS: install MSYS2 from https://www.msys2.org, open either an MSYS2 UCRT64 or MSYS2 MINGW64 shell, and run pacman -S --needed mingw-w64-ucrt-x86_64-openblas or pacman -S --needed mingw-w64-x86_64-openblas. The build_llama_windows.ps1 script probes C:\msys64\ucrt64 and C:\msys64\mingw64 automatically, and also supports overriding the location with openblasroot=<path> or OPENBLAS_ROOT.
-
If you plan to build the CUDA runtime on Windows: install the current NVIDIA driver and the full NVIDIA CUDA Toolkit from https://developer.nvidia.com/cuda-downloads. After installation, open a fresh x64 Native Tools / Visual Studio Developer PowerShell and verify the toolkit/driver before running the helper:
$env:CUDA_PATH
nvcc --version
nvidia-smi
The Windows helper expects a full toolkit install with nvcc, headers, and libraries.
Conda or pip CUDA runtime packages are not enough for building the bundled llama.cpp
CUDA variant. NVIDIA’s official Windows installation guide is here:
https://docs.nvidia.com/cuda/cuda-installation-guide-microsoft-windows/index.html
-
Clone repo and submodules:
git clone https://github.com/hyperfield/ai-file-sorter.git
cd ai-file-sorter
git submodule update --init --recursive
-
Build vendored libzip (generates zipconf.h and libzip.lib)
Run from the same x64 Native Tools / Visual Studio Developer PowerShell you will use to build the app:
cmake -S external\libzip -B external\libzip\build -A x64 `
-DBUILD_SHARED_LIBS=OFF `
-DBUILD_DOC=OFF `
-DENABLE_BZIP2=OFF `
-DENABLE_LZMA=OFF `
-DENABLE_ZSTD=OFF `
-DENABLE_OPENSSL=OFF `
-DENABLE_GNUTLS=OFF `
-DENABLE_MBEDTLS=OFF `
-DENABLE_COMMONCRYPTO=OFF `
-DENABLE_WINDOWS_CRYPTO=OFF
cmake --build external\libzip\build --config Release
-
Determine your vcpkg root only if auto-discovery does not find it. The Windows helper scripts look in this order: VCPKG_ROOT / VPKG_ROOT, vcpkg / vpkg on PATH, then common writable locations such as <repo-drive>:\dev\vcpkg, <repo-drive>:\vcpkg, %SystemDrive%\dev\vcpkg, and %SystemDrive%\vcpkg.
-
If vcpkg is on your PATH, run this command to print the location:
Split-Path -Parent (Get-Command vcpkg).Source
-
Otherwise use the directory where you cloned vcpkg, or pass it explicitly to the helper scripts.
MediaInfo note: you do not manually add MediaInfoLib include/lib paths on Windows. The project already declares libmediainfo in app/vcpkg.json, and app\build_windows.ps1 configures CMake with the vcpkg toolchain + manifest so find_package(MediaInfoLib ...) resolves it automatically. If you want to preinstall or verify it explicitly, run vcpkg install libmediainfo:x64-windows.
-
Build the bundled llama.cpp runtime variants (run from the same x64 Native Tools / Visual Studio Developer PowerShell shell). Invoke the script once per backend you need. The script accepts cuda=on|off, vulkan=on|off, blas=on|off, vcpkgroot=<path>, openblasroot=<path>, and cudaarch=<value>. vcpkgroot=<path> is optional and only needed when auto-discovery misses your install. blas defaults to AUTO: it is enabled automatically for CPU-only builds and disabled automatically for CUDA/Vulkan builds unless you force it on. For Windows builds, the helper now keeps the shared ggml runtime generic and SSE4.2-safe instead of forcing AVX2 across every DLL. For CUDA builds, the helper prefers a valid CUDA_PATH and otherwise auto-selects the newest installed toolkit it can validate under C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA. Make sure nvcc --version and nvidia-smi succeed in this same shell before running cuda=on. Make sure the MSYS2 OpenBLAS install from step 1 is present before running the CPU-only variant (or pass openblasroot=<path> explicitly):
# Optional: override the default four build workers
$env:AI_FILE_SORTER_WINDOWS_RUNTIME_JOBS = "8"
# CPU / OpenBLAS only
app\scripts\build_llama_windows.ps1 cuda=off vulkan=off
# CUDA (requires matching NVIDIA toolkit/driver)
app\scripts\build_llama_windows.ps1 cuda=on vulkan=off
# CUDA + OpenBLAS (optional override if you want that combination explicitly)
app\scripts\build_llama_windows.ps1 cuda=on vulkan=off blas=on
# Vulkan (requires LunarG Vulkan SDK or vendor Vulkan 1.2+ runtime)
app\scripts\build_llama_windows.ps1 cuda=off vulkan=on
Each run emits llama.dll, llama-common.dll, mtmd.dll, and ggml*.dll under app\lib\precompiled\<cpu|cuda|vulkan|vulkan-blas> and copies the runtime DLLs into the Windows runtime directories used by the app (app\lib\ggml\wocuda, app\lib\ggml\wcuda, or app\lib\ggml\wvulkan). Rebuild every shipped variant from the pinned submodule before rebuilding the application. The helper also stages OpenSSL runtime DLLs and, for OpenBLAS-backed builds, the MinGW companion DLLs needed beside libopenblas.dll. Windows ggml runtimes built by this helper target SSE4.2 and leave AVX, AVX2, BMI2, and newer x86 extensions disabled so the packaged DLLs remain usable on older x64 CPUs. Only runtime libraries are built; server/UI assets are not downloaded. For Vulkan builds, install the latest LunarG Vulkan SDK (or the vendor’s runtime), ensure vulkaninfo succeeds in the same shell, and then run the script. The Windows launcher aifilesorter.exe auto-selects the best backend at launch: CUDA is preferred, Vulkan is used when CUDA is unavailable, and CPU remains the fallback.
CUDA builds also stage the matching cudart64_*.dll, cublas64_*.dll, and
cublasLt64_*.dll redistributables plus CUDA-EULA.txt under lib/ggml/wcuda.
The shared staging helper reads the backend’s imported cuBLAS DLL name and
copies a complete matching set from the selected toolkit’s bin/x64 or bin.
Application packaging can reuse the staged set without a toolkit installed;
older incomplete runtime builds need a matching toolkit through CUDA_PATH
or a runtime rebuild. Packaging fails if the CUDA libraries or license are missing.
Detection uses the bundled runtime instead of unrelated toolkits or PhysX copies,
and retains Vulkan/CPU fallback when the bundled runtime cannot initialize.
End users need a compatible NVIDIA display driver, rather than a development
toolkit. See NVIDIA’s deployment guidance.
The CUDA 13.3 libraries add about 500 MiB before compression to the CUDA payload.
-
Build the Qt6 application using the helper script (still in the VS shell). The helper stages runtime DLLs via windeployqt and shares one dependency install tree across builds:
# One-time per shell if script execution is blocked:
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
app\build_windows.ps1 -Configuration Release
- Pass
-VcpkgRoot <path> only if auto-discovery misses your vcpkg install. The path must contain scripts\buildsystems\vcpkg.cmake.
- Pass
-Generator <name> only if you need to override the auto-selected CMake generator. By default the helper picks the newest installed Visual Studio generator it can validate and can fall back to the Visual Studio-bundled cmake.exe when needed.
- The main bundled output is staged under
app\build-windows\Release.
aifilesorter.exe is the Windows entry point for the bundled build and launches aifilesorter-bin.exe.
-VcpkgRoot is optional if VCPKG_ROOT/VPKG_ROOT is set or vcpkg/vpkg is on PATH.
- Pass
-SkipDeploy if you only want the binaries without bundling runtime DLLs.
- Pass
-Parallel <N> to override the default “all cores” parallel build behaviour (for example, -Parallel 8). By default the script invokes cmake --build ... --parallel <core-count> and ctest -j <core-count> to keep both MSBuild and Ninja fully utilized.
Option B - CMake + Qt online installer
-
Install prerequisites:
- Visual Studio 2022 or newer with Desktop C++ workload
- Qt 6.x MSVC kit via Qt Online Installer (e.g., Qt 6.6+ with MSVC 2019/2022)
- CMake 3.21+
- vcpkg (for non-Qt libs): curl, jsoncpp, sqlite3, openssl, fmt, spdlog, gettext, libmediainfo
-
Build vendored libzip (generates zipconf.h and libzip.lib)
Run from the same x64 Native Tools / Visual Studio Developer PowerShell you will use to build the app:
cmake -S external\libzip -B external\libzip\build -A x64 `
-DBUILD_SHARED_LIBS=OFF `
-DBUILD_DOC=OFF `
-DENABLE_BZIP2=OFF `
-DENABLE_LZMA=O</core-count></core-count></n></name></path></cpu></path></path></value></path></path></repo-drive></repo-drive></https:></https:></path></https:></https:></info></variant></variant></https:>
README 内容过长,已截取前 64 KB。完整内容请前往 GitHub 仓库查看。
评论