sync
The kilm sync command attempts to update all configured symbol, footprint, and template libraries (type github) that are identified as Git repositories by running git pull within their directories.
This command helps keep your local copies of shared libraries synchronized with their remote Git repositories.
kilm sync [OPTIONS]Options
Section titled “Options”-
--dry-run: Show which libraries are detected as Git repositories and would be updated, but do not actually rungit pull. Example:kilm sync --dry-run -
--verbose: Show detailed output during the update process, including the full output from thegit pullcommands. Example:kilm sync --verbose -
--auto-setup: If thegit pulloperation results in changes that likely require updating KiCad’s configuration (e.g., new symbol or footprint libraries detected), automatically runkilm setupafter the updates are complete. Default:False. Example:kilm sync --auto-setup -
--help: Show the help message and exit.
Behavior
Section titled “Behavior”- Reads KiLM Config: Loads library information from
config.yaml. - Identifies
githubLibraries: Filters for libraries with typegithub. - Checks for
.git: For each library path, checks if it exists and contains a.gitdirectory. - Runs
git pull: If it’s a valid Git repository, navigates into the directory and executesgit pull(unless--dry-run). - Checks for Changes: After a successful pull, analyzes the output and file system to detect if new symbol libraries (
.kicad_sym), footprint libraries (.pretty), or templates (templates/*/metadata.yaml) were added. - Reports & Optional Setup: Summarizes the update results. If changes requiring configuration updates were detected, it recommends running
kilm setupor runs it automatically if--auto-setupwas specified.
Examples
Section titled “Examples”Sync all Git-based libraries:
kilm syncPreview which libraries would be synced:
kilm sync --dry-runSync libraries with detailed output:
kilm sync --verboseSync libraries and automatically run setup if needed:
kilm sync --auto-setupTroubleshooting
Section titled “Troubleshooting”Git pull fails with merge conflicts: Navigate to the library directory and resolve conflicts manually using standard Git commands:
cd /path/to/librarygit statusgit merge --continue # after resolving conflictsLibrary not found or not a Git repository:
- Ensure the library path is correct in your KiLM configuration
- Verify the directory contains a
.gitfolder - Use
kilm listto check available libraries
Permission denied errors:
- Check file permissions in the library directory
- Ensure you have write access to the library path