Commit Graph

54 Commits

Author SHA1 Message Date
glitchySid
3899f94c74 fixed clippy and formatting issue. 2026-01-10 22:28:49 +05:30
glitchySid
02b450865b Refactor cache API and expand installation docs
- Remove CacheCheckResult and simplify Cache::check_cache to return
  Option<OrganizationPlan>
- Replace cache_response_with_metadata with cache_response that takes a
  base path; update Gemini client and tests to use new API
- Improve load_or_create error handling and early-return when cache file
  missing
- Expand README/docs/INSTALLATION.md with detailed per-OS install and
  PATH instructions
2026-01-10 22:24:05 +05:30
glitchySid
10e508fa0e refactor: reorganize file operations and extract test modules
- Extract mover and undo functionality into dedicated modules (mover/ and undo/ subdirectories)
- Move cross-platform file operations to separate file_ops.rs module for reusability
- Extract batch and categorizer tests into separate test files (batch_test.rs, categorizer_test.rs)
- Refactor orchestrator.rs with extracted helper functions for improved readability
  - Separate cache and undo log initialization
  - Extract path resolution and offline mode determination logic
  - Simplify main organization flow by delegating to helper functions
- Update module exports to expose new types and functions (MoveError, MoveSummary, UndoError, UndoSummary)
- Reduce code duplication of move_file_cross_platform implementation
2026-01-10 21:08:00 +05:30
Siddhesh Mhatre
263f938734 Merge pull request #16 from glitchySid/cli-refactor-cache-optimization
Cli refactor cache optimization
2026-01-10 00:08:19 +05:30
glitchySid
23b14e6a7f added more tests 2026-01-10 00:05:26 +05:30
glitchySid
b6db79774a fix the warnings 2026-01-09 17:45:13 +05:30
glitchySid
ba0ea3f221 perf: eliminate unnecessary clones and improve API ergonomics
- PromptBuilder::new now takes &[String] instead of Vec<String>
- GeminiClient::new now takes &str, &[String] instead of owned values
- FileBatch::from_path now takes &Path instead of PathBuf
- categorize_files_offline now takes Vec<String> (ownership) instead of &[String]
- handle_offline_organization now takes FileBatch by value

These changes eliminate ~5-50 KB of unnecessary allocations for typical
file counts, reduce allocator pressure, and improve API clarity by properly
expressing ownership semantics.

No functional changes - all tests pass.
2026-01-08 23:42:10 +05:30
glitchySid
eeb07983cb refactor: modularize CLI and optimize cache metadata lookups
- Extract error handling, path validation, and handlers into separate modules
- Add CacheCheckResult to pre-fetch metadata and avoid double lookups
- Deprecate legacy cache methods in favor of optimized alternatives
- Enable tokio fs feature for async file operations
- Remove debug profile from release build
2026-01-08 23:18:39 +05:30
Siddhesh Mhatre
ff7f563560 Merge pull request #15 from glitchySid/feature/offline-mode
feat: add offline mode with extension-based file categorization
2026-01-08 22:34:34 +05:30
glitchySid
eb5db4f4e6 feat: add offline mode with extension-based file categorization
- Add --offline flag to force offline mode
- Automatic detection when Gemini API is unavailable
- Prompt user to continue with offline mode on API failure
- Extension-based categorization for 80+ file extensions
- Add Video category to default categories
- Skip files with unknown extensions in offline mode
2026-01-08 22:30:22 +05:30
Siddhesh Mhatre
818fa01160 Merge pull request #14 from glitchySid/feature/blake3-optimization
changed the cache in workflows
2026-01-08 20:44:25 +05:30
glitchySid
2ad9761d2d changed the cache in workflows 2026-01-08 20:42:03 +05:30
Siddhesh Mhatre
eceebf154d Merge pull request #13 from glitchySid/feature/blake3-optimization
Feature/blake3 optimization
2026-01-08 20:38:20 +05:30
glitchySid
501dc9d7d0 removed unnecessary clone because of unrelated result. 2026-01-08 20:35:16 +05:30
glitchySid
32d08a888f perf: replace SHA256+hex with Blake3 for cache key generation
- Switch from sha2 crate to blake3 for faster hashing (4-7x speedup)
- Use Blake3's built-in to_hex() instead of separate hex crate
- Remove hex and sha2 dependencies
- Eliminates 40% CPU bottleneck in generate_cache_key()
2026-01-08 20:33:44 +05:30
Siddhesh Mhatre
117708f373 Merge pull request #12 from glitchySid/feature/custom-path-support
Feature/custom path support
2026-01-07 22:26:51 +05:30
glitchySid
6ed5e80d0a docs: update documentation for custom path support
- Add PATH argument to command-line options tables
- Add Custom Path Organization section with examples
- Update basic usage examples to include path usage
- Add combined options examples with custom paths
- Add Custom Path Support section to README
- Document path validation, normalization, and use cases

