@takodotid/circuit 0.18.5 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -0
- package/dist/chunks/{index-ex1wcst7.js → index-dczpxzzm.js} +1 -1
- package/dist/chunks/studio-femhydvd.js +764 -0
- package/dist/cli/index.js +546 -8
- package/dist/index.js +1 -1
- package/dist/presets/index.js +1 -1
- package/dist/types/core/graph.d.ts +44 -0
- package/package.json +1 -1
- package/src/cli/graph.ts +103 -0
- package/src/cli/index.ts +69 -0
- package/src/cli/studio-page.ts +876 -0
- package/src/cli/studio.ts +126 -0
- package/src/core/graph.ts +613 -0
- package/templates/project/AGENTS.md +10 -9
- package/templates/project/README.md +1 -0
package/README.md
CHANGED
|
@@ -7,6 +7,24 @@ Documentation: [circuit.tako.id](https://circuit.tako.id)
|
|
|
7
7
|
> [!WARNING]
|
|
8
8
|
> Circuit is in alpha. It runs a production network, but the way you write config, the commands and the supported devices can still change between releases. Install an exact version, and read the release notes before you upgrade.
|
|
9
9
|
|
|
10
|
+
## What it does
|
|
11
|
+
|
|
12
|
+
- **One file per device.** VLANs, ports, addresses, routing, firewall, users and services, written in TypeScript. Your editor checks every name you refer to as you type.
|
|
13
|
+
- **The same words for every vendor.** MikroTik RouterOS 7, Huawei VRP and Raisecom ROS each get their own commands. What a device cannot do is an error before anything is sent.
|
|
14
|
+
- **The file is the whole truth.** A port, user or service the file does not mention is removed or turned off, so nothing set by hand lingers.
|
|
15
|
+
- **See every change first.** `diff` shows it offline, `apply` plans it against the live device, and nothing is sent without `--confirm`. On RouterOS, a change undoes itself if Circuit cannot log in again afterwards.
|
|
16
|
+
- **History in git.** Each device's last snapshot is kept in `.circuit/state/`, so the repository's history is the network's history.
|
|
17
|
+
- **Rules of your own.** Checks run on every change, and presets give ready-made filters, BGP policies and checks.
|
|
18
|
+
- **Secrets stay out of the repository.** They come from `.env` or 1Password, and never appear in a plan or a snapshot.
|
|
19
|
+
- **See the network.** `circuit studio` draws the cables, VLANs, addresses, BGP sessions, OSPF neighbors and tunnels in your browser, and marks what is broken or differs from the device. `circuit graph` prints the same as Mermaid, DOT or JSON.
|
|
20
|
+
- **Keeps the rest in step.** Prefix lists fetched from a registry, your PeeringDB record, devices in LibreNMS, targets for Prometheus, WireGuard client configs, and your BGP communities for a looking glass.
|
|
21
|
+
- **Safe with AI agents.** Every project gets an `AGENTS.md` that tells an agent what it may run, and the last step stays yours.
|
|
22
|
+
|
|
23
|
+
<picture>
|
|
24
|
+
<source media="(prefers-color-scheme: dark)" srcset="docs/public/screenshots/studio-dark.png">
|
|
25
|
+
<img src="docs/public/screenshots/studio-light.png" alt="Circuit studio showing the cables between five devices. One device is outlined in amber because it differs from its last snapshot.">
|
|
26
|
+
</picture>
|
|
27
|
+
|
|
10
28
|
## Start
|
|
11
29
|
|
|
12
30
|
You need [Node.js](https://nodejs.org) 20.12 or newer, or [Bun](https://bun.sh). Then:
|
|
@@ -106,4 +106,4 @@ function isGlobal(address) {
|
|
|
106
106
|
return !NOT_GLOBAL_V4.some((prefix) => contains(prefix, address));
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
export { familyOf, split, isAddress, isCidr, network, contains, netmask, wildcard, host, isGlobal };
|
|
109
|
+
export { familyOf, parse, split, isAddress, isCidr, network, contains, netmask, wildcard, host, isGlobal };
|