How I export KiCAD pick&place CSVs using kicad-cli

Since KiCAD 7.0, you can use the kicad-cli command line tool to export a pick & place position CSV file from a KiCAD project. You can also export an ASCII format, depending on what software you’ll use to process the data.

My standard export command uses the drill origin as a pick&place origin since you can place it anywhere you like:

kicad-cli pcb export pos MyPCB.kicad_pcb --format csv --use-drill-file-origin --units mm -o MyPCB.positions.csv