kicad
`kicad-cli` from the official kicad/kicad image, so a hardware project'sdesign-rule checks and fabrication outputs become `dagger call`s instead of
the usual pile of shell scripts and Makefile recipes.
Everything kicad-cli does is headless — no Xvfb, no display, including
renders — so the image runs unmodified. It runs as `USER kicad` (UID 1000)
with no entrypoint, which is why every output is written under /tmp rather
than into the mounted (root-owned) project.
The boundary input is a *dagger.Directory, not a lone *dagger.File:
kicad-cli resolves sub-sheets, footprint libraries and drawing sheets
relative to the project. Project hoists the options that apply to nearly
every subcommand (--define-var, --variant, --drawing-sheet) into chained
modifiers rather than repeating them across a dozen signatures.
Installation
dagger install github.com/z5labs/devex/daggerverse/kicad@a17bf411228ae3d544c7c18bcf08dd04c295d453Entrypoint
Return Type
Kicad !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| registry | String ! | "docker.io" | Container registry hosting the kicad/kicad image. |
| tag | String ! | "10.0" | Image tag for kicad/kicad. |
Example
dagger -m github.com/z5labs/devex/daggerverse/kicad@a17bf411228ae3d544c7c18bcf08dd04c295d453 call \
--registry string --tag stringfunc (m *MyModule) Example(registry string, tag string) *dagger.Kicad {
return dag.
Kicad(registry, tag)
}@function
def example(registry: str, tag: str) -> dagger.Kicad:
return (
dag.kicad(registry, tag)
)@func()
example(registry: string, tag: string): Kicad {
return dag
.kicad(registry, tag)
}Types
Kicad 🔗
Kicad wraps kicad-cli as Dagger functions. Construct via New(); call Container() for the raw image, or Project(source) to reach the typed pcb/sch helpers.
ci() 🔗
Ci returns a new pipeline builder bound to the supplied project source. The board and schematic are auto-discovered per stage, exactly as a bare Project(source).Pcb()/Sch() call would.
Return Type
Ci !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | No description provided |
Example
dagger -m github.com/z5labs/devex/daggerverse/kicad@a17bf411228ae3d544c7c18bcf08dd04c295d453 call \
--registry string --tag string ci --source DIR_PATHfunc (m *MyModule) Example(registry string, tag string, source *dagger.Directory) *dagger.KicadCi {
return dag.
Kicad(registry, tag).
Ci(source)
}@function
def example(registry: str, tag: str, source: dagger.Directory) -> dagger.KicadCi:
return (
dag.kicad(registry, tag)
.ci(source)
)@func()
example(registry: string, tag: string, source: Directory): KicadCi {
return dag
.kicad(registry, tag)
.ci(source)
}container() 🔗
Container returns the bare kicad image. This is the escape hatch for every
subcommand this module does not wrap — kicad-cli’s long tail of exotic and
legacy exports stays reachable via container with-exec.
Return Type
Container ! Example
dagger -m github.com/z5labs/devex/daggerverse/kicad@a17bf411228ae3d544c7c18bcf08dd04c295d453 call \
--registry string --tag string containerfunc (m *MyModule) Example(registry string, tag string) *dagger.Container {
return dag.
Kicad(registry, tag).
Container()
}@function
def example(registry: str, tag: str) -> dagger.Container:
return (
dag.kicad(registry, tag)
.container()
)@func()
example(registry: string, tag: string): Container {
return dag
.kicad(registry, tag)
.container()
}project() 🔗
Project binds a KiCad project directory to the toolchain. source is the whole project tree, not a single file, because kicad-cli resolves sub-sheets, footprint libraries and drawing sheets relative to it.
Return Type
Project !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | No description provided |
Example
dagger -m github.com/z5labs/devex/daggerverse/kicad@a17bf411228ae3d544c7c18bcf08dd04c295d453 call \
--registry string --tag string project --source DIR_PATHfunc (m *MyModule) Example(registry string, tag string, source *dagger.Directory) *dagger.KicadProject {
return dag.
Kicad(registry, tag).
Project(source)
}@function
def example(registry: str, tag: str, source: dagger.Directory) -> dagger.KicadProject:
return (
dag.kicad(registry, tag)
.project(source)
)@func()
example(registry: string, tag: string, source: Directory): KicadProject {
return dag
.kicad(registry, tag)
.project(source)
}version() 🔗
Version returns the KiCad release the pinned image ships, as reported by
kicad-cli version.
Return Type
String ! Example
dagger -m github.com/z5labs/devex/daggerverse/kicad@a17bf411228ae3d544c7c18bcf08dd04c295d453 call \
--registry string --tag string versionfunc (m *MyModule) Example(ctx context.Context, registry string, tag string) string {
return dag.
Kicad(registry, tag).
Version(ctx)
}@function
async def example(registry: str, tag: str) -> str:
return await (
dag.kicad(registry, tag)
.version()
)@func()
async example(registry: string, tag: string): Promise<string> {
return dag
.kicad(registry, tag)
.version()
}Ci 🔗
Ci is a chained builder for a standardized KiCad CI pipeline. Construct via Kicad.Ci(source); enable check stages and output sets via the With* methods; call Run to execute checks-then-outputs, or Check to run only the parallel checks.
Stage 1 runs the enabled design-rule checks in parallel (Erc, Drc); errors are aggregated. Stage 2 produces the enabled outputs as a single directory and Run returns it. Downstream consumers compose that directory into their own pipelines (archive, upload to a fab house, attach to a release, …).
It composes the Project/Pcb/Sch primitives without adding capability of its
own: every stage is a call the caller could make by hand, bundled into one
declarative pipeline so a hardware repo’s CI is a single dagger call.
check() 🔗
Check runs the enabled check stages (Erc, Drc) in parallel via github.com/dagger/dagger/util/parallel and returns the aggregated error. Use when callers want to run the checks independently of the outputs (for example a PR gate that never needs the fabrication package).
Return Type
Void ! Example
dagger -m github.com/z5labs/devex/daggerverse/kicad@a17bf411228ae3d544c7c18bcf08dd04c295d453 call \
ci --source DIR_PATH \
checkfunc (m *MyModule) Example(ctx context.Context, source *dagger.Directory) {
return dag.
Kicad().
Ci(source).
Check(ctx)
}@function
async def example(source: dagger.Directory) -> None:
return await (
dag.kicad()
.ci(source)
.check()
)@func()
async example(source: Directory): Promise<void> {
return dag
.kicad()
.ci(source)
.check()
}run() 🔗
Run executes the pipeline: stage 1 (Check) → stage 2 (outputs). Returns the enabled outputs merged into one directory. On stage-1 failure, returns the aggregated error from Check and a nil directory (stage 2 is skipped), so a failing check short-circuits before any export work.
Return Type
Directory ! Example
dagger -m github.com/z5labs/devex/daggerverse/kicad@a17bf411228ae3d544c7c18bcf08dd04c295d453 call \
ci --source DIR_PATH \
runfunc (m *MyModule) Example(source *dagger.Directory) *dagger.Directory {
return dag.
Kicad().
Ci(source).
Run()
}@function
def example(source: dagger.Directory) -> dagger.Directory:
return (
dag.kicad()
.ci(source)
.run()
)@func()
example(source: Directory): Directory {
return dag
.kicad()
.ci(source)
.run()
}withDrc() 🔗
WithDrc enables the Design Rule Check stage (Pcb.Drc at severity error). Pass schematicParity to also check the board against the schematic (footprints, nets, values) — a class of defect plain DRC never looks for.
Return Type
Ci !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| schematicParity | Boolean ! | false | No description provided |
Example
dagger -m github.com/z5labs/devex/daggerverse/kicad@a17bf411228ae3d544c7c18bcf08dd04c295d453 call \
ci --source DIR_PATH \
with-drc --schematic-parity booleanfunc (m *MyModule) Example(source *dagger.Directory, schematicParity bool) *dagger.KicadCi {
return dag.
Kicad().
Ci(source).
Withdrc(schematicParity)
}@function
def example(source: dagger.Directory, schematicparity: bool) -> dagger.KicadCi:
return (
dag.kicad()
.ci(source)
.withdrc(schematicparity)
)@func()
example(source: Directory, schematicParity: boolean): KicadCi {
return dag
.kicad()
.ci(source)
.withDrc(schematicParity)
}withErc() 🔗
WithErc enables the Electrical Rule Check stage (Sch.Erc at severity error).
Return Type
Ci ! Example
dagger -m github.com/z5labs/devex/daggerverse/kicad@a17bf411228ae3d544c7c18bcf08dd04c295d453 call \
ci --source DIR_PATH \
with-ercfunc (m *MyModule) Example(source *dagger.Directory) *dagger.KicadCi {
return dag.
Kicad().
Ci(source).
Witherc()
}@function
def example(source: dagger.Directory) -> dagger.KicadCi:
return (
dag.kicad()
.ci(source)
.witherc()
)@func()
example(source: Directory): KicadCi {
return dag
.kicad()
.ci(source)
.withErc()
}withFabricationOutputs() 🔗
WithFabricationOutputs enables the fabrication package: Gerbers, drill files, the pick-and-place position file and the BOM. Run merges them into one directory (gerbers/ and drill/ subdirectories, pos.pos and bom.csv at root).
Return Type
Ci ! Example
dagger -m github.com/z5labs/devex/daggerverse/kicad@a17bf411228ae3d544c7c18bcf08dd04c295d453 call \
ci --source DIR_PATH \
with-fabrication-outputsfunc (m *MyModule) Example(source *dagger.Directory) *dagger.KicadCi {
return dag.
Kicad().
Ci(source).
Withfabricationoutputs()
}@function
def example(source: dagger.Directory) -> dagger.KicadCi:
return (
dag.kicad()
.ci(source)
.withfabricationoutputs()
)@func()
example(source: Directory): KicadCi {
return dag
.kicad()
.ci(source)
.withFabricationOutputs()
}Project 🔗
Project is a KiCad project tree plus the options that apply to nearly every kicad-cli subcommand. It is immutable: every With* returns a copy.
jobset() 🔗
Jobset runs a .kicad_jobset file and returns the project directory with everything the jobset produced, so a project that already declares its output set in-repo can generate the whole fabrication package in one call.
The jobset’s outputs are written relative to the project, which is why the whole tree comes back rather than a lone output folder: the jobset — not this module — decides where its artifacts land.
Return Type
Directory !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| path | String ! | - | No description provided |
Example
dagger -m github.com/z5labs/devex/daggerverse/kicad@a17bf411228ae3d544c7c18bcf08dd04c295d453 call \
project --source DIR_PATH \
jobset --path stringfunc (m *MyModule) Example(source *dagger.Directory, path string) *dagger.Directory {
return dag.
Kicad().
Project(source).
Jobset(path)
}@function
def example(source: dagger.Directory, path: str) -> dagger.Directory:
return (
dag.kicad()
.project(source)
.jobset(path)
)@func()
example(source: Directory, path: string): Directory {
return dag
.kicad()
.project(source)
.jobset(path)
}pcb() 🔗
Pcb selects a board within the project. An empty path auto-discovers the single *.kicad_pcb in the tree and errors when there are zero or more than one; discovery is deferred to the exec so the error surfaces on the call that needed the board.
Return Type
Pcb !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| path | String ! | "" | Project-relative path to the .kicad_pcb; empty auto-discovers. |
Example
dagger -m github.com/z5labs/devex/daggerverse/kicad@a17bf411228ae3d544c7c18bcf08dd04c295d453 call \
project --source DIR_PATH \
pcb --path stringfunc (m *MyModule) Example(source *dagger.Directory, path string) *dagger.KicadPcb {
return dag.
Kicad().
Project(source).
Pcb(path)
}@function
def example(source: dagger.Directory, path: str) -> dagger.KicadPcb:
return (
dag.kicad()
.project(source)
.pcb(path)
)@func()
example(source: Directory, path: string): KicadPcb {
return dag
.kicad()
.project(source)
.pcb(path)
}sch() 🔗
Sch selects a schematic within the project. An empty path auto-discovers the single *.kicad_sch in the tree, ignoring the sub-sheets of a hierarchical design, and errors when there are zero or more than one root.
Return Type
Sch !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| path | String ! | "" | Project-relative path to the .kicad_sch; empty auto-discovers. |
Example
dagger -m github.com/z5labs/devex/daggerverse/kicad@a17bf411228ae3d544c7c18bcf08dd04c295d453 call \
project --source DIR_PATH \
sch --path stringfunc (m *MyModule) Example(source *dagger.Directory, path string) *dagger.KicadSch {
return dag.
Kicad().
Project(source).
Sch(path)
}@function
def example(source: dagger.Directory, path: str) -> dagger.KicadSch:
return (
dag.kicad()
.project(source)
.sch(path)
)@func()
example(source: Directory, path: string): KicadSch {
return dag
.kicad()
.project(source)
.sch(path)
}withDrawingSheet() 🔗
WithDrawingSheet overrides the project’s drawing sheet with the supplied
.kicad_wks file (--drawing-sheet). It applies to the plotting exports;
subcommands that do not accept the flag ignore it.
Return Type
Project !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| sheet | File ! | - | No description provided |
Example
dagger -m github.com/z5labs/devex/daggerverse/kicad@a17bf411228ae3d544c7c18bcf08dd04c295d453 call \
project --source DIR_PATH \
with-drawing-sheet --sheet file:pathfunc (m *MyModule) Example(source *dagger.Directory, sheet *dagger.File) *dagger.KicadProject {
return dag.
Kicad().
Project(source).
Withdrawingsheet(sheet)
}@function
def example(source: dagger.Directory, sheet: dagger.File) -> dagger.KicadProject:
return (
dag.kicad()
.project(source)
.withdrawingsheet(sheet)
)@func()
example(source: Directory, sheet: File): KicadProject {
return dag
.kicad()
.project(source)
.withDrawingSheet(sheet)
}withVar() 🔗
WithVar sets a KiCad text variable, overriding or adding to the ones the
project file declares (kicad-cli’s --define-var name=value).
It takes a name and a value rather than a map because Dagger functions cannot accept map parameters. Validation is deferred to the exec: builder methods have no error return, so a bad name surfaces when the export or check that would have used it runs.
Return Type
Project !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| name | String ! | - | No description provided |
| value | String ! | - | No description provided |
Example
dagger -m github.com/z5labs/devex/daggerverse/kicad@a17bf411228ae3d544c7c18bcf08dd04c295d453 call \
project --source DIR_PATH \
with-var --name string --value stringfunc (m *MyModule) Example(source *dagger.Directory, name string, value string) *dagger.KicadProject {
return dag.
Kicad().
Project(source).
Withvar(name, value)
}@function
def example(source: dagger.Directory, name: str, value: str) -> dagger.KicadProject:
return (
dag.kicad()
.project(source)
.withvar(name, value)
)@func()
example(source: Directory, name: string, value: string): KicadProject {
return dag
.kicad()
.project(source)
.withVar(name, value)
}withVariant() 🔗
WithVariant selects a KiCad assembly variant (--variant). It applies to
the exports that support variants; checks (drc, erc) and drill files ignore
it because kicad-cli does not accept the flag there.
Return Type
Project !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| variant | String ! | - | No description provided |
Example
dagger -m github.com/z5labs/devex/daggerverse/kicad@a17bf411228ae3d544c7c18bcf08dd04c295d453 call \
project --source DIR_PATH \
with-variant --variant stringfunc (m *MyModule) Example(source *dagger.Directory, variant string) *dagger.KicadProject {
return dag.
Kicad().
Project(source).
Withvariant(variant)
}@function
def example(source: dagger.Directory, variant: str) -> dagger.KicadProject:
return (
dag.kicad()
.project(source)
.withvariant(variant)
)@func()
example(source: Directory, variant: string): KicadProject {
return dag
.kicad()
.project(source)
.withVariant(variant)
}Pcb 🔗
Pcb is a board selected within a Project. Every method here execs kicad-cli, so each carries a session cache directive; selecting the board itself is pure config and carries none.
drc() 🔗
Drc runs the Design Rule Check and returns a non-nil error listing the violations when the board fails, nil when it is clean.
It returns a bare error rather than (report, error) because Dagger drops a
function’s value whenever it also returns a non-nil error: a
report-returning signature would leave the violation list unreachable on
exactly the failure path that needs it. --exit-code-violations exits 5 on
violations, which Expect=ReturnTypeAny keeps on the value path so the
report can be read back and folded into the message.
Return Type
Void !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| severity | String ! | "error" | Violation levels to report: all, error, warning or exclusions. |
| schematicParity | Boolean ! | false | Also check the board against the schematic (footprints, nets, values). |
| refillZones | Boolean ! | false | Refill copper zones before checking. |
Example
dagger -m github.com/z5labs/devex/daggerverse/kicad@a17bf411228ae3d544c7c18bcf08dd04c295d453 call \
project --source DIR_PATH \
pcb --path string \
drc --severity string --schematic-parity boolean --refill-zones booleanfunc (m *MyModule) Example(ctx context.Context, source *dagger.Directory, path string, severity string, schematicParity bool, refillZones bool) {
return dag.
Kicad().
Project(source).
Pcb(path).
Drc(ctx, severity, schematicParity, refillZones)
}@function
async def example(source: dagger.Directory, path: str, severity: str, schematicparity: bool, refillzones: bool) -> None:
return await (
dag.kicad()
.project(source)
.pcb(path)
.drc(severity, schematicparity, refillzones)
)@func()
async example(source: Directory, path: string, severity: string, schematicParity: boolean, refillZones: boolean): Promise<void> {
return dag
.kicad()
.project(source)
.pcb(path)
.drc(severity, schematicParity, refillZones)
}drill() 🔗
Drill generates the board’s drill files and returns them as a directory.
Return Type
Directory !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| format | String ! | "excellon" | Drill file format: excellon or gerber. |
| units | String ! | "mm" | Excellon output units: mm or in. |
| origin | String ! | "absolute" | Drill origin: absolute or plot. |
| separatePlatedHoles | Boolean ! | false | Emit independent files for plated and non-plated holes. |
| generateMap | Boolean ! | false | Also emit a drill map. |
Example
dagger -m github.com/z5labs/devex/daggerverse/kicad@a17bf411228ae3d544c7c18bcf08dd04c295d453 call \
project --source DIR_PATH \
pcb --path string \
drill --format string --units string --origin string --separate-plated-holes boolean --generate-map booleanfunc (m *MyModule) Example(source *dagger.Directory, path string, format string, units string, origin string, separatePlatedHoles bool, generateMap bool) *dagger.Directory {
return dag.
Kicad().
Project(source).
Pcb(path).
Drill(format, units, origin, separatePlatedHoles, generateMap)
}@function
def example(source: dagger.Directory, path: str, format: str, units: str, origin: str, separateplatedholes: bool, generatemap: bool) -> dagger.Directory:
return (
dag.kicad()
.project(source)
.pcb(path)
.drill(format, units, origin, separateplatedholes, generatemap)
)@func()
example(source: Directory, path: string, format: string, units: string, origin: string, separatePlatedHoles: boolean, generateMap: boolean): Directory {
return dag
.kicad()
.project(source)
.pcb(path)
.drill(format, units, origin, separatePlatedHoles, generateMap)
}gerbers() 🔗
Gerbers plots the board’s Gerber files and returns them as a directory. An empty layers list plots every layer the board defines, plus the .gbrjob file that ties them together.
Return Type
Directory !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| layers | [String ! ] | - | Untranslated layer names to plot, e.g. F.Cu, B.Cu. Empty plots all. |
| precision | Integer ! | 6 | Gerber coordinate precision: 5 or 6. |
| checkZones | Boolean ! | false | Check and refill zones before plotting. |
Example
dagger -m github.com/z5labs/devex/daggerverse/kicad@a17bf411228ae3d544c7c18bcf08dd04c295d453 call \
project --source DIR_PATH \
pcb --path string \
gerbers --precision integer --check-zones booleanfunc (m *MyModule) Example(source *dagger.Directory, path string, precision int, checkZones bool) *dagger.Directory {
return dag.
Kicad().
Project(source).
Pcb(path).
Gerbers(precision, checkZones)
}@function
def example(source: dagger.Directory, path: str, precision: int, checkzones: bool) -> dagger.Directory:
return (
dag.kicad()
.project(source)
.pcb(path)
.gerbers(precision, checkzones)
)@func()
example(source: Directory, path: string, precision: number, checkZones: boolean): Directory {
return dag
.kicad()
.project(source)
.pcb(path)
.gerbers(precision, checkZones)
}ipc2581() 🔗
Ipc2581 exports the board in IPC-2581 format — a single XML file carrying the fabrication and assembly data that would otherwise be spread across Gerbers, drill files and a BOM.
Return Type
File !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| version | String ! | "C" | IPC-2581 standard revision: B or C. |
| units | String ! | "mm" | Units: mm or in. |
| outputName | String ! | "board.xml" | No description provided |
Example
dagger -m github.com/z5labs/devex/daggerverse/kicad@a17bf411228ae3d544c7c18bcf08dd04c295d453 call \
project --source DIR_PATH \
pcb --path string \
ipc-2-5-8-1 --version string --units string --output-name stringfunc (m *MyModule) Example(source *dagger.Directory, path string, version string, units string, outputName string) *dagger.File {
return dag.
Kicad().
Project(source).
Pcb(path).
Ipc2581(version, units, outputName)
}@function
def example(source: dagger.Directory, path: str, version: str, units: str, outputname: str) -> dagger.File:
return (
dag.kicad()
.project(source)
.pcb(path)
.ipc2581(version, units, outputname)
)@func()
example(source: Directory, path: string, version: string, units: string, outputName: string): File {
return dag
.kicad()
.project(source)
.pcb(path)
.ipc2581(version, units, outputName)
}pdf() 🔗
Pdf plots the given layers into a single PDF.
Pdf and PdfPerLayer are split into file- and directory-returning functions
rather than one function taking a mode flag: a Dagger function has exactly
one return type, so modelling --mode-single vs --mode-separate as a
parameter would force *Directory onto the common single-file case.
Return Type
File !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| layers | [String ! ] ! | - | Untranslated layer names to plot, e.g. F.Cu, Edge.Cuts. |
| outputName | String ! | "board.pdf" | No description provided |
Example
dagger -m github.com/z5labs/devex/daggerverse/kicad@a17bf411228ae3d544c7c18bcf08dd04c295d453 call \
project --source DIR_PATH \
pcb --path string \
pdf --layers string1 --layers string2 --output-name stringfunc (m *MyModule) Example(source *dagger.Directory, path string, layers []string, outputName string) *dagger.File {
return dag.
Kicad().
Project(source).
Pcb(path).
Pdf(layers, outputName)
}@function
def example(source: dagger.Directory, path: str, layers: List[str], outputname: str) -> dagger.File:
return (
dag.kicad()
.project(source)
.pcb(path)
.pdf(layers, outputname)
)@func()
example(source: Directory, path: string, layers: string[], outputName: string): File {
return dag
.kicad()
.project(source)
.pcb(path)
.pdf(layers, outputName)
}pdfPerLayer() 🔗
PdfPerLayer plots each layer into its own PDF and returns the directory.
Return Type
Directory !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| layers | [String ! ] ! | - | Untranslated layer names to plot, one PDF each. |
Example
dagger -m github.com/z5labs/devex/daggerverse/kicad@a17bf411228ae3d544c7c18bcf08dd04c295d453 call \
project --source DIR_PATH \
pcb --path string \
pdf-per-layer --layers string1 --layers string2func (m *MyModule) Example(source *dagger.Directory, path string, layers []string) *dagger.Directory {
return dag.
Kicad().
Project(source).
Pcb(path).
Pdfperlayer(layers)
}@function
def example(source: dagger.Directory, path: str, layers: List[str]) -> dagger.Directory:
return (
dag.kicad()
.project(source)
.pcb(path)
.pdfperlayer(layers)
)@func()
example(source: Directory, path: string, layers: string[]): Directory {
return dag
.kicad()
.project(source)
.pcb(path)
.pdfPerLayer(layers)
}pos() 🔗
Pos generates the component position (pick-and-place) file.
Return Type
File !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| side | String ! | "both" | Board side to include: front, back or both. |
| format | String ! | "ascii" | Output format: ascii, csv or gerber. |
| units | String ! | "in" | Output units for the ascii and csv formats: in or mm. |
| smdOnly | Boolean ! | false | Include only SMD footprints. |
| outputName | String ! | "pos.pos" | Name of the produced file. Named outputName, not output, because -o collides with the Dagger CLI’s own top-level flag. |
Example
dagger -m github.com/z5labs/devex/daggerverse/kicad@a17bf411228ae3d544c7c18bcf08dd04c295d453 call \
project --source DIR_PATH \
pcb --path string \
pos --side string --format string --units string --smd-only boolean --output-name stringfunc (m *MyModule) Example(source *dagger.Directory, path string, side string, format string, units string, smdOnly bool, outputName string) *dagger.File {
return dag.
Kicad().
Project(source).
Pcb(path).
Pos(side, format, units, smdOnly, outputName)
}@function
def example(source: dagger.Directory, path: str, side: str, format: str, units: str, smdonly: bool, outputname: str) -> dagger.File:
return (
dag.kicad()
.project(source)
.pcb(path)
.pos(side, format, units, smdonly, outputname)
)@func()
example(source: Directory, path: string, side: string, format: string, units: string, smdOnly: boolean, outputName: string): File {
return dag
.kicad()
.project(source)
.pcb(path)
.pos(side, format, units, smdOnly, outputName)
}step() 🔗
Step exports the board as a STEP model. The default 10.0 image is the
slim variant, which ships no 3D component models — pass boardOnly to make
that explicit, or use the -full image tag for populated assemblies.
Return Type
File !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| boardOnly | Boolean ! | false | Export the bare board, with no component models. |
| excludeDnp | Boolean ! | false | Exclude models for components flagged Do Not Populate. |
| outputName | String ! | "board.step" | No description provided |
Example
dagger -m github.com/z5labs/devex/daggerverse/kicad@a17bf411228ae3d544c7c18bcf08dd04c295d453 call \
project --source DIR_PATH \
pcb --path string \
step --board-only boolean --exclude-dnp boolean --output-name stringfunc (m *MyModule) Example(source *dagger.Directory, path string, boardOnly bool, excludeDnp bool, outputName string) *dagger.File {
return dag.
Kicad().
Project(source).
Pcb(path).
Step(boardOnly, excludeDnp, outputName)
}@function
def example(source: dagger.Directory, path: str, boardonly: bool, excludednp: bool, outputname: str) -> dagger.File:
return (
dag.kicad()
.project(source)
.pcb(path)
.step(boardonly, excludednp, outputname)
)@func()
example(source: Directory, path: string, boardOnly: boolean, excludeDnp: boolean, outputName: string): File {
return dag
.kicad()
.project(source)
.pcb(path)
.step(boardOnly, excludeDnp, outputName)
}svg() 🔗
Svg plots the given layers into a single SVG.
Return Type
File !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| layers | [String ! ] ! | - | Untranslated layer names to plot, e.g. F.Cu, Edge.Cuts. |
| outputName | String ! | "board.svg" | No description provided |
Example
dagger -m github.com/z5labs/devex/daggerverse/kicad@a17bf411228ae3d544c7c18bcf08dd04c295d453 call \
project --source DIR_PATH \
pcb --path string \
svg --layers string1 --layers string2 --output-name stringfunc (m *MyModule) Example(source *dagger.Directory, path string, layers []string, outputName string) *dagger.File {
return dag.
Kicad().
Project(source).
Pcb(path).
Svg(layers, outputName)
}@function
def example(source: dagger.Directory, path: str, layers: List[str], outputname: str) -> dagger.File:
return (
dag.kicad()
.project(source)
.pcb(path)
.svg(layers, outputname)
)@func()
example(source: Directory, path: string, layers: string[], outputName: string): File {
return dag
.kicad()
.project(source)
.pcb(path)
.svg(layers, outputName)
}svgPerLayer() 🔗
SvgPerLayer plots each layer into its own SVG and returns the directory.
Return Type
Directory !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| layers | [String ! ] ! | - | Untranslated layer names to plot, one SVG each. |
Example
dagger -m github.com/z5labs/devex/daggerverse/kicad@a17bf411228ae3d544c7c18bcf08dd04c295d453 call \
project --source DIR_PATH \
pcb --path string \
svg-per-layer --layers string1 --layers string2func (m *MyModule) Example(source *dagger.Directory, path string, layers []string) *dagger.Directory {
return dag.
Kicad().
Project(source).
Pcb(path).
Svgperlayer(layers)
}@function
def example(source: dagger.Directory, path: str, layers: List[str]) -> dagger.Directory:
return (
dag.kicad()
.project(source)
.pcb(path)
.svgperlayer(layers)
)@func()
example(source: Directory, path: string, layers: string[]): Directory {
return dag
.kicad()
.project(source)
.pcb(path)
.svgPerLayer(layers)
}Sch 🔗
Sch is a schematic selected within a Project.
bom() 🔗
Bom exports the Bill of Materials as CSV. The header row is the field list verbatim, because fields is always passed through to kicad-cli — the column labels follow whatever the caller asked to export.
Return Type
File !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| fields | String ! | "Reference,Value,Footprint,QUANTITY,DNP" | Ordered list of fields to export. Generated fields such as QUANTITY, ITEM_NUMBER and DNP may be used alongside symbol fields. |
| groupBy | String | - | Fields to group references by when their values match. |
| sortField | String ! | "Reference" | Field name to sort by. |
| excludeDnp | Boolean ! | false | Exclude symbols marked Do Not Populate. |
| outputName | String ! | "bom.csv" | No description provided |
Example
dagger -m github.com/z5labs/devex/daggerverse/kicad@a17bf411228ae3d544c7c18bcf08dd04c295d453 call \
project --source DIR_PATH \
sch --path string \
bom --fields string --sort-field string --exclude-dnp boolean --output-name stringfunc (m *MyModule) Example(source *dagger.Directory, path string, fields string, sortField string, excludeDnp bool, outputName string) *dagger.File {
return dag.
Kicad().
Project(source).
Sch(path).
Bom(fields, sortField, excludeDnp, outputName)
}@function
def example(source: dagger.Directory, path: str, fields: str, sortfield: str, excludednp: bool, outputname: str) -> dagger.File:
return (
dag.kicad()
.project(source)
.sch(path)
.bom(fields, sortfield, excludednp, outputname)
)@func()
example(source: Directory, path: string, fields: string, sortField: string, excludeDnp: boolean, outputName: string): File {
return dag
.kicad()
.project(source)
.sch(path)
.bom(fields, sortField, excludeDnp, outputName)
}erc() 🔗
Erc runs the Electrical Rule Check and returns a non-nil error listing the violations when the schematic fails, nil when it is clean.
Like Pcb.Drc it returns a bare error: Dagger drops a function’s value when
it also returns a non-nil error, so a (report, error) signature would hide
the violation list on the failure path. --exit-code-violations exits 5,
which Expect=ReturnTypeAny keeps on the value path.
Return Type
Void !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| severity | String ! | "error" | Violation levels to report: all, error, warning or exclusions. |
Example
dagger -m github.com/z5labs/devex/daggerverse/kicad@a17bf411228ae3d544c7c18bcf08dd04c295d453 call \
project --source DIR_PATH \
sch --path string \
erc --severity stringfunc (m *MyModule) Example(ctx context.Context, source *dagger.Directory, path string, severity string) {
return dag.
Kicad().
Project(source).
Sch(path).
Erc(ctx, severity)
}@function
async def example(source: dagger.Directory, path: str, severity: str) -> None:
return await (
dag.kicad()
.project(source)
.sch(path)
.erc(severity)
)@func()
async example(source: Directory, path: string, severity: string): Promise<void> {
return dag
.kicad()
.project(source)
.sch(path)
.erc(severity)
}netlist() 🔗
Netlist exports the schematic’s netlist.
Return Type
File !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| format | String ! | "kicadsexpr" | Netlist format: kicadsexpr, kicadxml, cadstar, orcadpcb2, spice, spicemodel, pads or allegro. |
| outputName | String ! | "netlist.net" | No description provided |
Example
dagger -m github.com/z5labs/devex/daggerverse/kicad@a17bf411228ae3d544c7c18bcf08dd04c295d453 call \
project --source DIR_PATH \
sch --path string \
netlist --format string --output-name stringfunc (m *MyModule) Example(source *dagger.Directory, path string, format string, outputName string) *dagger.File {
return dag.
Kicad().
Project(source).
Sch(path).
Netlist(format, outputName)
}@function
def example(source: dagger.Directory, path: str, format: str, outputname: str) -> dagger.File:
return (
dag.kicad()
.project(source)
.sch(path)
.netlist(format, outputname)
)@func()
example(source: Directory, path: string, format: string, outputName: string): File {
return dag
.kicad()
.project(source)
.sch(path)
.netlist(format, outputName)
}pdf() 🔗
Pdf plots the schematic to a single multi-page PDF — one page per sheet of a hierarchical design.
Return Type
File !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| outputName | String ! | "schematic.pdf" | No description provided |
Example
dagger -m github.com/z5labs/devex/daggerverse/kicad@a17bf411228ae3d544c7c18bcf08dd04c295d453 call \
project --source DIR_PATH \
sch --path string \
pdf --output-name stringfunc (m *MyModule) Example(source *dagger.Directory, path string, outputName string) *dagger.File {
return dag.
Kicad().
Project(source).
Sch(path).
Pdf(outputName)
}@function
def example(source: dagger.Directory, path: str, outputname: str) -> dagger.File:
return (
dag.kicad()
.project(source)
.sch(path)
.pdf(outputname)
)@func()
example(source: Directory, path: string, outputName: string): File {
return dag
.kicad()
.project(source)
.sch(path)
.pdf(outputName)
}svg() 🔗
Svg plots the schematic to SVG, one file per sheet, and returns the directory. Unlike Pcb.Svg there is no single-file counterpart: kicad-cli always plots schematics per sheet.
Return Type
Directory ! Example
dagger -m github.com/z5labs/devex/daggerverse/kicad@a17bf411228ae3d544c7c18bcf08dd04c295d453 call \
project --source DIR_PATH \
sch --path string \
svgfunc (m *MyModule) Example(source *dagger.Directory, path string) *dagger.Directory {
return dag.
Kicad().
Project(source).
Sch(path).
Svg()
}@function
def example(source: dagger.Directory, path: str) -> dagger.Directory:
return (
dag.kicad()
.project(source)
.sch(path)
.svg()
)@func()
example(source: Directory, path: string): Directory {
return dag
.kicad()
.project(source)
.sch(path)
.svg()
}