Documentation now fully covers the new custom path functionality
with clear examples and explanations.
2026-01-07 22:22:18 +05:30
glitchySid
3aa82d3f90 feat: add custom path support with comprehensive optimizations
- Add optional path argument to organize any directory instead of configured download folder
- Implement path validation and normalization for security and consistency
- Remove unnecessary cloning operations for better performance
- Extract magic numbers to named constants for better maintainability
- Add comprehensive documentation and error handling
- Improve error messages with better context and formatting

Key improvements:
- Performance: Eliminates unnecessary PathBuf allocations
- Security: Path normalization prevents path traversal attacks
- Robustness: Early validation prevents silent failures
- Code Quality: Better documentation, consistent patterns, improved error handling

The implementation supports:
- Current directory: ./noentropy .
- Absolute paths: ./noentropy /path/to/folder
- Relative paths: ./noentropy ./subfolder
- Backward compatibility: ./noentropy (uses configured download folder)

All existing tests pass, no regressions introduced.
2026-01-07 22:18:57 +05:30
Siddhesh Mhatre
b30a64d4ad Merge pull request #11 from glitchySid/docs/reconstruction
docs: restructure documentation into organized files
2026-01-02 02:01:03 +05:30
glitchySid
d4e8dbc6b3 docs: restructure documentation into organized files
Split the 630-line README.md into focused, well-organized documentation:

- README.md: Concise overview with quick start and links
- docs/INSTALLATION.md: Installation instructions and setup
- docs/CONFIGURATION.md: Configuration options and custom categories
- docs/USAGE.md: Command-line options and usage examples
- docs/HOW_IT_WORKS.md: Architecture and internal processes
- docs/TROUBLESHOOTING.md: Common issues and solutions
- docs/DEVELOPMENT.md: Project structure and development guide
- docs/CONTRIBUTING.md: Contribution guidelines and standards

Benefits:
- Main README is now clean and welcoming (~150 lines vs 630)
- Each doc has a clear, focused purpose
- Better navigation with cross-linking between docs
- Follows GitHub best practices with docs/ directory
- Easier to maintain and update specific sections
2026-01-02 00:55:29 +05:30
Siddhesh Mhatre
876652230e Merge pull request #10 from glitchySid/feature/changeapikey
added usage for --change-api key in docs
2026-01-02 00:43:05 +05:30
glitchySid
0eedb61455 added usage for --change-api key in docs 2026-01-02 00:42:32 +05:30
Siddhesh Mhatre
2dd5028746 Merge pull request #9 from glitchySid/feature/changeapikey
feat: add --change-key flag to update API key
2025-12-31 21:26:03 +05:30
glitchySid
adfc426ede feat: add --change-key flag to update API key 2025-12-31 21:22:46 +05:30
Siddhesh Mhatre
a4c33b8dab Merge pull request #8 from glitchySid/feature/customcategories
Feature/customcategories
2025-12-31 13:07:24 +05:30
glitchySid
e1974599c8 changed the version 2025-12-31 13:04:24 +05:30
glitchySid
1f0547a210 Add custom categories feature
- Add support for user-defined custom categories in config.toml
- Update Config struct with categories field and default_categories() function
- Thread categories through GeminiClient and prompt builder
- Update AI prompts to use dynamic categories instead of hardcoded ones
- Add comprehensive documentation with examples for different use cases
- Update tests to support new categories field
- Maintain backward compatibility with default categories
- Update version from 1.0.3 to 1.0.4

Closes feature request for custom categories.
2025-12-31 13:01:15 +05:30
Siddhesh Mhatre
08a272c4de Merge pull request #7 from glitchySid/fix/windowscompatibility
Fix critical Windows compatibility issues and implement file batching
2025-12-30 19:48:43 +05:30
glitchySid
282e032086 Fix critical Windows compatibility issues and implement file batching
- Fix critical HOME variable bug that crashed on Windows
  * Replace hardcoded HOME env var with Config::get_data_dir()
  * Now uses cross-platform directories crate
  * Resolves to %APPDATA% on Windows, ~/.config on Linux/macOS

- Fix Unix-style path separators in display output
  * Use std::path::MAIN_SEPARATOR for OS-appropriate paths
  * Windows now shows backslashes, Unix shows forward slashes

- Implement batching for large file lists (100+ files)
  * Split file processing into batches of 50 files
  * Prevents network timeouts and API payload size issues
  * Added progress feedback for batch processing
  * Increased timeout from 30s to 120s per batch

- Bump version to 1.0.3

