On This Page (8)
kcr project
KiCad project workflows. Use project create to scaffold a new project.
| Command | Aliases | Category | Runtime | Config | Guide |
|---|---|---|---|---|---|
kcr project | — | Projects, Libraries & Assets | Python kcr | Explicit --config <FILE.jsonc> only (no auto-discovery; --emit-config writes project-create.jsonc) | Projects, Variants & Design |
Usage
kcr project [-h] {create} ...Subcommands
| Subcommand | Description |
|---|---|
kcr project create | Scaffold a new KiCad project (.kicad_pro + top-level .kicad_sch, optional embedded worksheet, library tables, and PCB). Use --tui for the interactive form. |
kcr project create
Scaffold a new KiCad project (.kicad_pro + top-level .kicad_sch, optional embedded worksheet, library tables, and PCB). Use --tui for the interactive form.
kcr project create [-h] [--name NAME]
[--size {A4,A3,A2,A1,A0,A,B,C,D,E,USLetter,USLegal,USLedger}]
[--dir DIRECTORY]
[--sheet-name SHEET_NAME]
[--worksheet WORKSHEET]
[--no-embed-worksheet] [--with-pcb]
[--no-lib-tables] [--no-subdir]
[--text-var NAME=VALUE]
[--company COMPANY] [--rev REV]
[--date DATE] [--comment TEXT]
[--symbol-lib NICK=URI]
[--footprint-lib NICK=URI]
[--config FILE.jsonc]
[--emit-config [FILE.jsonc]] [--tui]Options
| Flag | Description |
|---|---|
--name NAME | Project name (also the file stem) |
--size, --page-size SIZE | Schematic page size from KiCad's standard set (default owned by kicad_monkey). Choices: A4, A3, A2, A1, A0, A, B, C, D, E, USLetter, USLegal, USLedger. |
--dir, --directory DIRECTORY | Directory to create the project in (default: current dir) |
--sheet-name SHEET_NAME | Top-level sheet/title name (default: project name) |
--worksheet WORKSHEET | Path to a .wks drawing sheet to embed |
--no-embed-worksheet | Reference the worksheet by path instead of embedding it |
--with-pcb | Also create a blank .kicad_pcb |
--no-lib-tables | Do not create empty sym-lib-table / fp-lib-table |
--no-subdir | Write into --dir directly instead of a <name>/ subfolder |
--text-var NAME=VALUE | Add a project text variable (repeatable) |
--company COMPANY | Schematic title-block company |
--rev, --revision REV | Schematic title-block revision |
--date DATE | Schematic title-block date (e.g. 2026-06-22) |
--comment TEXT | Title-block comment line 1..9 (repeatable) |
--symbol-lib NICK=URI | Add a symbol library to sym-lib-table (repeatable) |
--footprint-lib NICK=URI | Add a footprint library to fp-lib-table (repeatable) |
--config FILE.jsonc | Load all options from a JSONC config file |
--emit-config FILE.jsonc | Write a commented default JSONC config and exit |
--tui | Open the interactive terminal form instead of using flags |
How It Works
kcr project create scaffolds a clean KiCad project (.kicad_pro + top-level .kicad_sch, optional embedded .wks worksheet, optional sym-lib-table/fp-lib-table, and optional blank .kicad_pcb) via three front-ends — CLI flags, a JSONC config file, or an interactive --tui form — all converging on the same KiCadProjectCreateOptions model.
Running kcr project with no subcommand prints help to stderr and exits with code 2.
Config Discovery (project-create.jsonc)
- Explicit
--config <FILE.jsonc>only:kcr project createnever auto-discovers or auto-creates a config file on a normal run. --emit-config [FILE.jsonc]: writes a commented starter template (default./project-create.jsonc) and exits0immediately.
{
"name": "My First Project", // Required non-empty project name & file stem
"directory": ".", // Parent folder (writes to <directory>/<name>/ by default)
"page_size": "D", // A4..A0 | A..E | USLetter | USLegal | USLedger
"sheet_name": "", // Title-block title (defaults to name when empty)
"worksheet": null, // Optional .wks drawing sheet path
"embed_worksheet": true, // true = embed into schematic; false = reference by path
"create_pcb": false, // true = also create a blank .kicad_pcb
"create_lib_tables": true, // Create empty sym-lib-table / fp-lib-table
"create_subdirectory": true, // false = write directly into directory (no <name>/ subfolder)
"revision": "",
"company": "",
"date": "", // e.g. "2026-06-22"
"comments": [], // Up to 9 title-block comment lines
"text_variables": {}, // e.g. { "REV": "A" } -> ${REV} in KiCad
"symbol_libraries": [], // [{"name": "WN", "uri": "${KIPRJMOD}/WN.kicad_sym"}]
"footprint_libraries": [] // [{"name": "WN", "uri": "${KIPRJMOD}/WN.pretty"}]
}Precedence & Conflict Rules
- Front-end precedence ladder (highest wins):
--emit-config [FILE.jsonc]— writes the template and exits0; all creation flags are ignored.--config <FILE.jsonc>— loads every option strictly from the JSONC file and ignores all CLI flags (--name,--size,--with-pcb,--tui, etc.).--tui— opens the Textual interactive form pre-populated from any CLI flags you passed (falling back to plainstdinprompts iftextualis not installed). Cancelling the form exits0without writing files.- Plain CLI flags —
--nameis required (missing--nameexits with code2).
- Strict config validation:
- Unknown keys in
--configfail immediately with exit code1(unknown config keys: ...). - Missing or empty
"name"fails with exit code1.
- Unknown keys in
create_lib_tables: falseexception:- Setting
create_lib_tables: false(or--no-lib-tables) suppresses empty library tables, except when explicitsymbol_libraries/--symbol-liborfootprint_libraries/--footprint-libentries are provided — in that case the corresponding table is always created so the declared libraries are registered.
- Setting
- Repeatable key=value syntax:
--text-varrequiresNAME=VALUE(non-emptyNAME).--symbol-liband--footprint-librequireNICK=URI(both non-empty).
Quick Examples
# Emit a commented starter JSONC config and exit
kcr project create --emit-config project-create.jsonc# Scaffold a new KiCad project from CLI flags
kcr project create --name my_board --dir projects/my_board# Scaffold from a JSONC config (ignores CLI overrides)
kcr project create --config project-create.jsonc