Documentation of kicad-cli

kicad-cli seems very useful for my purposes. Where can I find a documentation of the commands and options of kicad-cli. Unfortunately --help is not helpful.

as far as I am aware there is no other documentation right now then -h and the short section in the development highlights/7.0 previeww: Development Highlight: December Edition, features coming to KiCad 7 | KiCad EDA

I have since found out that the help from kicad-cli is more comprehensive. However, --help is not used as usual, but will be put after the subcommand or option. I will go in search of examples.

Some good examples can be found at TechOverflow at Du hast nach kicad-cli gesucht - TechOverflow.

Some more examples:

Export all pcb layers into individual files at once

kicad-cli pcb export svg --output "kiri/pcb/layer-00.svg" --layers "F.Cu,Edge.Cuts" board.kicad_pcb

pcb export pdf accept different layer names than displayed in gui

kicad gui        -> kicad-cli
User.Drawings    -> Dwgs.User
User.Comments    -> Cmts.User
User.Eco1        ->  Eco1.User
User.Eco2       ->  Eco2.User

Also you can put there * and the it will export all layers (didn’t check whether it is actually all):

kicad-cli pcb export pdf -o fig/pcb_drawing.pdf ./light_ring_3535x6.kicad_pcb -l "*

If someone uses kicad-cli, his commands could be used here as examples for documentation.

1 Like

Edit, indeed, you found that, and it works recursively into further sub commands.

paul@cezanne:~/projects/kicad/mumar_rack$ kicad-cli -h
Usage: kicad-cli [-h] {fp,pcb,sch,sym,version}

Optional arguments:
  -v, --version	prints version information and exits 
  -h, --help   	shows help message and exits 

Subcommands:
  fp            
  pcb           
  sch           
  sym           
  version       
paul@cezanne:~/projects/kicad/mumar_rack$ kicad-cli pcb -h
Usage: pcb [-h] {export}

Optional arguments:
  -h, --help	shows help message and exits 

Subcommands:
  export     
paul@cezanne:~/projects/kicad/mumar_rack$ kicad-cli pcb export -h
Usage: export [-h] {drill,dxf,gerber,gerbers,pdf,pos,step,svg}

Optional arguments:
  -h, --help	shows help message and exits 

Subcommands:
  drill      
  dxf        
  gerber     
  gerbers    
  pdf        
  pos        Generate Position File
  step       
  svg        
paul@cezanne:~/projects/kicad/mumar_rack$ kicad-cli pcb export svg -h
input: 1 argument(s) expected. 0 provided.
Usage: svg [-h] [--output VAR] [--layers VAR] [--mirror] [--theme VAR] [--negative] [--black-and-white] [--page-size-mode VAR] [--exclude-drawing-sheet] input

Positional arguments:
  input                  	Input file 

Optional arguments:
  -h, --help             	shows help message and exits 
  -o, --output           	Output file name [default: ""]
  -l, --layers           	Comma separated list of untranslated layer names to include such as F.Cu,B.Cu [default: ""]
  -m, --mirror           	Mirror the board (useful for trying to show bottom layers) 
  -t, --theme            	Color theme to use (will default to pcbnew settings) [default: ""]
  -n, --negative         	
  --black-and-white      	Black and white only 
  --page-size-mode       	Set page sizing mode (0 = page with frame and title block, 1 = current page size, 2 = board area only) [default: 0]
  --exclude-drawing-sheet	No drawing sheet 
1 Like

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