Project-local JLC component library manager for KiCad
Project description
kicad-jlc-manager
Project-local JLC component library manager for KiCad
Bring the .venv / node_modules paradigm to KiCad component libraries. Manage JLCPCB components on a per-project basis with a declarative manifest file, just like pyproject.toml or package.json.
Why JLC Components?
Design for Manufacture (DFM) - When you design PCBs with components from the JLCPCB parts library, manufacturing becomes seamless. JLCPCB stocks thousands of components that can be automatically assembled onto your boards. By selecting parts from their database during the design phase, you get:
- Instant assembly: No need to source or ship components separately
- Lower costs: Basic parts (resistors, capacitors, common ICs) often have no assembly fees
- Faster turnaround: Components are already in stock at the fab
- Verified footprints: All parts have tested footprints and mounting specifications
This tool makes it trivial to browse, add, and manage JLC components directly in your KiCad workflow.
Why Project-Local Libraries?
Traditional KiCad workflows use globally configured component libraries, which creates several problems:
- No project portability: Libraries are configured per-machine, not per-project
- Dependency hell: Different projects can't use different versions of the same component
- Git unfriendly: No way to track which components a project actually uses
- Team collaboration issues: Everyone needs identical library configurations
kicad-jlc-manager solves this by creating project-local component libraries that live alongside your KiCad project, with a manifest file (jlcproject.toml) that tracks exactly which components your project uses.
Features
- Project-local libraries: Components live in
jlclib/(excluded from git, like.venv) - Declarative manifest:
jlcproject.tomltracks components (committed to git, likepyproject.toml) - Sync command: Reproduce exact component set from manifest (like
uv syncornpm install) - Component metadata: Automatically fetches descriptions from JLC API
- Explicit workflow: UV-inspired design requires
initbeforeadd - Portable paths: Uses
${KIPRJMOD}for KiCad path portability
Installation
# From PyPI (once published)
pip install kicad-jlc-manager
# For development
git clone https://github.com/yourusername/kicad-jlc-manager.git
cd kicad-jlc-manager
uv sync --group dev
Quick Start
# Start a new project (no KiCad files needed!)
mkdir my-board
cd my-board
# Initialize - creates minimal KiCad project files automatically
jlcmgr init
# Add JLC components to your project
jlcmgr add C194349 # 10k ohm 0402 resistor
jlcmgr add C23107 # 100nF 0402 capacitor
# Open in KiCad and start designing
kicad . # On macOS with alias: alias kicad='open -a KiCad'
# Note: Once KiCad opens, use File > Open Project and select the .kicad_pro file
# View your project's components
jlcmgr list
# Sync components (useful after git clone or pulling jlcproject.toml changes)
jlcmgr sync
Commands
jlcmgr init
Initialize the project library structure. If no KiCad project exists in the current directory, creates minimal KiCad project files automatically (project name defaults to directory name, just like uv).
Creates:
- Minimal KiCad project files (if not present):
<project-name>.kicad_pro- Project configuration<project-name>.kicad_sch- Empty schematic<project-name>.kicad_pcb- Empty PCB layout
jlclib/directory structure (symbol/ and footprint/ subdirectories)jlcproject.tomlmanifest file- Library table entries (
sym-lib-table,fp-lib-table) .gitignoreentry to excludejlclib/
Options:
--lib-dir: Custom library directory (default:jlclib)--lib-name: Custom library name (default:JLC_Project)
jlcmgr init
jlcmgr init --lib-dir custom_lib --lib-name MyProject
jlcmgr add <part>
Add a JLC component to the project. Downloads the component using JLC2KiCadLib and tracks it in jlcproject.toml.
jlcmgr add C194349
jlcmgr add C23107
jlcmgr list
List all components tracked in jlcproject.toml.
Options:
--detailed: Show detailed component information including JLC URLs
jlcmgr list
jlcmgr list --detailed
jlcmgr sync
Synchronize the project library with jlcproject.toml. Performs a clean sync:
- Removes existing
jlclib/directory - Recreates library structure
- Downloads all components from the manifest
This is similar to uv sync or npm install - it ensures your local library exactly matches the manifest.
jlcmgr sync
jlcmgr remove <part>
Remove a component from the project (coming soon).
jlcmgr remove C194349
Workflow
Starting a New Project (Streamlined)
The fastest way to start a new KiCad project with JLC component management:
# Create and initialize in one flow
mkdir my-board
cd my-board
jlcmgr init
# Add components
jlcmgr add C194349 # 10kΩ 0402 resistor
jlcmgr add C23107 # 100nF 0402 capacitor
jlcmgr add C2040 # LED 0805 Red
# Open in KiCad - components are ready to use!
kicad . # or: open -a KiCad .
# Once KiCad launches, go to File > Open Project and select my-board.kicad_pro
On macOS, add this to your ~/.zshrc for the kicad command:
# Allow 'kicad .' to open KiCad in current directory
alias kicad='open -a KiCad'
Note: The kicad . command opens the KiCad application but doesn't automatically load your project. After KiCad launches, you'll need to manually open the project file (.kicad_pro) via File > Open Project.
What happens during jlcmgr init:
- Creates minimal KiCad project files (if none exist):
my-board.kicad_pro- Project configmy-board.kicad_sch- Empty schematicmy-board.kicad_pcb- Empty PCB- Project name automatically matches directory name
- Sets up library infrastructure:
jlclib/directory for componentsjlcproject.tomlmanifestsym-lib-tableandfp-lib-tableconfigurations.gitignoreto exclude generated files
Working with Existing Projects
If you already have a KiCad project:
# Navigate to existing project directory
cd ~/existing-project/
# Initialize jlcmgr (detects existing .kicad_pro)
jlcmgr init
# Add components as you design
jlcmgr add C194349
jlcmgr list
Git Workflow
# After adding components, commit the manifest
git add jlcproject.toml sym-lib-table fp-lib-table .gitignore
git commit -m "Add JLC component library with resistors and capacitors"
# The jlclib/ directory is automatically excluded via .gitignore
# (just like .venv or node_modules)
Cloning/Sharing Projects
# Clone a project with jlcproject.toml
git clone https://github.com/someone/cool-project.git
cd cool-project/
# Sync to download all components
jlcmgr sync
# Library is now populated, ready to open in KiCad
File Structure
After running jlcmgr init and adding components, your project will look like:
my-project/
├── .gitignore # Updated to exclude jlclib/
├── jlcproject.toml # Component manifest (committed to git)
├── sym-lib-table # Symbol library configuration
├── fp-lib-table # Footprint library configuration
├── my-project.kicad_pro # KiCad project file
├── my-project.kicad_pcb # KiCad PCB file
├── my-project.kicad_sch # KiCad schematic file
└── jlclib/ # Project-local library (excluded from git)
├── footprint/
│ └── *.kicad_mod
└── symbol/
└── jlc_project.kicad_sym
jlcproject.toml Format
The manifest file uses a simple TOML format to track component part numbers:
components = [
"C194349",
"C23107",
"C2040",
]
[project]
lib-dir = "jlclib"
lib-name = "JLC_Project"
Component descriptions and metadata are fetched from the JLC API and stored directly in the KiCad symbol files, not in the manifest.
How It Works
Library Tables
kicad-jlc-manager creates or updates two library table files in your project directory:
sym-lib-table - Configures the symbol library:
(sym_lib_table
(version 7)
(lib (name "JLC_Project")
(type "KiCad")
(uri "${KIPRJMOD}/jlclib/symbol/jlc_project.kicad_sym")
(options "")
(descr "Project-local JLC components"))
)
fp-lib-table - Configures the footprint library:
(fp_lib_table
(version 7)
(lib (name "JLC_Project")
(type "KiCad")
(uri "${KIPRJMOD}/jlclib/footprint")
(options "")
(descr "Project-local JLC component footprints"))
)
The ${KIPRJMOD} variable ensures paths work correctly regardless of where the project is located.
Component Generation
Under the hood, kicad-jlc-manager uses the excellent JLC2KiCadLib by Nicolas Toussaint to fetch component data from JLCPCB and generate KiCad-compatible symbol and footprint files.
What JLC2KiCadLib provides:
- Downloads component specifications from JLCPCB API
- Generates KiCad symbol files (
.kicad_sym) - Creates footprint files (
.kicad_mod) - Includes 3D models when available
What kicad-jlc-manager adds:
- Enhanced component metadata: Fetches human-readable descriptions from the JLC API and stores them in the symbol library's
valueanddescriptionfields - Better component values: Extracts and normalizes electrical values (resistance, capacitance, etc.) for display in schematics
- Project-local management: Wraps JLC2KiCadLib with a UV-inspired workflow for project isolation
- Git-friendly tracking: Maintains a declarative manifest for reproducible builds
When you add a component with jlcmgr add C194349, the tool:
- Calls JLC2KiCadLib to generate the component files
- Fetches the component's description from the JLC API
- Enhances the symbol with the description as the component value
- Tracks the component in your
jlcproject.tomlmanifest
Requirements
- Python >= 3.12
- KiCad 7.0 or later
- JLC2KiCadLib >= 1.0.36 (installed automatically)
Development
# Clone the repository
git clone https://github.com/yourusername/kicad-jlc-manager.git
cd kicad-jlc-manager
# Install with dev dependencies
uv sync --group dev
# Run linter
make lint
# Auto-fix linting issues
make lint-fix
# Run tests
make test
Design Philosophy
This tool is inspired by modern package managers like uv and npm:
- Explicit initialization: Requires
jlcmgr initbefore adding components (no auto-magic) - Clean separation: Library files excluded from git, manifest committed
- Reproducible:
jlcmgr synccreates identical library state from manifest - Project-scoped: Each project has its own isolated component library
Comparison to Global Libraries
| Aspect | Global Libraries | kicad-jlc-manager |
|---|---|---|
| Configuration | Per-machine | Per-project |
| Portability | Manual setup on each machine | Automatic via manifest |
| Git tracking | No component tracking | Explicit manifest |
| Version control | Implicit/manual | Declarative in TOML |
| Team collaboration | Manual sync required | Git handles sync |
| Isolation | Shared across projects | Isolated per project |
Credits and Related Projects
This tool builds upon the excellent work of:
- JLC2KiCadLib by Nicolas Toussaint - The core component file generator that does the heavy lifting of converting JLCPCB data into KiCad symbols and footprints. Without this library, kicad-jlc-manager would not be possible.
- JLCPCB Parts Library - The component database that makes design-for-manufacture accessible to hobbyists and professionals alike.
License
MIT
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Development Setup
# Clone the repository
git clone https://github.com/yourusername/kicad-jlc-manager.git
cd kicad-jlc-manager
# Install with dev dependencies
uv sync --group dev
# Verify installation
uv run jlcmgr --help
Running Tests and Linting
# Run linter (check only)
make lint
# Run linter with auto-fix
make lint-fix
# Run tests with coverage
make test
# Run tests with detailed coverage report
make test-cov
# Run tests without coverage (faster)
make test-quick
# View all available commands
make help
Semantic Versioning
This project uses Python Semantic Release for automated versioning and releases. Versions are determined automatically based on commit messages following the Conventional Commits specification.
Commit Message Format
Use these prefixes to control version bumping:
feat:- New feature (bumps minor version: 0.1.0 → 0.2.0)fix:- Bug fix (bumps patch version: 0.1.0 → 0.1.1)perf:- Performance improvement (bumps patch version)docs:- Documentation changes (no version bump)style:- Code style changes (no version bump)refactor:- Code refactoring (no version bump)test:- Test changes (no version bump)chore:- Build/tooling changes (no version bump)ci:- CI/CD changes (no version bump)
For breaking changes, add ! after the type or include BREAKING CHANGE: in the commit body (bumps major version: 0.1.0 → 1.0.0).
Commit Examples
# Feature (minor version bump)
git commit -m "feat: add component search functionality"
# Bug fix (patch version bump)
git commit -m "fix: resolve sync error with missing files"
# Bug fix with more detail
git commit -m "fix: handle empty component descriptions in API response
Previously the tool would crash if JLC API returned null description.
Now it gracefully handles missing descriptions."
# Breaking change (major version bump)
git commit -m "feat!: redesign library structure
BREAKING CHANGE: Library directory structure has changed from flat
to nested. Users need to run 'jlcmgr sync' after upgrading."
# Non-versioned changes
git commit -m "docs: update installation instructions"
git commit -m "chore: update dependencies"
Local Version Checking
# Preview what the next version would be (dry-run)
make version
# Create a release locally (updates version, creates tag)
make release
# After local release, push with tags
git push --follow-tags
Automated Release Process
When you push to the main branch:
-
PR Workflow (
.github/workflows/pr-checks.yaml)- Runs
make lintandmake testin parallel - Must pass before merging
- Runs
-
Publish Workflow (
.github/workflows/publish.yaml)- Runs
make lintandmake testin parallel - Analyzes commits since last release
- Determines next version based on conventional commits
- Updates
pyproject.tomlversion andCHANGELOG.md - Creates git tag (e.g.,
v0.2.0) - Builds package with
uv build - Publishes to PyPI using trusted publisher
- Pushes version bump commit and tag back to repo
- Runs
Note: Only commits following the conventional format will trigger version bumps. Regular commits (without conventional prefixes) won't create new releases.
Pull Request Workflow
-
Fork the repository
-
Create your feature branch (
git checkout -b feature/amazing-feature) -
Make your changes with conventional commits:
git commit -m "feat: add new awesome feature" git commit -m "test: add tests for awesome feature" git commit -m "docs: document awesome feature"
-
Push to your fork (
git push origin feature/amazing-feature) -
Open a Pull Request
- The PR checks workflow will run tests and linting
- Ensure all checks pass before requesting review
-
After merge to
main, the release workflow will automatically:- Determine the new version from your commits
- Publish to PyPI if version was bumped
- Create a GitHub release with changelog
Code Style
- Python 3.12+
- Line length: 100 characters
- Use type hints (
str | Nonestyle) - Follow ruff linting rules (see
pyproject.toml) - Write tests for new features
- Update documentation as needed
Support
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kicad_jlc_manager-0.1.0.tar.gz.
File metadata
- Download URL: kicad_jlc_manager-0.1.0.tar.gz
- Upload date:
- Size: 17.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b3708e03a9c719fe2907dc2dac4b93cbf6186354a705402038249c8b4aecc82a
|
|
| MD5 |
5485492a02ac7b896f645c5d250da3c3
|
|
| BLAKE2b-256 |
6242ad7a1d6b99ae3b3429dccd59f56f57ec4ea949f5eb3acda935e9fb0c714c
|
Provenance
The following attestation bundles were made for kicad_jlc_manager-0.1.0.tar.gz:
Publisher:
publish.yaml on peterb154/kicad-jlc-manager
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kicad_jlc_manager-0.1.0.tar.gz -
Subject digest:
b3708e03a9c719fe2907dc2dac4b93cbf6186354a705402038249c8b4aecc82a - Sigstore transparency entry: 715653768
- Sigstore integration time:
-
Permalink:
peterb154/kicad-jlc-manager@453a93dffe588086b1acc976fadf5b4c222b262c -
Branch / Tag:
refs/heads/main - Owner: https://github.com/peterb154
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@453a93dffe588086b1acc976fadf5b4c222b262c -
Trigger Event:
push
-
Statement type:
File details
Details for the file kicad_jlc_manager-0.1.0-py3-none-any.whl.
File metadata
- Download URL: kicad_jlc_manager-0.1.0-py3-none-any.whl
- Upload date:
- Size: 20.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
55880ee458a9ef96f8d19882580271faf0dfa36c435ee2f536ccb2ea6b70eacf
|
|
| MD5 |
08b561e4c164027701dd222f0aac2f69
|
|
| BLAKE2b-256 |
57181a7a3fbec0cce2901588e9f8b92b54a3afa0eb0531f43ac2c1b7e228c312
|
Provenance
The following attestation bundles were made for kicad_jlc_manager-0.1.0-py3-none-any.whl:
Publisher:
publish.yaml on peterb154/kicad-jlc-manager
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kicad_jlc_manager-0.1.0-py3-none-any.whl -
Subject digest:
55880ee458a9ef96f8d19882580271faf0dfa36c435ee2f536ccb2ea6b70eacf - Sigstore transparency entry: 715653769
- Sigstore integration time:
-
Permalink:
peterb154/kicad-jlc-manager@453a93dffe588086b1acc976fadf5b4c222b262c -
Branch / Tag:
refs/heads/main - Owner: https://github.com/peterb154
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@453a93dffe588086b1acc976fadf5b4c222b262c -
Trigger Event:
push
-
Statement type: