VAULT
InfantLabObsidianTools
Some command line tools for organising Obsidian vault files and properties
0 Stars
GitHubObsidian Tools
A collection of JavaScript tools for working with Obsidian.md vaults, focusing on file and property organization utilities.
Features
- š 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
Installation
npm install
Usage
CLI Mode
npm start
Development Mode (with auto-reload)
npm run dev
Run Tests
npm test
Configuration Management
# 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
Command Line Options
-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)
Project Structure
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
Available Tools
File Organization
- 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
Property Management
- Standardize property names and formats
- Add missing properties to files
- Reorganize property order
- Clean up duplicate or invalid properties
Configuration
The tool supports comprehensive configuration management through both interactive CLI and configuration files.
Configuration File Location
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
Available Configuration Settings
General Settings
- Default Vault Path: Path to your primary Obsidian vault
- Config File Location: Custom path for configuration file
Logging Settings
- Log Level: debug, info, warn, error
- Log to File: Enable/disable file logging
- Log File Path: Custom log file location
Backup Settings
- Create Backups: Automatically backup files before changes
- Backup Location: Directory for backup files
- Max Backups: Maximum number of backups to retain
Validation Settings
- 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
Interactive Configuration
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
Future Plugin Migration
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
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Run
npm testandnpm run lint - Submit a pull request
License
MIT License - see LICENSE file for details
How to Install
- Download the ZIP or clone the repository
- Open the folder as a vault in Obsidian (File ā Open Vault)
- Obsidian will prompt you to install required plugins
Stats
Stars
0
Forks
0
License
NOASSERTION
Last updated 10mo ago