clider-sync
v1.0.4
Published
A simple utility to keep `CONVENTIONS.md` and `.clinerules` files in sync within a project directory.
Readme
clider-sync
A simple utility to keep CONVENTIONS.md and .clinerules files in sync within a project directory.
Aider uses CONVENTIONS.md (as a convention) and Cline uses .clinerules. If you use both Aider and Cline, you might want to keep them in sync.
This package is designed to help maintain consistency between a human-readable CONVENTIONS.md file (which might contain project conventions, guidelines, or rules) and a machine-readable .clinerules file (potentially used by tools or linters).
The file that was more recently modified will be used to update or create the other file.
How it Works
The script performs the following actions in the current working directory:
- Checks for files: It looks for
CONVENTIONS.md(case-insensitively) and.clinerules. - Handles missing files:
- If neither file exists, it exits with a message.
- If only
CONVENTIONS.mdexists, it creates.clinerulesand copies the content fromCONVENTIONS.md. - If only
.clinerulesexists, it createsCONVENTIONS.mdand copies the content from.clinerules.
- Syncs existing files:
- If both files exist, it compares their content.
- If the content is different, it checks the modification time of each file.
- The file with the older modification time is updated with the content of the newer file.
- If modification times are the same, it defaults to updating
.clineruleswith the content ofCONVENTIONS.md. - If the content is the same, it exits with a message indicating the files are already in sync.
Installation
npm install clider-syncor
pnpm install clider-syncUsage
To run manually:
npx clider-syncOr if installed globally:
clider-sync