All tests passing, clippy clean, fully cross-platform compatible
2025-12-30 19:43:19 +05:30
Siddhesh Mhatre
5a18edf3da Merge pull request #6 from glitchySid/refactor
Refactor
2025-12-30 19:30:03 +05:30
glitchySid
9843303d9a fixed the network error when files number exceed 60-70
increased the timeout sec from 30 to 120
and added batching if batch size exceeds 50(thats where it seems to
cause problem)
2025-12-30 19:27:45 +05:30
glitchySid
7c551126cc update README with new modular file structure and fix unused import
- Updated Project Structure section to reflect new modular architecture
- Added detailed module breakdown (cli, files, gemini, models, settings, storage)
- Included Module Overview with descriptions of each module's purpose
- Removed HACKATHON_REVIEW.md file
- Fixed unused import warning in src/files/batch.rs
2025-12-30 02:24:44 +05:30
Siddhesh Mhatre
66a665f336 Merge pull request #4 from glitchySid/refactor
refactored every component thoroughly.
2025-12-30 02:10:46 +05:30
glitchySid
2211057e4f fixed formatting 2025-12-30 02:10:00 +05:30
glitchySid
33784d8f1d refactored every component thoroughly. 2025-12-30 02:08:26 +05:30
Siddhesh Mhatre
9a54956542 Merge pull request #3 from glitchySid/feature/undo
added undo feature
2025-12-29 21:55:11 +05:30
glitchySid
a7668a6f0f fixed formatting 2025-12-29 21:54:11 +05:30
glitchySid
79cfae74ea added undo feature
feature added by Agent
2025-12-29 21:47:57 +05:30
Siddhesh Mhatre
2a79a8838b Merge pull request #2 from glitchySid/docs/installation
added usage guide for --recursive flag
2025-12-29 21:09:55 +05:30
glitchySid
5e57b5f119 added usage guide for --recursive flag 2025-12-29 21:09:10 +05:30
Siddhesh Mhatre
975182f218 Merge pull request #1 from glitchySid/feature/recursive
added recursive file reading using --recursive flag.
2025-12-29 18:54:09 +05:30
glitchySid
6df8af91bb added recursive file reading using --recursive flag.
added a feature to scan subdirectory and organize the file structure
even further.
2025-12-29 18:47:50 +05:30
glitchySid
09828ee2f5 ci: Add multi-platform release workflow with GitHub Actions 2025-12-29 12:50:25 +05:30
glitchySid
06eff6fcf8 style: Fix rustfmt formatting issues 2025-12-29 00:54:29 +05:30
glitchySid
d25dcaa0de fix: Resolve clippy warnings - allow dead code and collapse if statements 2025-12-29 00:49:53 +05:30
glitchySid
2dc269b148 ci: Add GitHub Actions workflow with clippy and fmt checks 2025-12-29 00:46:20 +05:30
glitchySid
1a72116b9d refactor: Simplify codebase by extracting modules and helpers
Extract code into focused modules for better maintainability:

New modules:
- gemini_types.rs (32 lines) - Response type definitions
- gemini_helpers.rs (51 lines) - Prompt builder and conversion helpers
- prompt.rs (130 lines) - User input and validation logic

Refactored files:
- gemini.rs: 278 -> 259 lines (-19 lines)
  * Extract response parsing into helper methods
  * Extract request building into separate methods
  * Extract retry logic into dedicated functions
  * Use PromptBuilder for cleaner prompt construction

- config.rs: 275 -> 127 lines (-148 lines)
  * Extract all prompting logic to prompt.rs module
  * Simplify with Default trait for Config
  * Cleaner API methods

Benefits:
- Better separation of concerns
- Easier to test and maintain
- Clearer module boundaries
- Reduced nesting and complexity
- All 31 tests still passing
2025-12-29 00:35:14 +05:30
glitchySid
32c1f283ac changes to gitignore 2025-12-29 00:16:48 +05:30
glitchySid
3cdcd33439 feat: Add comprehensive improvements - CLI, error handling, and docs
- Add CLI argument parsing with clap (dry-run, max-concurrent options)
- Replace .env configuration with interactive prompts and TOML config
- Add BaseDirs-based configuration storage in ~/.config/noentropy/
- Improve Gemini API client with configurable model and timeout
- Add concurrent processing with semaphore for rate limiting
- Improve error handling with retry logic and exponential backoff
- Add comprehensive README with installation and usage instructions
- Add config.example.toml template for users
- Update main.rs with better UX and colored output
- Add lib.rs exports for config module
- Refactor error response parsing for cleaner code
- Update API endpoint to use configurable model parameter
- Add proper error type handling in gemini_errors.rs
2025-12-29 00:11:27 +05:30
glitchySid
bbf88fc4fc refactor: Separate tests into dedicated files to reduce source file sizes
- Extract all tests from cache.rs, files.rs, config.rs to separate test files
- Create cache_tests.rs, files_tests.rs, config_tests.rs
- Reduce cache.rs: 421 -> 220 lines (-191 lines)
- Reduce files.rs: 390 -> 264 lines (-126 lines)
- Reduce config.rs: 354 -> 275 lines (-79 lines)
- Total reduction: 396 lines from main source files
- All 31 tests still passing
2025-12-29 00:05:08 +05:30