A CLI tool to automatically sync files in a directory with a remote Git repository. Designed for use with Obsidian Vaults, but applicable to any folder you want to keep in sync.
- Watches for file changes in a specified directory and all its sub-directories
- Commits changes to a local Git repository whenever a file is modified
- Pushes commits to a remote repository
- Automatically initializes a Git repository if none exists in the specified directory
- Allows cloning from a remote repository if needed
- User-friendly setup for Git username and email
-
Clone the repository:
git clone https://github.com/samerzmd/obsidianer.git
-
Navigate to the project directory:
cd obsidianer
-
Build the project:
go build -o obsidianer ./cmd/
This will generate an executable named obsidianer
.
Run the executable and follow the prompts.
./obsidianer
You will be asked to specify the path of the directory you want to watch. If the directory is not a Git repository, you'll also be prompted to provide an empty Git repository URL.
To make the obsidianer command available globally, add the executable to your PATH.
Add the following line to your ~/.bashrc or ~/.bash_profile file:
export PATH=$PATH:/path/to/obsidianer/directory
Then apply the changes:
source ~/.bashrc # or source ~/.bash_profile
Add the following line to your ~/.zshrc file:
export PATH=$PATH:/path/to/obsidianer/directory
Then apply the changes:
source ~/.zshrc
Replace /path/to/obsidianer/directory with the actual directory path where your obsidianer executable resides.
After doing this, you should be able to run obsidianer from any directory in the terminal.
Run go test ./...
from the root directory to run all tests.
Please read the CONTRIBUTING.md for details on how to contribute to this project.
This project is licensed under the MIT License - see the LICENSE.md file for details.