Skip to content

Command-line reference

For the usual workflow, run bgi FILE. It produces a complete manual bundle or a visual comparison with complete bundles for every automatic candidate. See Full example for a complete walkthrough. The commands below expose each step separately for scripts and detailed inspection.

FILE means your .bgi.yaml project. bgi FILE defaults to build/<project-id> and refreshes only its own output for that source file. Other output commands require a new directory. bgi --help shows usage and options, and bgi --version reports the installed version.

CommandWhat it doesResult
bgi FILE or bgi run FILESearch and build in one step, with rendered previews.One manual bundle or a README gallery and complete automatic candidate bundles.
bgi design FILE --output DIRECTORYCompare explicitly permitted holder types, sizes and placements from an active storage_search source.README.md, report.json, saved choices and complete candidate bundles.
bgi solve FILE --output DIRECTORYTry automatic compartment layouts that satisfy your inputs.report.md, report.json, and saved candidate-NNN.json files.
bgi build FILE --solution SOLUTION.json --output DIRECTORYGenerate the selected automatic layout or saved tray arrangement.A cutting bundle with parts, previews, and assembly guidance.
bgi storage FILE --solution CHOICE.jsonInspect the directly reconstructed storage choice without searching.A storage report.
bgi storage FILE --solution CHOICE.json --write-recipe RECIPE.jsonCheck and capture the selected storage design in a new recipe file.A separate version-2 storage recipe wrapping the choice.
bgi build FILE --recipe RECIPE.json --output DIRECTORYReconstruct and check a fixed recipe against its original source.A cutting bundle without a new search.
bgi storage FILE --recipe RECIPE.jsonInspect the recipe against its original source.A storage report without a new search.
bgi build FILE --output DIRECTORYGenerate the arrangement already described in a manual project.The same kind of cutting bundle.
bgi explore FILE --output DIRECTORYCompare supported placements of two to four fully designed removable trays in a valid manual project.README.md, report.json, candidate bundles, and saved recipes.
bgi calibrate FILE --output DIRECTORYCreate a small test for measuring cut width and joint fit.Calibration cutting SVG, guide SVG, and measurement notes.

design requires active storage_search; bgi FILE routes that source to the same gallery workflow. Version 1 uses fixed offers; version 2 requires dimensioning.schema_version: 1 and explicit supported dimension bindings. See Storage requirements and search for a complete starter. solve is for ordinary automatic layouts, and is unavailable for active storage-search sources.

solve uses the project’s layout.search.budget and top_k. It saves solutions without building their drawings; use it when you deliberately want only the search result. explore accepts bounded budgets for two to four trays; its candidates already have complete bundles. The automatic layout guide and tray layout guide explain the different inputs and decisions.

storage_search.layout_recipes permits one to three distinct supported recipes. tray-pairs-v1 requires exactly two holders and preserves only ordinary tray constructions; it compares both X/Y orders and both supported stack orders. Specialized holder choices retain their existing rows. See the two-tray starter.

build checks the selected design while generating it. For this explicit command, an automatic or storage-search project needs a saved solution or a compatible fixed recipe. --solution and --recipe are mutually exclusive. --write-recipe belongs only to storage capture without --recipe; its filename must be new and its parent directory must exist. Preserve the original source and relative assets for replay. See saving a storage design. The output guide identifies the cutting files and assembly instructions.

These commands are optional tools for a specific question. Normal searching and building already check their inputs.

Your questionCommandWhat to look for
Did I make an input or assignment error while editing?bgi validate FILEField paths, missing references, and invalid dimensions. It creates no cutting bundle and does not replace a full build.
Why is a compartment larger than I expected?bgi requirements FILECalculated clear-space requirements, split IDs, and size/orientation alternatives. Compare them with your measurements and allowances.
Which storage-search layout policy and dimension selectors are available?bgi config FILE --resolved --jsonThe active nondefault layout policy, resolved material and generated dimension-selector catalog, without a geometry search. Read permitted families in your source.
Which material value is being used?bgi config FILE --resolvedEffective values and whether each came from the profile, project, or CLI.
Which material profiles are available?bgi materials listBundled profile IDs and their initial settings.
Is a copied or received bundle missing files?bgi bundle-check DIRECTORYWhether the files listed in the manifest are present. It does not repeat geometric checks.

For example, use requirements when a deck unexpectedly needs two spaces or a loose-token compartment seems too tall:

Terminal window
bgi requirements game.bgi.yaml

Check the resulting IDs and dimensions against split_counts, measured stack heights, allowed orientations, and handling allowances. Storage requirements and search explains the calculations; diagnostics explains reported failures.

OptionWhen it is useful
build --bom-csvAdd a bom.csv parts list for a spreadsheet or fabrication handoff.
build --render-previewAdd a rendered PNG to an explicit build: F3D with OpenSCAD when both are installed, otherwise the built-in renderer. bgi FILE requests a PNG by default.
build --reuse-preview-from DIRECTORYReuse a compatible rendered preview from an earlier bundle.
design --budget NSet one shared work allowance from 1 to 100000, default 256; rejected and duplicate attempts also count. Budget exhaustion is not a no-fit proof. Also accepted by run for active storage-search sources.
design --top-k NRetain 1 to 10 storage designs, default 6. Also accepted by run for active storage-search sources.
explore --top-k NRetain 1 to 6 tray arrangements. This is separate from the design limit.
explore --anchor-tray IDKeep a tray at its declared X/Y origin. Repeat for more fixed trays; incompatible arrangements are rejected, while layers remain flexible.
explore --budget NLimit checked arrangements. Two trays beside fixed containers default to 256 attempts and allow up to 1024; without containers the pair search defaults to six.
--jsonRequest machine-readable command output for another tool. Available for run, validate, config, requirements, materials, inventory, solve, design, explore, storage, build, and calibrate.

For example, when a cutting service asks for a parts list, add it to your chosen layout’s bundle:

Terminal window
bgi build game.bgi.yaml --solution layouts/candidate-001.json --output fabrication-bundle --bom-csv

Project-reading commands accept --thickness N, --kerf N, --fit-clearance N, and repeatable --set material.PARAMETER=VALUE. Values are millimetres except non-length parameters such as compensation. The project file reference lists the parameters.

A profile provides defaults; project values replace them; command-line values take final precedence for that run. Keep the intended material settings in your YAML so future builds use them. Use a CLI override for a temporary comparison, and config --resolved if you need to confirm which value won. Prepare your material explains when a change needs a new search.

bgi inventory FILE reports curated research facts, selected values, and measurement gaps from an inventory file. It creates no project geometry. This is useful when reconciling published component information before measuring a game; it is not a required step when you already have the box and pieces to measure.