Jobsets: Custom command that runs on outputs of previous jobs

Hi,
I would like to produce an excel version of the BOM using Jobsets.
So I use the built-in “Generate BOM” from the jobset, and I would like to add an additional step to convert this CSV to XLSX.
I’ve found a neat project on Github that does the job: csv2xlsx

I try to add an “Execute Command” job after the generation of the CSV. However, it seems that the CSV file is not present when the Execute command is ran.

I have the feeling that the whole “Destination” group is ran into a temporary folder, and then all this folder is moved to the destination folder (or archived into a ZIP for archive outputs) when everything went well.
Is there a way to access the contents of this temporary folder during execution ?
So that we can build commands that build on top of each other.

My workaround, until a better solution is built into Kicad:
use several “destinations”, each one performs a single task. Each task is configured with paths from the current project so it can run properly.

Generate BOM XLSX is a “Execute command” with the following command:
${COMMON_LIB}/csv2xlsx.exe -t "${COMMON_LIB}/bom template.xlsx" --sf 1 -r 2 -o "BOM/${PROJECTNAME}_BOM.xlsx" "BOM/${PROJECTNAME}_BOM.csv"

Add BOM XLSX to Zip is a “Execute command” with the following command:
powershell -executionpolicy bypass -File ${COMMON_LIB}/addtozip.ps1 -zipPath "${PROJECTNAME}_PCBA.zip" -fileToAdd "BOM/${PROJECTNAME}_BOM.xlsx"

Remove BOM folder is: cmd /C "rmdir /S /Q BOM"

and, I’m not allowed to attach my powershell script “addtozip.ps1” as a new user, but it is a simple script that will add my xlsx file to a previously created zip file already containing fabrication layers PDF + position file.

This is unfortunately not cross-platform… Not so clean but good enough for me today.

1 Like

Yes each job is considered independent and isn’t collated into the final output until completion of all jobs

Hi, I’ve filed a feature request for this, as my workaround is kludgy and took a lot of time to make it work properly.

I am trying this in the 9.0.4 release and not having success. Probably I am doing something silly.

Since I only find how to specify a folder for some jobs, and not give a file name, I want to rename some files. For example, I can’t give the file name for a schematic PDF, only a folder. (If this is possible and I missed it, thanks for the tips.)

Here is how I’ve currently constructed my rename (actually copy, but just as a test/debug):
image

This job occurs in the same generate step as creating the schematic PDF, but I’ve tried different arrangements without success.

I have tried other variations such as:

cmd /C “copy ${JOBSET_OUTPUT_WORK_PATH}${PROJECTNAME}.pdf ${KIPRJMOD}${SCH_PN}_${SCH_REV}_SCH.pdf”

cmd /C “copy ${KIPRJMOD}${PROJECTNAME}.pdf ${KIPRJMOD}${SCH_PN}_${SCH_REV}_SCH.pdf”

cmd /C “copy ${PROJECTNAME}.pdf ${SCH_PN}_${SCH_REV}_SCH.pdf”

But none of those work. Actually, I was able to get the “copy” command to work at some point, but something happened and now I’m not finding success with it. Not sure what I did wrong. And I never found success with the “rename” command, which is what I really want to do. I assume other folks are using the ‘Execute Command’ job to rename files or something very similar, and someone can point out the (surely very silly) mistake I’m making. Much appreciated for help to get a solid solution on this. Thanks!

Application: KiCad x64 on x64

Version: 9.0.4, release build

Libraries:
wxWidgets 3.2.8
FreeType 2.13.3
HarfBuzz 10.2.0
FontConfig 2.15.0
libcurl/8.13.0-DEV Schannel zlib/1.3.1

Platform: Windows 11 (build 26100), 64-bit edition, 64 bit, Little endian, wxMSW

Build Info:
Date: Aug 18 2025 00:41:45
wxWidgets: 3.2.8 (wchar_t,wx containers)
Boost: 1.88.0
OCC: 7.9.1
Curl: 8.13.0-DEV
ngspice: 44
Compiler: Visual C++ 1942 without C++ ABI
KICAD_IPC_API=ON

Locale:
Lang: en_US
Enc: UTF-8
Num: 1,234.5
Encoded кΩ丈: D0BACEA9E4B888 (sys), D0BACEA9E4B888 (utf8)