4.3.2. Command open-project
This command opens a LibrePCB project and lets you execute some tasks with it.
Command
$ ./librepcb-cli open-project --help
Output
Usage: ./librepcb-cli [options] open-project [command_options] projectLibrePCB Command Line InterfaceOptions:-h, --help Displays this help.-v, --version Displays version information.--verbose Verbose output.--erc Run the electrical rule check, print allnon-approved warnings/errors and reportfailure (exit code = 1) if there arenon-approved messages.--export-schematics <file> Export schematics to given file(s).Existing files will be overwritten.Supported file extensions: pdf--export-bom <file> Export generic BOM to given file(s).Existing files will be overwritten.Supported file extensions: csv--export-board-bom <file> Export board-specific BOM to givenfile(s). Existing files will beoverwritten. Supported file extensions: csv--bom-attributes <attributes> Comma-separated list of additionalattributes to be exported to the BOM.Example: "MANUFACTURER, MPN"--export-pcb-fabrication-data Export PCB fabrication data(Gerber/Excellon) according the fabricationoutput settings of boards. Existing fileswill be overwritten.--pcb-fabrication-settings <file> Override PCB fabrication output settingsby providing a *.lp file containing customsettings. If not set, the settings from theboards will be used instead.--board <name> The name of the board(s) to export. Can begiven multiple times. If not set, allboards are exported.--save Save project before closing it (useful toupgrade file format).--strict Fail if the project files are not strictlycanonical, i.e. there would be changes whensaving the project. Note that this optionis not available for *.lppz files.Arguments:open-project Open a project to execute project-relatedtasks.project Path to project file (*.lpp[z]).
Example: Check ERC Messages and Export Schematics & Boards
This command is useful for Continuous Integration of LibrePCB projects because it reports failure if you check in projects with non-approved ERC messages. In addition, it generates all production data so you don’t have to do it manually.
Command
$ ./librepcb-cli open-project \--erc \--export-schematics="output/{{VERSION}}/{{PROJECT}}_Schematics.pdf" \--export-pcb-fabrication-data \MyProject.lpp
Output
Open project 'MyProject.lpp'...Run ERC...Approved messages: 7Non-approved messages: 2- [WARNING] Net signal connected to less than two pins: "CAN_RX"- [WARNING] Net signal connected to less than two pins: "JTCK"Export schematics to 'output/{{VERSION}}/{{PROJECT}}_Schematics.pdf'...=> 'output/v1/MyProject_Schematics.pdf'Export PCB fabrication data...Board 'default':=> 'output/v1/gerber/MyProject_DRILLS-PTH.drl'=> 'output/v1/gerber/MyProject_OUTLINES.gbr'=> 'output/v1/gerber/MyProject_COPPER-TOP.gbr'=> 'output/v1/gerber/MyProject_COPPER-BOTTOM.gbr'=> 'output/v1/gerber/MyProject_SOLDERMASK-TOP.gbr'=> 'output/v1/gerber/MyProject_SOLDERMASK-BOTTOM.gbr'=> 'output/v1/gerber/MyProject_SILKSCREEN-TOP.gbr'=> 'output/v1/gerber/MyProject_SILKSCREEN-BOTTOM.gbr'Finished with errors!
In this example, the application reported errors and exited with code 1 because there are non-approved ERC messages.