breadkit
Describe breadboard circuits in Ruby, YAML, or TOML. See how every connection fits together.
Breadkit resolves board holes, part pins, wires, and switch states into connected nets. It exports JSON IR for other tools and checks declared connection intent.
Circuit source ยท Explore its layers
Quick start
Install with Ruby 3.3 or newer:
gem install breadkitSave this as circuit.bk.rb:
title "Button and LED"
board :half
supply :USB, voltage: 5.0, plus: "B+1", minus: "B-1"
net :VCC, at: "B+1"
net :GND, at: "B-1"
button :SW1, at: "e10"
resistor :R1, "330", pins: %w[a12 a16]
led :D1, color: :red, anode: "b16", cathode: "b17"
wire "a10", "B+", color: :red
wire "a17", "B-", color: :blackbreadkit nets circuit.bk.rb
breadkit ir circuit.bk.rb > circuit.jsonThis README follows main (0.2.0). If breadkit --version shows an older
published release, use the source checkout for newer features.
The same circuit is available in YAML and
TOML.
Layered module example
The sensor demo combines an RP2040 module with
an OLED, two SHT31 sensors, switches, and IR modules. Its layer: declarations
group parts and wires in the interactive SVG. These lines are from the full
example:
offboard :OLED, :ssd1306_oled, side: :right, at: "a7", address: "0x3C", layer: "2 I2C"
offboard :SHT31A, :sht31, side: :right, at: "a12", address: "0x44", unused: ["ALR"], layer: "2 I2C"
offboard :SHT31B, :sht31, side: :right, at: "a19", address: "0x45", unused: ["ALR"], layer: "2 I2C"
wire "j5", "T+5", color: "#E24B4A", layer: "1 Power"
wire "OLED.SDA", "g24", color: "#378ADD", route: :edge, layer: "2 I2C"Run bundle exec ruby exe/breadkit nets examples/05_sensor_demo.bk.rb from a
source checkout to inspect the full circuit. The optional 5 V emitter layer is
an alternative: disconnect its 3.3 V feed before using it.
Explore
- User guide and circuit gallery
- DSL reference and component catalog
- CLI reference, YAML/TOML guide, and JSON IR
- Browser Playground and editor integration
- MCP server, Rake task, jumper kit, and definition lockfile
The companion repositories are breadkit-render for diagrams, breadkit-lint for circuit checks, breadkit-rspec for connection matchers, and breadkit-parts for model-specific definitions. Each gem is released independently.
Ruby DSL files execute code; load only files you trust. YAML, TOML, and JSON IR are parsed as data.
Development
git clone https://github.com/breadkit/breadkit.git
cd breadkit
bundle install
bundle exec ruby exe/breadkit nets examples/01_led_button.bk.rb
bundle exec rakeClone companion repositories beside this checkout when working on their main branches. See the compatibility policy before changing a public data format.
License
MIT.
