sdc-lite is a CLI tool to interact with network operating system (NOS) configurations based on YANG schemas.
It provides powerful capabilities for working with configurations — from schema management to validation — and also allows configuration format conversion.
With sdc-lite, you can:
- Load YANG schemas
- Validate configurations against loaded schemas
- Compare and inspect configuration differences
- Blame resulting config to see the contributing intents
- Convert configurations between formats (e.g., load a config in
json_ietfformat, then output it asxml)
You can install sdc-lite in several ways:
curl -fsSL https://raw.githubusercontent.com/sdcio/sdc-lite/main/install.sh | bashPrebuilt binaries for Linux, macOS, and Windows are available.
- One-Liner install
- Visit the Releases page.
- Download the archive for your platform.
- Extract the binary and place it somewhere in your
PATH:
tar -xvf sdc-lite_<version>_<os>_<arch>.tar.gz
sudo mv sdc-lite /usr/local/bin/If you have Go installed:
git clone https://github.com/sdcio/sdc-lite.git
cd sdc-lite
go build -o sdc-lite main.goIf you just want the latest main branch build:
go install github.com/sdcio/sdc-lite@latestsdc-lite provides tab-completion for commands, flags, and target names.
After installation, you can enable completions for your shell:
Bash
sdc-lite completion bash > ~/.bash_completion.d/sdc-lite
echo "source ~/.bash_completion.d/sdc-lite" >> ~/.bashrc
source ~/.bashrc
Zsh
mkdir -p ~/.zsh/completions
sdc-lite completion zsh > ~/.zsh/completions/_sdc-lite
echo "fpath=(~/.zsh/completions $fpath)" >> ~/.zshrc
autoload -Uz compinit && compinit
source ~/.zshrc
Fish
mkdir -p ~/.config/fish/completions
sdc-lite completion fish > ~/.config/fish/completions/sdc-lite.fish
Tip: If you use the provided install.sh script, completions are installed automatically for Bash, Zsh, and Fish.
Load a schema:
sdc-lite schema load -t router1 -f https://raw.githubusercontent.com/sdcio/config-server/refs/heads/main/example/schemas/schema-nokia-srl-24.10.1.yamlCreates a target by the name of router1, downloads the referenced schema data and assignes them to the target.
IMPORTANT: The schema.yaml is a schema definition file used by sdc. The file format is described here sdc schema doc. Example schema definitions for different vendors can be found here as well.
Load a baseline / running config
sdc-lite config load -t router1 --file-format json --intent-name running --file https://raw.githubusercontent.com/sdcio/sdc-lite/refs/tags/v0.1.0/data/config/running/running_srl_01.json Output:
Target: router1
File: https://raw.githubusercontent.com/sdcio/sdc-lite/refs/tags/v0.1.0/data/config/running/running_srl_01.json - Name: running, Prio: 2147483547, Flag: update, Format: json - successfully loaded
Load config snippet:
sdc-lite config load -t router1 --file https://raw.githubusercontent.com/sdcio/sdc-lite/refs/tags/v0.1.0/data/config/additions/srl_01.json --file-format json --intent-name config1 --priority 50Output:
Target: router1
File: data/config/additions/srl_01.json - Name: config1, Prio: 50, Flag: update, Format: json - successfully loaded
Load sdc config intent
sdc-lite config load -t router1 --file-format sdc --file https://raw.githubusercontent.com/sdcio/sdc-lite/refs/tags/v0.1.0/data/config/additions/srl_01_sdc.yamlOutput:
Target: router1
File: https://raw.githubusercontent.com/sdcio/sdc-lite/refs/tags/v0.1.0/data/config/additions/srl_01_sdc.yaml - Name: test-orphan, Prio: 10, Flag: update, Format: json - successfully loaded
Show Target details:
sdc-lite target show -t router1 Output:
Target: router1 (/home/mava/.cache/sdc-lite/targets/router1)
Schema:
Name: srl.nokia.sdcio.dev
Version: 24.10.1
Intent: config1
Prio: 50
Flag: update
Format: json
Intent: running
Prio: 2147483547
Flag: update
Format: json
Intent: test-orphan
Prio: 10
Flag: update
Format: json
Show current configuration:
sdc-lite config show -t router1 -o json -a --path /interface[name="ethernet-1/1"]Output formats can also be json_ietf or xml.
If you want to see only addtions on top of running, remove the -a option.
Output
Target: router1
{
"admin-state": "enable",
"name": "ethernet-1/1",
"subinterface": [
{
"index": 2,
"type": "bridged",
"vlan": {
"encap": {
"single-tagged": {
"vlan-id": 2
}
}
}
}
],
"vlan-tagging": true
}
Validate a config:
sdc-lite config validate -t router1Output:
Target: router1
Validations performed:
leafref: 25
length: 113
mandatory: 5
min/max: 4
must-statement: 785
pattern: 23
range: 125
Successful Validated!
Diff config changes:
sdc-lite config diff -t router1 --type patch Output:
Target: router1
@@ -1720,5 +1720,19 @@
{
"admin-state": "enable",
- "name": "ethernet-1/1"
+ "name": "ethernet-1/1",
+ "subinterface": [
+ {
+ "index": 2,
+ "type": "bridged",
+ "vlan": {
+ "encap": {
+ "single-tagged": {
+ "vlan-id": 2
+ }
+ }
+ }
+ }
+ ],
+ "vlan-tagging": true
},
{
---
@@ -1740,4 +1754,9 @@
}
]
+ },
+ {
+ "admin-state": "enable",
+ "description": "k8s-system0-dummy",
+ "name": "system0"
}
],
---
Blame - show intent sources of configuration
sdc-lite config blame -t router1 -p /interfaceOutput:
Target: router1
----- │ 🎯 interface
----- │ ├── 📦 ethernet-1/1
config1 │ │ ├── 🍃 admin-state -> enable
config1 │ │ ├── 🍃 name -> ethernet-1/1
----- │ │ ├── 📦 subinterface
----- │ │ │ └── 📦 2
config1 │ │ │ ├── 🍃 index -> 2
config1 │ │ │ ├── 🍃 type -> bridged
----- │ │ │ └── 📦 vlan
----- │ │ │ └── 📦 encap
----- │ │ │ └── 📦 single-tagged
config1 │ │ │ └── 🍃 vlan-id -> 2
config1 │ │ └── 🍃 vlan-tagging -> true
----- │ ├── 📦 mgmt0
running │ │ ├── 🍃 admin-state -> enable
running │ │ ├── 🍃 name -> mgmt0
----- │ │ └── 📦 subinterface
----- │ │ └── 📦 0
running │ │ ├── 🍃 admin-state -> enable
running │ │ ├── 🍃 index -> 0
running │ │ ├── 🍃 ip-mtu -> 1500
----- │ │ ├── 📦 ipv4
running │ │ │ ├── 🍃 admin-state -> enable
running │ │ │ └── 🍃 dhcp-client -> {}
----- │ │ └── 📦 ipv6
running │ │ ├── 🍃 admin-state -> enable
running │ │ └── 🍃 dhcp-client -> {}
----- │ └── 📦 system0
test-orphan │ ├── 🍃 admin-state -> enable
test-orphan │ ├── 🍃 description -> k8s-system0-dummy
test-orphan │ └── 🍃 name -> system0
Remove the target for cleanup
sdc-lite target remove -t router1 Output:
Target: router1
INFO[0000] target router1 - successfully removed
The general syntax is:
sdc-lite [command] [flags]Use --help with any command to see its options:
sdc-lite schema load --helpManage and inspect device configurations.
sdc-lite config load -t <target> --file <path|-> --file-format <format> [--priority 500] [--intent-name <name>]Flags:
--file string– Config file path or-for stdin--file-format string– One ofjson,json-ietf,xml,sdc, etc.--priority int– Config priority (default500)--intent-name string– Name of the configuration intent--rpc- Print the rpc definition for the actual command
sdc-lite config bulk -t <target> --files file1.yaml,file2.yaml--files stringSlice– List of files to load
sdc-lite config blame -t <target> [--include-defaults]--include-defaults– Include schema defaults--rpc- Print the rpc definition for the actual command
sdc-lite config show -t <target> [-o json] [-a]-o, --out-format string– Output format (json,xml,json_ietf, etc.)-a, --all– Show entire config, not just updates--rpc- Print the rpc definition for the actual command
sdc-lite config diff -t <target> [--type side-by-side-patch] [--context 2] [--no-color] [-o json]--type string– Diff type--context int– Context lines (default 2)--no-color– Disable colored output-o, --out-format string– Output format--rpc- Print the rpc definition for the actual command
sdc-lite config validate -t <target>Manage YANG schema versions and definitions.
sdc-lite schema listsdc-lite schema load -t <target> -f schema.yaml [--cleanup]-f, --schema-def string– Schema definition file (required)-c, --cleanup– Cleanup schema directory after load (defaulttrue)--rpc- Print the rpc definition for the actual command
sdc-lite schema remove [-f schema.yaml] [--vendor <vendor>] [--version <version>]Manage configured targets.
sdc-lite target show -t <target>sdc-lite target remove -t <target>Automate sequences of configuration operations.
sdc-lite pipeline run --file <pipeline.json>--file string– Path to the pipeline definition (JSON) file or-for stdin. The pipeline file consists of sequential steps, each specified as a JSON-RPC message.
Some commands share persistent flags:
-t, --target string– The target to use (required)-o, --out-format string– Output format (json,xml, etc.)
Have questions, ideas, bug reports or just want to chat? Come join our discord server.
Code is under the Apache License 2.0, documentation is CC BY 4.0.
The SDC project is following the CNCF Code of Conduct. More information and links about the CNCF Code of Conduct are here.
