https://github.com/hoijui/kicad-text-injector
A CLI tool that allows you to post-process your KiCad PCB files, by replacing variables of the type `${NAME}` in your text elements.
https://github.com/hoijui/kicad-text-injector
ci cli fchh interfacer-project-eu interfacer-project-eu-wp4-3 kicad kicad-pcb oseg placeholder-replacement
Last synced: about 2 months ago
JSON representation
A CLI tool that allows you to post-process your KiCad PCB files, by replacing variables of the type `${NAME}` in your text elements.
- Host: GitHub
- URL: https://github.com/hoijui/kicad-text-injector
- Owner: hoijui
- License: gpl-3.0
- Created: 2021-07-26T14:04:31.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2025-01-20T07:38:40.000Z (4 months ago)
- Last Synced: 2025-03-23T18:54:11.652Z (2 months ago)
- Topics: ci, cli, fchh, interfacer-project-eu, interfacer-project-eu-wp4-3, kicad, kicad-pcb, oseg, placeholder-replacement
- Language: Rust
- Homepage:
- Size: 172 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# KiCad text injector
[](
https://www.gnu.org/licenses/gpl-3.0.html)
[](
https://api.reuse.software/info/github.com/hoijui/kicad-text-injector)
[](
https://crates.io/crates/kicad-text-injector)
[](
https://docs.rs/kicad-text-injector)
[](
https://deps.rs/repo/github/hoijui/kicad-text-injector)
[](
https://github.com/hoijui/kicad-text-injector/actions)[](
https://fabcity.hamburg)
[](
https://opensourceecology.de)This tool allows you to post-process your KiCad PCB files,
by replacing variables of the type `${NAME}` in your text elements.You may put placeholder text onto your PCB -
for example `${PROJECT_REPO_URL}` -
on any layer, and this tool then fills in the actual value,
for example `https://github.com/myorg/myproj`.
This is most useful for filling in project-specific meta-data into the final output,
and thus this tool is primarily targeting CI jobs,
though it can also be run locally.## How to compile
You need to install Rust(lang) and Cargo.
Then you can run:
```bash
run/rp/build
```## Get the tool
As for now, you have two choices:
1. [Compile it](#how-to-compile) yourself
1. Download the Linux x86\_64 statically linked binary from
[the releases page](https://github.com/hoijui/kicad-text-injector/releases)## Usage
```text
$ kicad-text-injector --help
Given a KiCad PCB file (*.kicad_pcb) as input, replaces variables of the type `${KEY}` within text
fields with their respective value.USAGE:
kicad-text-injector [FLAGS] [OPTIONS] --input --outputFLAGS:
-e, --env use environment variables for substitution in the text
-f, --fail-on-missing-values fail if no value is available for a variable key found in the
input text
-h, --help Prints help information
-v, --verbose more verbose output (useful for debugging)
-V, --version Prints version informationOPTIONS:
-i, --input the input file to use; '-' for stdin [default: -]
-o, --output the output file to use; '-' for stdout [default: -]
-D, --variable ... a variable key-value pair to be used for substitution in the
text
```## Misc
We very warmly recommend you to use
**the [KiBot](https://github.com/INTI-CMNB/KiBot) tool**
for the actual generation of the final output
from the post-processed KiCad sources.
It can generate much more then just Gerbers
and 2D renders of the PCBs.Also see the [KiCad image/QRCode injector](
https://github.com/hoijui/kicad-image-injector).## Funding
This project was funded by the European Regional Development Fund (ERDF)
in the context of the [INTERFACER Project](https://www.interfacerproject.eu/),
from July 2021
until March 2023.