Skip to content
takodotidPublic

About

Circuit is a declarative, vendor-neutral network configuration. Describe each device in TypeScript, and Circuit renders it for the platform, compares it with what the device runs, and makes the device match.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

8 stars

Watchers

0 watching

Forks

Latest commit

 

History

1,443 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Circuit

Your network, written down.
One TypeScript file per device. Circuit shows what would change, then makes the device match.

check release npm license docs

Install · Guide · Academy · Studio

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.

Circuit Studio's graph of an example network, beside the layer's details.

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.

About

Circuit is a declarative, vendor-neutral network configuration. Describe each device in TypeScript, and Circuit renders it for the platform, compares it with what the device runs, and makes the device match.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

8 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages