A collection of JavaScript tools for working with Obsidian.md vaults, focusing on file and property organization utilities.
- 📁 File Organization: Tools to reorganize and structure your vault files
- 🏷️ Property Management: Utilities to manage and reorganize file properties (frontmatter)
- 🔄 Batch Operations: Process multiple files efficiently
- 🎯 Plugin Ready: Structured for future migration to an Obsidian plugin
npm install
npm start
npm run dev
npm test
# Access configuration settings interactively
npm start # Then select "Configure Settings"
# OR
node src/index.js config
# Use command line options
node src/index.js --help
node src/index.js --config path/to/config.json --vault path/to/vault --log-level debug
# Configure specific settings
node src/index.js config # Interactive configuration menu
-c, --config <path>
- Specify custom configuration file location-v, --vault <path>
- Override default vault path-l, --log-level <level>
- Set logging level (debug, info, warn, error)
src/
├── index.js # Main entry point and CLI interface
├── core/ # Core functionality modules
│ ├── vault-manager.js # Vault detection and management
│ ├── file-processor.js # File reading and processing
│ └── property-manager.js # Frontmatter property management
├── tools/ # Individual tool implementations
│ ├── file-organizer.js # File organization utilities
│ ├── property-organizer.js # Property reorganization tools
│ └── batch-processor.js # Batch operation utilities
└── utils/ # Utility functions
├── file-utils.js # File system utilities
├── markdown-utils.js # Markdown parsing utilities
└── logger.js # Logging utilities
tests/ # Test files
config/ # Configuration files
docs/ # Documentation
- Flexible Scope Selection: Choose to organize entire vault or specific folders
- Intelligent Folder Discovery: Browse and select from all available directories
- Multiple Organization Methods:
- Organize files by date created/modified
- Sort files into folders by tags or properties
- Organize by file type or size
- Rename files based on patterns or properties
- Custom folder structures
- Preview and Confirmation: See file counts and confirm before organizing
- System Folder Protection: Automatically excludes .obsidian, .git, and other system folders
- Standardize property names and formats
- Add missing properties to files
- Reorganize property order
- Clean up duplicate or invalid properties
The tool supports comprehensive configuration management through both interactive CLI and configuration files.
By default, settings are stored in config/settings.json
. You can specify a custom location:
node src/index.js --config /path/to/your/config.json
- Default Vault Path: Path to your primary Obsidian vault
- Config File Location: Custom path for configuration file
- Log Level: debug, info, warn, error
- Log to File: Enable/disable file logging
- Log File Path: Custom log file location
- Create Backups: Automatically backup files before changes
- Backup Location: Directory for backup files
- Max Backups: Maximum number of backups to retain
- Check Empty Files: Validate empty file handling
- Check Malformed Frontmatter: Validate YAML frontmatter syntax
- Check Broken Links: Detect broken internal links
- Max Line Length: Maximum line length validation
Use the interactive configuration menu to easily manage all settings:
node src/index.js config
Available options:
- 🔄 Switch Default Vault
- 📁 Set Config File Location
- 📊 Set Logging Level
- 💾 Configure Backup Settings
- ✅ Configure Validation Settings
- 📋 View Current Settings
- 🔧 Advanced Settings
- ↩️ Reset to Defaults
This project is structured to facilitate future migration to an Obsidian plugin:
- Modular architecture with clear separation of concerns
- No direct DOM manipulation (console-based for now)
- Plugin-compatible file structure and naming conventions
- Extensible tool system
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Run
npm test
andnpm run lint
- Submit a pull request
MIT License - see LICENSE file for details