### Setup Android Command-line Tools Source: https://github.com/qarmin/czkawka/blob/master/cedinia/TMP_INSTALL.md Prepare the directory structure and install necessary Android SDK components. ```shell mkdir -p $ANDROID_HOME/cmdline-tools cd $ANDROID_HOME/cmdline-tools # unzip commandlinetools-linux-*.zip # mv cmdline-tools latest # Accept licences & install required packages sdkmanager --licenses sdkmanager \ "platform-tools" \ "platforms;android-35" \ "build-tools;35.0.0" \ "ndk;27.2.12479018" ``` -------------------------------- ### Install the application Source: https://github.com/qarmin/czkawka/blob/master/misc/test_compilation_speed_size/README.md Install the tool directly from the local source path. ```bash cargo install --path . ``` -------------------------------- ### Video Optimizer Usage Examples Source: https://github.com/qarmin/czkawka/blob/master/instructions/Instruction_CLI.md Common command-line examples for transcoding and cropping videos. ```shell # Find videos not already in h265 or av1 czkawka_cli video-optimizer -d /home/rafal transcode -c h265,av1 -f results.txt # Dry run: preview what would be transcoded to h265 czkawka_cli video-optimizer -d /home/rafal transcode -F -Q # Find videos with black bars czkawka_cli video-optimizer -d /home/rafal crop -m blackbars -f results.txt ``` -------------------------------- ### Install dependencies on Ubuntu Source: https://github.com/qarmin/czkawka/blob/master/czkawka_gui/README.md Command to install necessary GTK 4 and media libraries on Ubuntu systems. ```bash sudo apt install libgtk-4-bin libheif1 libraw-bin ffmpeg -y ``` -------------------------------- ### Install Python dependencies Source: https://github.com/qarmin/czkawka/blob/master/misc/test_compilation_speed_size/README.md Install required system packages for generating charts. ```bash sudo apt install python3-matplotlib python3-pandas python3-tabulate ``` -------------------------------- ### Install Java 17 Source: https://github.com/qarmin/czkawka/blob/master/cedinia/TMP_INSTALL.md Install the required OpenJDK 17 package on Ubuntu or Debian systems. ```shell sudo apt install openjdk-17-jdk ``` -------------------------------- ### Create a portable setup script Source: https://github.com/qarmin/czkawka/blob/master/instructions/Instruction.md A bash script to set relative paths for configuration and cache, intended to be placed next to the application binary. ```bash #!/bin/bash CZKAWKA_CONFIG_PATH="$(dirname "$(realpath "$0")")/config" CZKAWKA_CACHE_PATH="$(dirname "$(realpath "$0")")/cache" ./krokiet ``` -------------------------------- ### Check Active Backend Output Source: https://github.com/qarmin/czkawka/blob/master/krokiet/README.md Example output showing the currently active Slint backend. ```text Slint: Build config: debug; Backend: software ``` -------------------------------- ### Compile Krokiet from source Source: https://github.com/qarmin/czkawka/blob/master/instructions/Instruction_Krokiet.md Commands to install the binary or build with specific image format support features. ```shell # Simplest - installs the latest optimized binary cargo install krokiet --locked # With optional image format support cargo build --release --bin krokiet --features "heif,libraw,libavif" ``` -------------------------------- ### Install FFmpeg dependencies Source: https://github.com/qarmin/czkawka/blob/master/instructions/Instruction_Krokiet.md Required for the Similar Videos tool functionality. ```shell sudo apt install ffmpeg ``` ```shell brew install ffmpeg ``` ```shell choco install ffmpeg ``` -------------------------------- ### Install Linux dependencies Source: https://github.com/qarmin/czkawka/blob/master/czkawka_core/README.md Install runtime dependencies for video processing and optional build dependencies for advanced image formats on Ubuntu or Debian. ```shell # Runtime: similar videos sudo apt install ffmpeg # Optional build + runtime: extra image formats sudo apt install libheif-dev libraw-dev libavif-dev libdav1d-dev ``` -------------------------------- ### Install dependencies on Linux Source: https://github.com/qarmin/czkawka/blob/master/krokiet/README.md Commands to install ffmpeg for video tools and optional libraries for extended image format support on Ubuntu or Debian systems. ```shell # Runtime: similar videos sudo apt install ffmpeg # Optional build + runtime: extra image formats sudo apt install libheif-dev libraw-dev libavif-dev libdav1d-dev ``` -------------------------------- ### Install macOS dependencies Source: https://github.com/qarmin/czkawka/blob/master/czkawka_core/README.md Install required and optional libraries on macOS using Homebrew. ```shell brew install ffmpeg libraw libheif libavif dav1d ``` -------------------------------- ### Install Czkawka via Flatpak Source: https://github.com/qarmin/czkawka/blob/master/czkawka_gui/README.md Commands to add the Flathub repository and install the Czkawka GUI package. ```bash flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo flatpak install flathub com.github.qarmin.czkawka ``` -------------------------------- ### Install dependencies on macOS Source: https://github.com/qarmin/czkawka/blob/master/czkawka_gui/README.md Commands to install Homebrew and the required GTK 4 and media libraries on macOS. ```bash /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" brew install gtk4 ffmpeg librsvg libheif libraw dav1d ``` -------------------------------- ### Install Czkawka via Debian APT Source: https://github.com/qarmin/czkawka/blob/master/czkawka_gui/README.md Command to install the unofficial Debian package. ```bash sudo apt install czkawka_gui ``` -------------------------------- ### Czkawka CLI usage examples Source: https://github.com/qarmin/czkawka/blob/master/instructions/Instruction_CLI.md Common commands for listing tools, finding duplicates, and managing file deletion strategies. ```shell # List all tools czkawka_cli --help # Show options for a specific tool czkawka_cli dup --help # Find duplicate files in a directory (results printed to console) czkawka_cli dup -d /home/user/Documents # Save results to file without printing czkawka_cli dup -d /home/user/Documents -f results.txt -N # Dry run - preview which files would be deleted (keeps newest in each group) czkawka_cli dup -d /home/user/Documents -D AEN -Q # Delete duplicates keeping newest, move others to trash czkawka_cli dup -d /home/user/Documents -D AEN -y ``` -------------------------------- ### Execute Czkawka CLI Tools Source: https://github.com/qarmin/czkawka/blob/master/czkawka_cli/README.md Examples of running various Czkawka tools for finding duplicates, empty folders, large files, and more. ```shell czkawka dup -d /home/rafal -e /home/rafal/Obrazy -m 25 -x 7z rar IMAGE -s hash -f results.txt -D aeo czkawka empty-folders -d /home/rafal/rr /home/gateway -f results.txt czkawka big -d /home/rafal/ /home/piszczal -e /home/rafal/Roman -n 25 -x VIDEO -f results.txt czkawka empty-files -d /home/rafal /home/szczekacz -e /home/rafal/Pulpit -R -f results.txt czkawka temp -d /home/rafal/ -E */.git */tmp* *Pulpit -f results.txt -D czkawka music -d /home/rafal -e /home/rafal/Pulpit -z "artist,year, ARTISTALBUM, ALBUM___tiTlE" -f results.txt czkawka symlinks -d /home/kicikici/ /home/szczek -e /home/kicikici/jestempsem -x jpg -f results.txt ``` -------------------------------- ### Install Czkawka via Homebrew Source: https://github.com/qarmin/czkawka/blob/master/czkawka_gui/README.md Command to install the unofficial Homebrew formula on macOS. ```bash brew install czkawka ``` -------------------------------- ### Android Build and Lifecycle Commands Source: https://github.com/qarmin/czkawka/blob/master/cedinia/TMP_INSTALL.md Use justfile commands to manage keystores, builds, installations, and device execution. ```shell just gen_keystores # generate debug + release keystores (run once) # Android - build, install & launch just android # debug: build → install → launch just androidr # release: build → install → launch # Android - individual steps just android_build # build debug APK just android_build_release # build release APK just android_install # install debug APK to connected device just android_install_release just android_run # launch on connected device ``` -------------------------------- ### Install Czkawka via PPA Source: https://github.com/qarmin/czkawka/blob/master/czkawka_gui/README.md Commands to add the unofficial PPA repository and install Czkawka on Debian-based systems. ```bash sudo add-apt-repository ppa:xtradeb/apps sudo apt update sudo apt install czkawka ``` -------------------------------- ### Install Krokiet via Cargo Source: https://github.com/qarmin/czkawka/blob/master/krokiet/README.md Installs the latest optimized version of Krokiet using the cargo package manager. ```shell cargo install krokiet --locked ``` -------------------------------- ### Compile Czkawka GUI on Linux Source: https://github.com/qarmin/czkawka/blob/master/czkawka_gui/README.md Commands to install dependencies and build the GUI with optional feature support. ```shell sudo apt install libgtk-4-dev -y # Base sudo apt install libgtk-4-dev libheif-dev libraw-dev libavif-dev libdav1d-dev -y # With features cargo run --release --bin czkawka_gui # Or with support for heif, libraw, libavif cargo run --release --bin czkawka_gui --features "heif,libraw,libavif" ``` -------------------------------- ### EmptyFiles Tool Directory Structure Source: https://github.com/qarmin/czkawka/blob/master/czkawka_core/CLAUDE.md Example of the standard file layout for a tool module in the Czkawka project. ```text src/tools/empty_files/ ├── mod.rs # pub struct EmptyFiles { common_data, information, files_to_check, params } │ # params: EmptyFilesParameters ├── core.rs # fn check_files() → WorkContinueStatus ├── tests.rs # Unit tests └── traits.rs # impl Search, CommonData, PrintResults, DeletingItems, AllTraits ``` -------------------------------- ### Handle Invalid Backend Warning Source: https://github.com/qarmin/czkawka/blob/master/krokiet/README.md Example of the warning message displayed when an unsupported backend is requested. ```text slint winit: unrecognized renderer skia, falling back to FemtoVG ``` -------------------------------- ### Run Similar Videos Search Source: https://github.com/qarmin/czkawka/blob/master/instructions/Instruction_CLI.md Identifies similar videos by comparing frame differences and audio content. Requires ffmpeg to be installed. ```shell czkawka_cli video -d [options] ``` ```shell czkawka_cli video -d /home/rafal -f results.txt ``` -------------------------------- ### Compile Czkawka GUI on macOS Source: https://github.com/qarmin/czkawka/blob/master/czkawka_gui/README.md Commands to install build dependencies and compile the GUI application. ```shell /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" brew install rustup gtk4 adwaita-icon-theme ffmpeg librsvg libheif libraw dav1d pkg-config rustup-init cargo run --release --bin czkawka_gui # Or with support for heif, libraw, libavif cargo run --release --bin czkawka_gui --features "heif,libraw,libavif" ``` -------------------------------- ### Initialize Desktop Entry Point Source: https://github.com/qarmin/czkawka/blob/master/cedinia/AGENTS.md Sets up the logger and runs the application with default desktop insets and scaling. ```rust pub fn run_app() { setup_logger_cache(); run_app_with_insets(0.0, 1.0, ()); } ``` -------------------------------- ### Install Czkawka via MSYS2 Source: https://github.com/qarmin/czkawka/blob/master/czkawka_gui/README.md Command to install the unofficial MSYS2 package on Windows. ```bash pacman -S mingw-w64-x86_64-czkawka-gui ``` -------------------------------- ### Desktop Build and Run Source: https://github.com/qarmin/czkawka/blob/master/cedinia/TMP_INSTALL.md Commands to build and run the project on the desktop. ```shell cargo build -p cedinia cargo run -p cedinia ``` -------------------------------- ### Initialize Android Entry Point Source: https://github.com/qarmin/czkawka/blob/master/cedinia/AGENTS.md Configures the Android environment, including paths, logging, JNI file picker, and the Slint UI framework. ```rust #[unsafe(no_mangle)] fn android_main(android_app: AndroidApp) { setup_android_paths(&android_app); // JNI: get /data and /cache paths (sets DATA_DIR) app::setup_logger_cache(); // installs DualLogger: logcat + cedinia.log file asan_smoketest_if_requested(); // no-op unless CEDINIA_ASAN_SMOKETEST is set file_picker_android::init(&android_app); // Load DEX + init JNI slint::android::init(android_app.clone()).expect(…); file_picker_android::setup_nav_bar(); // pin/style the Android nav bar app::run_app_with_insets(inset_bottom_px, scale, android_app); } ``` -------------------------------- ### Install Rust Android Dependencies Source: https://github.com/qarmin/czkawka/blob/master/cedinia/TMP_INSTALL.md Install cargo-apk and the necessary Rust targets for Android cross-compilation. ```shell cargo install cargo-apk # Add Android Rust targets rustup target add aarch64-linux-android armv7-linux-androideabi ``` -------------------------------- ### Run compilation speed tests Source: https://github.com/qarmin/czkawka/blob/master/misc/test_compilation_speed_size/README.md Execute the tool by providing a configuration file path. ```bash test_compilation_speed_size config.json ``` -------------------------------- ### Configure and Run Empty Files Tool Source: https://github.com/qarmin/czkawka/blob/master/instructions/Instruction_Core.md Initializes the EmptyFiles tool with a specific checking method and retrieves the resulting file entries. ```rust use czkawka_core::tools::empty_files::{EmptyFiles, EmptyFilesParameters}; use czkawka_core::common::model::CheckingMethod; let params = EmptyFilesParameters::new( CheckingMethod::EmptyFilesContent, // or CheckingMethod::None for basic mode ); let mut tool = EmptyFiles::new(params); tool.search(&stop_flag, progress_sender); // Results: Vec for entry in tool.get_empty_files() { } ``` -------------------------------- ### Access CLI Help Source: https://github.com/qarmin/czkawka/blob/master/czkawka_cli/README.md Commands to display general or tool-specific help information. ```shell czkawka_cli --help ``` ```shell czkawka_cli dup --help ``` -------------------------------- ### Initialize and execute VideoOptimizer in Rust Source: https://github.com/qarmin/czkawka/blob/master/instructions/Instruction_Core.md Configures the VideoOptimizer with specific parameters and executes a search. Results are retrieved as a vector of VideoEntry objects. ```rust use czkawka_core::tools::video_optimizer::{VideoOptimizer, VideoOptimizerParameters, VideoOptimizerMode}; let params = VideoOptimizerParameters::new(VideoOptimizerMode::Transcode { excluded_codecs: vec!["h265".to_string(), "av1".to_string()], generate_thumbnails: false, thumbnail_percentage: 10, generate_thumbnail_grid: false, thumbnail_grid_tiles_per_side: 3, }); let mut tool = VideoOptimizer::new(params); tool.search(&stop_flag, progress_sender); // Results: Vec for entry in tool.get_video_optimizer_entries() { // entry.path, entry.size, entry.codec, entry.width, entry.height } ``` -------------------------------- ### Configure directories via command line Source: https://github.com/qarmin/czkawka/blob/master/instructions/Instruction_GTK.md Launch the application with specific included and excluded directories. Note that using command-line arguments disables the automatic save-on-exit feature. ```bash czkawka_gui /home /usr --/home/rafal --/home/zaba ``` -------------------------------- ### Configure runtime renderers Source: https://github.com/qarmin/czkawka/blob/master/instructions/Instruction_Krokiet.md Environment variables to switch between available Slint backends at runtime. ```shell SLINT_BACKEND=software ./krokiet # pure software rendering, safest fallback SLINT_BACKEND=winit-femtovg ./krokiet # OpenGL via femtovg (default) SLINT_BACKEND=skia ./krokiet # Skia (requires winit_skia_opengl compile feature) ``` -------------------------------- ### Compile Czkawka from source Source: https://github.com/qarmin/czkawka/blob/master/instructions/Instruction_CLI.md Build the CLI binary using Cargo, with optional support for specific image formats. ```shell cargo build --release --bin czkawka_cli # With optional image format support: cargo build --release --bin czkawka_cli --features "heif,libraw,libavif" ``` -------------------------------- ### Configure and Run Duplicate Finder Source: https://github.com/qarmin/czkawka/blob/master/instructions/Instruction_Core.md Initializes the DuplicateFinder with specific parameters and executes the search process. ```rust use czkawka_core::tools::duplicate::{DuplicateFinder, DuplicateFinderParameters}; use czkawka_core::common::model::{CheckingMethod, HashType}; let params = DuplicateFinderParameters::new( CheckingMethod::Hash, HashType::Blake3, false, // use_prehash_cache 257_144, // minimal_cache_file_size (bytes) 257_144, // minimal_prehash_cache_file_size (bytes) false, // case_sensitive_name_comparison ); let mut finder = DuplicateFinder::new(params); // configure with CommonData setters, then: finder.search(&stop_flag, progress_sender); ``` -------------------------------- ### Compile with Optional Image Features Source: https://github.com/qarmin/czkawka/blob/master/krokiet/README.md Builds the binary with support for additional image formats like HEIF, Libraw, and AVIF. ```shell cargo build --release --bin krokiet --features "heif,libraw,libavif" ``` -------------------------------- ### Tool Dispatcher Function Structure Source: https://github.com/qarmin/czkawka/blob/master/czkawka_cli/CLAUDE.md Standard template for all 14 tool dispatch functions in the CLI, handling parameter setup, common settings, scanning, and result output. ```rust fn tool_name(args: ToolArgs, stop_flag: &Arc, progress_sender: &Sender) -> CliOutput { // 1. Destructure args // 2. Build tool-specific parameter struct let mut tool = ToolType::new(params); // 3. Apply common settings (paths, extensions, cache, threads) set_common_settings(&mut tool, &common_cli_items, reference_directories); // 4. Apply tool-specific settings (file sizes, delete method, etc.) // 5. Run scan tool.search(stop_flag, Some(progress_sender)); // 6. Optionally run fix (rename/delete/etc.) // 7. Collect and return output save_and_write_results_to_writer(&tool, &common_cli_items) } ``` -------------------------------- ### Compile with native CPU instructions Source: https://github.com/qarmin/czkawka/blob/master/instructions/Instruction.md Use these configurations to enable CPU-specific optimizations for faster image hashing. ```shell RUSTFLAGS="-C target-cpu=native" cargo build --release ``` ```toml [target.x86_64-unknown-linux-gnu] rustflags = ["-C", "target-cpu=native"] ``` -------------------------------- ### Configure Environment Variables Source: https://github.com/qarmin/czkawka/blob/master/cedinia/TMP_INSTALL.md Set required paths for Java and Android SDK in your shell configuration file. ```shell export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64 export ANDROID_HOME=$HOME/android-sdk export ANDROID_NDK_HOME=$ANDROID_HOME/ndk/27.2.12479018 # NDK r27, see https://developer.android.com/ndk/downloads/revision_history export PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest/bin export PATH=$PATH:$ANDROID_HOME/platform-tools # Reload after editing ~/.bashrc source ~/.bashrc ``` -------------------------------- ### Configuring cache and config paths in Rust Source: https://github.com/qarmin/czkawka/blob/master/instructions/Instruction_Core.md Initialize the application paths before accessing cache or configuration files. ```rust use czkawka_core::common::config_cache_path::{set_config_cache_path, get_config_cache_path}; // Call once at startup - choose names appropriate for your app let result = set_config_cache_path("MyApp", "MyApp"); // result.infos / result.warnings contain diagnostic messages if let Some(paths) = get_config_cache_path() { println!("Cache: {}", paths.cache_folder.display()); println!("Config: {}", paths.config_folder.display()); } ``` -------------------------------- ### Generate video thumbnails via CLI Source: https://github.com/qarmin/czkawka/blob/master/instructions/Instruction_Krokiet.md Pre-populates the thumbnail cache to improve GUI performance when browsing video files. ```shell czkawka_cli video -d /your/videos --generate-thumbnails ``` -------------------------------- ### Performance Micro-hints Source: https://github.com/qarmin/czkawka/blob/master/CLAUDE.md Common patterns for reducing allocations and improving cache density. ```rust Vec::with_capacity(n) / HashMap::with_capacity(n) ``` ```rust buf.clear() ``` ```rust SmallVec/ArrayVec ``` ```rust #[repr(u8)]/#[repr(u16)] ``` ```rust std::hint::black_box(...) ``` -------------------------------- ### Select files by extension using Regex Source: https://github.com/qarmin/czkawka/blob/master/instructions/FAQ.md Use regex patterns in the 'Regex Path + Name' field to target specific file extensions. ```regex .*mp3 ``` ```regex .*\.flac$ ``` -------------------------------- ### Integrating SimilarImages Tool Source: https://github.com/qarmin/czkawka/blob/master/instructions/Instruction_Core.md Configures and executes the SimilarImages tool, then iterates through the resulting groups or referenced matches. ```rust use czkawka_core::tools::similar_images::{SimilarImages, SimilarImagesParameters, GeometricInvariance}; use czkawka_core::re_exported::{HashAlg, FilterType}; let params = SimilarImagesParameters::new( 10, // max_difference (0-40) 16, // hash_size (8, 16, 32 or 64) HashAlg::Gradient, FilterType::Nearest, false, // exclude_images_with_same_size false, // exclude_images_with_same_resolution GeometricInvariance::Off, // Off | MirrorFlip | MirrorFlipRotate90 ); let mut tool = SimilarImages::new(params); tool.search(&stop_flag, progress_sender); // Results: Vec> for group in tool.get_similar_images() { } // With reference folders: Vec<(ImagesEntry, Vec)> for (reference, similars) in tool.get_similar_images_referenced() { } ``` -------------------------------- ### Build Czkawka with HEIF/AVIF support Source: https://github.com/qarmin/czkawka/blob/master/instructions/FAQ.md Use this command to compile the binary with the necessary feature flags for HEIF and AVIF image processing. ```bash cargo run --bin krokiet --features "winit_femtovg,winit_software,heif,libavif,libraw" ``` -------------------------------- ### Logs and Diagnostics Source: https://github.com/qarmin/czkawka/blob/master/cedinia/TMP_INSTALL.md Commands to retrieve logs from the device and list connected hardware. ```shell just android_log # logcat: Rust stdout/stderr only just android_logc # logcat: everything from Cedinia just android_devices # list connected ADB devices ``` -------------------------------- ### Video Optimizer CLI Syntax Source: https://github.com/qarmin/czkawka/blob/master/instructions/Instruction_CLI.md Basic command structure for video optimization operations. ```shell czkawka_cli video-optimizer -d transcode [options] czkawka_cli video-optimizer -d crop [options] ``` -------------------------------- ### Enable Performance Debugging Source: https://github.com/qarmin/czkawka/blob/master/krokiet/README.md Sets environment variables to output performance and backend information during execution. ```shell SLINT_DEBUG_PERFORMANCE=refresh_lazy,console,overlay cargo run ``` -------------------------------- ### View source layout Source: https://github.com/qarmin/czkawka/blob/master/czkawka_cli/CLAUDE.md Displays the directory structure of the czkawka_cli source code. ```text czkawka_cli/src/ ├── main.rs # Entry point, thread spawning, tool dispatchers ├── commands.rs # All clap CLI argument definitions ├── parsers.rs # parse_* clap value-parser functions used by commands.rs └── progress.rs # indicatif progress bar rendering ``` -------------------------------- ### Justfile Task Reference Source: https://github.com/qarmin/czkawka/blob/master/AGENTS.md Common commands for running, testing, and managing translations in the Czkawka project. ```just just run krokiet # debug run just runr krokiet # fast_release run just fix # format + clippy + Python checks just translate # AI-translate all projects just validate_translations [--fix] just pack_translations # create i18n_translations.zip for Crowdin just unpack_translations just android # build + install + launch on device just androidr # release variant ``` -------------------------------- ### Set Portable Data Paths Source: https://github.com/qarmin/czkawka/blob/master/instructions/FAQ.md Configure custom locations for cache and config files using environment variables before launching the application. ```bat set CZKAWKA_CACHE_PATH=D:\czkawka\cache set CZKAWKA_CONFIG_PATH=D:\czkawka\config krokiet.exe ``` ```bash CZKAWKA_CACHE_PATH=/opt/czkawka/cache CZKAWKA_CONFIG_PATH=/opt/czkawka/config krokiet ```