API Reference
Primary API docs live on docs.rs:
Key items:
KiCadClient(async)KiCadClientBlocking(blockingfeature)KiCadError- Typed models under
model::*
PCB item API layers:
- Raw IPC:
*_rawmethods returnprost_types::Anypayloads for direct protobuf interop. - Read model:
PcbItemand relatedPcb*structs are lightweight decoded models for inspection. - Editable model:
EditablePcbItemand typed wrappers preserve the full protobuf payload for mutate/update workflows.
Raw command escape hatch:
KiCadClient::send_raw_command(...)KiCadClientBlocking::send_raw_command(...)(blockingfeature)
Use this when KiCad exposes a protobuf command that does not yet have a typed helper.
Editable item helpers:
get_editable_items_by_id(...)get_editable_items_by_type_codes(...)create_editable_items(...)update_editable_items(...)
Use EditablePcbItem when you need to fetch existing board items, mutate fields like layer or position, and write them back through KiCad IPC without hand-building protobuf Any payloads. The editable wrappers expose proto(), proto_mut(), and into_proto() as advanced escape hatches when typed helpers are not enough.
Typed board text helpers:
create_board_text(...)create_board_texts(...)create_board_text_in_container(...)create_board_texts_in_container(...)
These helpers build kiapi.board.types.BoardText payloads and send typed CreateItems, matching kicad-python’s direct BoardText creation path. Prefer them for silkscreen and board text creation instead of parse_and_create_items_from_string(...).
All-PCB item reads:
get_all_pcb_items_raw(...)get_all_pcb_items_details(...)get_all_pcb_items(...)
These methods use one combined GetItems request for the known PCB object classes, then bucket returned payloads by KiCad item type. If KiCad returns a payload type the crate cannot map, the call returns KiCadError::InvalidResponse instead of silently dropping it.
Deletion notes:
delete_items(...)returns ids reported by KiCad as deleted.- KiCad 10.0.x may acknowledge
DeleteItemswith no per-item rows. In that casedelete_items(...)returns the requested ids after request success; treat them as accepted by KiCad, not independently verified deleted.
Object and layer lookup helpers:
PcbObjectTypeCode::from_name(...)accepts proto names and friendly names liketrace,track,footprint,pad,text, andsilkscreen-text.PcbObjectTypeCode::new_trace(),new_pad(),new_text(), and related constructors avoid hardcoded object type numbers.BoardLayerInfo::id_from_name(...)andcanonical_name_for_id(...)resolve KiCad board layer names such asF.SilkSand protobuf names such asBL_F_SilkS.
Selection API notes:
get_selection_*methods now taketype_codes: Vec<i32>(Vec::new()means no filter).add_to_selection,remove_from_selection,clear_selectionreturnSelectionMutationResult(decoded items + summary).get_selection_as_stringreturnsSelectionStringDump(ids+contents).
Net query notes (KiCad 10.0.1):
get_items_by_net(...)treats net names as authoritative.- Numeric net codes are carried for legacy compatibility but should not be used as the primary dedupe key.
Breaking-change note (unreleased):
TitleBlockInfo.commentsnow preserves fixedcomment1..comment9slot ordering (including internal empty slots) when round-tripping throughset_title_block_infoandget_title_block_info.- For this pre-1.0 crate, expect this behavior change to land in a new minor release (not a patch release).