Kicad CLI : Exporting BOM does not work with ${QUANTITY}

I am using the following command to export a BOM from a schematic:

 kicad-cli  sch export bom \ 
  --fields "Reference,Value,${QUANTITY}" \
  --exclude-dnp --group-by "Value" test.sch

However, the ${QUANTITY} field does nothing. The output csv does not have the Quantity column.
Reference: | | | Documentation | KiCad

How do I get Quantity in the CSV.
Thanks.

Application: KiCad PCB Editor x86_64 on x86_64

Version: 8.0.0-8.0.0-1~ubuntu22.04.1, release build

Libraries:
wxWidgets 3.2.1
FreeType 2.11.1
HarfBuzz 2.7.4
FontConfig 2.13.1
libcurl/7.81.0 OpenSSL/3.0.2 zlib/1.2.11 brotli/1.0.9 zstd/1.4.8 libidn2/2.3.2 libpsl/0.21.0 (+libidn2/2.3.2) libssh/0.9.6/openssl/zlib nghttp2/1.43.0 librtmp/2.3 OpenLDAP/2.5.16

Platform: Ubuntu 22.04.4 LTS, 64 bit, Little endian, wxGTK, X11, xubuntu, x11

Build Info:
Date: Feb 23 2024 14:30:25
wxWidgets: 3.2.1 (wchar_t,wx containers) GTK+ 3.24
Boost: 1.74.0
OCC: 7.6.3
Curl: 7.81.0
ngspice: 42
Compiler: GCC 11.4.0 with C++ ABI 1016

Build settings:

EDIT1: Explicitly specifying the default does not work either, like this:

kicad-cli  sch export bom --fields "Reference,Value,Footprint,${QUANTITY},${DNP}" --exclude-dnp --group-by "Value" test.sch

EDIT2: Removing the --fields field makes the default (incl quantity) work.

kicad-cli  sch export bom --exclude-dnp --group-by "Value" vet-tx.kicad_sch && head vet-tx.csv

When you quote a command line argument with " (double quote) the shell will expand expressions of the form $VAR or ${VAR}. Use ’ (single quote) or escape the $.

Thank you so much.
That was obvious once you pointed it out :slight_smile:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.