- KiCad
My private KiCad repository with symbols, 3D models (most of the models are delivered by the part manufacturer, GrabCAD, 3D ContentCentral or SnapEDA), and footprints for different projects.
Please write an e-mail to [email protected] if you have any questions.
Download the repository and create a environment variable with the name KICAD_LIBRARY. Set the path of the variable to the location of the repository.
The repository includes initialization scripts for creating new KiCad projects from the template:
init-project.ps1- Windows PowerShell scriptinit-project.sh- Linux/macOS Bash script
The initialization script automates the complete setup of a new KiCad project with the following features:
- Interactive Project Setup: Prompts for project information including project name, board name, designer details, company name, and GitHub repository URL
- PCB Template Selection: Allows selection from available PCB templates with different manufacturers, thicknesses, and layer counts
- License Selection: Interactive menu to select an open source license (MIT, Apache, GPL, BSD, etc.) or no license
- Project Structure Creation: Copies the complete project template structure including hardware, firmware, CAD, and documentation directories
- File Customization: Automatically renames and updates all project files with the specified names
- Metadata Updates:
- Updates KiCad project files (.kicad_pro, .kicad_sch, .kicad_pcb) with project metadata
- Sets text variables:
PROJECT_NAME,BOARD_NAME,DESIGNER,COMPANY - Updates sheet title in the main schematic to match the board name
- Updates KiBot configuration files with project-specific values
- Documentation Generation: Creates initial README.md, AsciiDoc documentation, and license files
- Workflow Configuration: Updates GitHub Actions workflows for PCB manufacturing, documentation, and releases
- Git Repository Initialization: Sets up a new Git repository with initial commit and optional push to GitHub
Windows:
cd /path/to/KiCad
.\init-project.ps1Linux/macOS:
cd /path/to/KiCad
./init-project.shThe script will guide you through an interactive setup process. After completion, your new project directory will contain a fully configured KiCad project ready for development.
- Windows: PowerShell 5.1 or later
- Linux/macOS: Bash, Python 3 (for JSON processing)
- Git (for repository initialization)
- KiCad 9.0 or later
Note for Linux/macOS: The script checks if Python 3 is properly installed and will provide installation instructions if needed.
The library contain the following directory and file structure:
3D: All 3D models instepformat used by the libraryDrawings: Inventor projects for different 3D modelsFootprints: Part footprintsLayout: Layout templatesScripts: Python scripts for KiCadSymbols: Part symbols__Project__: Project template
The project template supports multiple PCB stackup configurations through template files. Templates must be placed in the __Project__/hardware/ directory.
PCB template files must follow this exact naming pattern:
Template - <manufacturer>_<thickness>_<layers>-layer.kicad_pcbComponents:
Template -- Fixed prefix (required)<manufacturer>- PCB manufacturer name (e.g., pcbway, jlcpcb, oshpark)<thickness>- Board thickness with unit (e.g., 1.6mm, 0.8mm, 2.0mm)<layers>- Number of copper layers (e.g., 2, 4, 6)-layer.kicad_pcb- Fixed suffix (required)
Examples:
Template - pcbway_1.6mm_4-layer.kicad_pcb- PCBWay, 1.6mm thickness, 4 layersTemplate - jlcpcb_1.6mm_2-layer.kicad_pcb- JLCPCB, 1.6mm thickness, 2 layersTemplate - oshpark_1.6mm_4-layer.kicad_pcb- OSH Park, 1.6mm thickness, 4 layers
During project initialization, the script will:
- Scan the
__Project__/hardware/directory for all template files - Parse the manufacturer, thickness, and layer count from each filename
- Present an interactive menu with available templates
- Copy the selected template as the base PCB file for the new project
To add a new PCB template:
- Create a KiCad PCB file with your desired stackup and design rules
- Name the file following the convention above
- Place it in the
__Project__/hardware/directory - The template will automatically appear in the selection menu
Template Requirements:
- Must be a valid
.kicad_pcbfile - Should include appropriate design rules for the manufacturer
- Should contain stackup configuration matching the specified layer count
- Recommended to include manufacturer-specific constraints (trace width, spacing, etc.)
The project template includes automated GitHub Actions workflows for continuous integration and deployment. All pipelines are located in __Project__/.github/workflows/.
File: pcb.yaml
Trigger: Push to main/master/dev branches, workflow dispatch, or version tags
The main pipeline for generating hardware manufacturing outputs using KiBot. Features include:
- Variant-based builds: Supports DRAFT, PRELIMINARY, CHECKED, and RELEASED variants
- Automated outputs: Generates Gerbers, drill files, BoM, assembly documents, 3D renders, and documentation
- ERC/DRC checks: Runs electrical and design rule checks for CHECKED and RELEASED variants
- Changelog management: Automatically updates CHANGELOG.md when releasing version tags
- Release creation: Creates GitHub releases with manufacturing files on version tags
- Cost analysis: Runs KiCost to estimate component costs using Mouser and DigiKey APIs
Variants:
DRAFT: Schematic only, generates PDF, netlist, and BoM (skips ERC/DRC)PRELIMINARY: Full outputs without ERC/DRC validationCHECKED: Full outputs with ERC/DRC validationRELEASED: Full outputs with ERC/DRC, automatically triggered on version tags
File: changelog-check.yaml
Trigger: Pull requests or pushes that modify hardware/CHANGELOG.md
Validates the CHANGELOG.md format to ensure compatibility with the keep-a-changelog standard:
- Section validation: Ensures all entries are grouped under Added, Changed, Fixed, or Removed
- Format checking: Verifies entries start with dash and space (
-) - Issue references: Validates that each entry contains an issue reference
(#number) - Duplicate detection: Warns about duplicate issue numbers in the Unreleased section
File: documentation.yaml
Trigger: Push to main/master branches or workflow dispatch
Generates and deploys project documentation:
- AsciiDoc processing: Converts documentation to HTML
- GitHub Pages deployment: Automatically publishes documentation to GitHub Pages
- Version tracking: Updates documentation with current project version
File: astyle.yaml
Trigger: Push or pull request affecting firmware source files
Enforces code formatting standards for firmware:
- Artistic Style (AStyle): Automatically formats C/C++ code
- Consistent style: Applies project-defined formatting rules
- Auto-commit: Commits formatted code back to the branch
File: create-dev-branch.yaml
Trigger: Workflow dispatch or release publication
Automates development branch management:
- Branch creation: Creates dev-vX.Y.Z branches for new releases
- Changelog setup: Adds Unreleased section to CHANGELOG.md for the new development cycle
- Version management: Prepares repository for next development iteration
File: esp_component_release.yaml
Trigger: Push of version tags
Publishes esp-idf components to Espressif Registry:
- Registry publication: Pushes to Espressif Registry for reuse in other projects
The CI/CD workflows require specific GitHub secrets to be configured in your repository settings. Navigate to Settings > Secrets and variables > Actions to add these secrets.
| Secret Name | Used In | Description | Required |
|---|---|---|---|
MOUSER_KEY |
pcb.yaml | API key for Mouser Electronics price lookup via KiCost | Optional |
DIGIKEY_KEY |
pcb.yaml | API key for DigiKey Electronics price lookup via KiCost | Optional |
IDF_COMPONENT_REGISTRY_TOKEN |
esp_component_release.yaml | Authentication token for ESP-IDF Component Registry | Required for ESP components |
These secrets are automatically provided by GitHub and do not need to be configured:
| Secret Name | Description |
|---|---|
GITHUB_TOKEN |
Automatically generated token for GitHub API access. Used for creating releases, pushing commits, and GitHub Pages deployment |
Mouser API Key:
- Register at Mouser Electronics
- Navigate to API Hub
- Request API access and obtain your key
DigiKey API Key:
- Register at DigiKey
- Navigate to API Portal
- Create an application and obtain your client ID and secret
- Use the client ID as the secret value
ESP-IDF Component Registry Token:
- Log in to ESP Component Registry
- Navigate to your profile settings
- Generate an API token for component uploads
- The MOUSER_KEY and DIGIKEY_KEY are optional. Without them, the cost analysis step will be skipped
- Cost analysis requires at least one API key to function
- The GITHUB_TOKEN secret has limited permissions. For certain operations, you may need to create a Personal Access Token (PAT) with additional permissions