@takodotid/circuit
v1.2.1
Published
Declarative, vendor-neutral network configuration: describe each device in TypeScript, and Circuit makes the device match. One binary, nothing to install.
Readme
A device's file holds its ports, VLANs, addresses, routing, firewall, and users. Your editor checks every name and every port as you type. Circuit reads what the device runs, shows you the difference, and sends the change once you say yes. Introduction explains how it works.
Circuit works with MikroTik RouterOS 7, Huawei VRP, Raisecom ROS, Juniper Junos, and Fortinet FortiOS. Platforms shows what works on each.
A device
// sites/site-a/switch-01.ts
import { as64500 } from "../../circuit";
import { site_a } from "./site";
export default as64500.device({
name: "switch-01",
site: "site-a",
platform: "vrp",
model: "CE6855-48S6Q-HI",
connection: { host: "192.0.2.2", user: "netops" },
system: {
users: { netops: { role: "admin", password: secret("SWITCH_01_ADMIN_PASSWORD") } },
},
interfaces: {
ethernet: {
"10g-1": { description: "edge-01 sfp28-2", trunk_vlans: ["mgmt"], link: { device: "edge-01", port: "25g-2" } },
},
vlan_interface: {
mgmt: { vlan: "mgmt", addresses: [site_a.addresses.switch] },
},
},
switching: {
vlans: { mgmt: site_a.vlans.mgmt },
},
});If you write the port "10g-49", the editor shows an error, because this switch has no such port. A typo such as trunk_vlans: ["mgnt"] is an error too, and circuit validate asks Did you mean mgmt?. How to write a project shows the whole project.
Circuit Studio
circuit studio draws the network and lists everything in the project, in your browser.
Install
- Linux and macOS:
curl -fsSL https://circuit.tako.id/install | sh - Windows, in PowerShell:
irm https://circuit.tako.id/install.ps1 | iex
Then start a project with circuit new network, and open its folder in VS Code. Run circuit alone for a menu. Install has the details, and the circuit command lists every command.
Contributing
CONTRIBUTING.md explains how to change Circuit. DECISIONS.md holds the decisions that shaped it.
License
Circuit is source-available under the Business Source License 1.1. A small organization uses it in production for free, and a larger one needs a commercial license. Each version moves to the Apache License 2.0 four years after it is published. License and credits gives the limits.
