|
| 1 | +# sdc-lite |
| 2 | + |
| 3 | +[`sdc-lite`](https://github.com/sdcio/sdc-lite) is a standalone CLI tool for working with network operating system (NOS) configurations based on YANG schemas. It runs entirely on your local machine — no Kubernetes cluster or live device connection required. |
| 4 | + |
| 5 | +## Use cases |
| 6 | + |
| 7 | +- **Validate configs offline** — check a configuration file against a YANG schema before pushing it to a device or submitting it to a CI pipeline. |
| 8 | +- **Convert between formats** — load a config in one format (e.g. `json_ietf`) and output it in another (e.g. `xml` or `json`). |
| 9 | +- **Inspect and diff intents** — load multiple config intents at different priorities and see the merged result, or diff it against a baseline running config. |
| 10 | +- **Trace intent ownership** — use `blame` to see which intent is the source of each config leaf in the merged result. |
| 11 | + |
| 12 | +## Installation |
| 13 | + |
| 14 | +```bash |
| 15 | +curl -fsSL https://raw.githubusercontent.com/sdcio/sdc-lite/main/install.sh | bash |
| 16 | +``` |
| 17 | + |
| 18 | +Alternatively, if you have Go installed: |
| 19 | + |
| 20 | +```bash |
| 21 | +go install github.com/sdcio/sdc-lite@latest |
| 22 | +``` |
| 23 | + |
| 24 | +Shell completions (bash, zsh, fish) are installed automatically by the install script. |
| 25 | + |
| 26 | +## Key commands |
| 27 | + |
| 28 | +| Command | Description | |
| 29 | +|---|---| |
| 30 | +| `sdc-lite schema load -t <target> -f <schema.yaml>` | Load a YANG schema and associate it with a target | |
| 31 | +| `sdc-lite schema list` | List all loaded schemas | |
| 32 | +| `sdc-lite config load -t <target> --file <path> --file-format <fmt> --intent-name <name>` | Load a config file as a named intent | |
| 33 | +| `sdc-lite config validate -t <target>` | Validate the merged config against the schema | |
| 34 | +| `sdc-lite config diff -t <target>` | Show a diff between the intent config and the running baseline | |
| 35 | +| `sdc-lite config show -t <target> -o json -a` | Show the full merged configuration | |
| 36 | +| `sdc-lite config blame -t <target>` | Show which intent owns each config leaf | |
| 37 | +| `sdc-lite target show -t <target>` | Show target details (schema, intents) | |
| 38 | +| `sdc-lite target remove -t <target>` | Remove a target and its associated state | |
| 39 | + |
| 40 | +## Workflow example |
| 41 | + |
| 42 | +The following walkthrough loads a Nokia SR Linux schema, applies a running config as a baseline, overlays a config intent, and inspects the result. |
| 43 | + |
| 44 | +```bash |
| 45 | +# 1. Load the YANG schema for SR Linux 24.10.1 and associate it with "router1" |
| 46 | +sdc-lite schema load -t router1 \ |
| 47 | + -f https://raw.githubusercontent.com/sdcio/config-server/refs/heads/main/example/schemas/schema-nokia-srl-24.10.1.yaml |
| 48 | + |
| 49 | +# 2. Load the device's running config as the lowest-priority baseline intent |
| 50 | +sdc-lite config load -t router1 \ |
| 51 | + --file https://raw.githubusercontent.com/sdcio/sdc-lite/refs/tags/v0.1.0/data/config/running/running_srl_01.json \ |
| 52 | + --file-format json \ |
| 53 | + --intent-name running |
| 54 | + |
| 55 | +# 3. Load a config intent at higher priority (ethernet-1/1 VLAN config) |
| 56 | +sdc-lite config load -t router1 \ |
| 57 | + --file https://raw.githubusercontent.com/sdcio/sdc-lite/refs/tags/v0.1.0/data/config/additions/srl_01.json \ |
| 58 | + --file-format json \ |
| 59 | + --intent-name config1 \ |
| 60 | + --priority 50 |
| 61 | + |
| 62 | +# 4. Validate the merged config against the schema |
| 63 | +sdc-lite config validate -t router1 |
| 64 | + |
| 65 | +# 5. Diff the intent additions against the running baseline |
| 66 | +sdc-lite config diff -t router1 --type patch |
| 67 | + |
| 68 | +# 6. Blame — see which intent owns each config leaf under /interface |
| 69 | +sdc-lite config blame -t router1 -p /interface |
| 70 | + |
| 71 | +# 7. Clean up |
| 72 | +sdc-lite target remove -t router1 |
| 73 | +``` |
| 74 | + |
| 75 | +## Further reference |
| 76 | + |
| 77 | +Full command reference and additional examples are available in the [sdc-lite GitHub repository](https://github.com/sdcio/sdc-lite). |
0 commit comments