Skip to content

Introduction ​

Circuit lets you write down how each network device should be set up. Then it makes the device match.

You keep one TypeScript file per device in a git repository. If you know Terraform or Ansible for servers, Circuit is the same idea for routers and switches.

A change goes from the device file, through circuit validate, to a plan made against what the device runs now, then your yes, then the device. 1Device fileedge-01.tsyour editor checks names2validatecircuit validatethe whole project3Plancircuit apply edge-01read the device now4Your yesSend? Yes / NoNo by default5Deviceedge-01kept once Circuit logs in again

How it works ​

  1. You describe a device in a file: its ports, VLANs, addresses, routing, firewall, and more.
  2. circuit validate checks the whole project.
  3. circuit diff <device> reads the device and shows what would change on it.
  4. circuit apply <device> shows the same, asks, and sends the change once you say yes. Circuit keeps the change only if it can still log in afterwards. See Make a change.
  5. You commit the files, so git keeps who changed what, when, and why.

Principles ​

  1. The file is the whole truth. A device runs exactly what its file says. Circuit turns off a port the file doesn't write, removes a user it doesn't list, and turns off a service it doesn't turn on.
  2. Leave a field out to turn it off. You write only what is on. There is no enabled: false.
  3. The same words for every vendor. You write access_vlan or ssh, and each device gets its own vendor's commands. If a device can't do what you wrote, circuit validate says so, and Circuit sends nothing.
  4. Names are checked as you type. Every VLAN, interface, policy, and port you use must exist on that device. Your editor shows a typo as an error.
  5. Nothing is filled in for you. Circuit writes no default and no description that you didn't write. It may warn, but it never fills in.
  6. Secrets are encrypted. A password is secret("NAME") in the file, and its value is encrypted in .circuit/secrets. See Secrets.
  7. Standards first. What Circuit ships, such as BGP roles or the bogon list, follows an RFC, IANA, or another published source. See Standards. Your network's own choices stay in your project.

Which devices ​

Circuit works with MikroTik RouterOS, Huawei VRP, Raisecom ROS, Juniper Junos, and Fortinet FortiOS. See Platforms for the versions and what works on each.

If some words are new to you, see the Glossary.

Released under the Business Source License 1.1.