Commands
help lists the commands available in the current session, grouped by the NETCONF layers the library is built on (RFC 6241): content (client.content: paths and transactions), operations (client.ops, grouped by the extension and RFC that provide them), messages (client.session) and, in framed and raw sessions, transport. Then come the device profile, connecting, and nnc's own commands. Commands that change device state are marked *.
help content, help operations, help messages and help transport show one layer, and help <command> shows a command's usage, options and an example.
This page lists every command. The pages before it show them at work, by task: Connecting, The session, Configuration, Paths, Transactions, Notifications, Server data, Device profiles, Watching the wire and Output and input.
Syntax
get-config running --filter subtree @filters/system.xml > running.xml- Positional arguments come first, then options (
--name value, or--namefor a flag). - Quotes and
\work as in a shell. Inside[...]quotes are kept as typed, so YANG paths need no extra quoting:read /ietf-interfaces:interfaces/interface[name="eth0"]. A(...)that closes on the same line is kept as typed, spaces included, for a named path's parameters:read @route(10.0.0.0/8, 192.0.2.1). - Inline XML needs no quoting. It ends where its elements balance, and if you paste XML across several lines, the prompt keeps reading until it's complete.
- Inline JSON needs no quoting either: a word starting with
{ends where its braces balance, and may span lines.edit-configandedit-datatake RFC 7951 JSON as their configuration, andget,get-config,get-dataandcomparetake it as a filter (--filter subtree {"ietf-interfaces:interfaces": {}}); the library converts it with the device's YANG schema, as in JSON filters and Writing JSON. @pathreads XML, or JSON starting with{, from a file.--editopens$EDITORfor the XML instead.> filewrites the result to a file, and>> fileappends.#starts a comment.- Requests take
--timeout <ms>. Ctrl-C cancels the command in progress and leaves the session open. - Tab completes commands, options, argument values (
tracelevels,outputformats, target names, command names and layers afterhelp), module names after/, named paths after@, the parameters not yet given inside@name((completing a single one with its=), and file paths; a second Tab lists the choices, and a single match gets a space after it when more can follow. Ctrl-R searches history.
Every session
| Command | |
|---|---|
connect <target> [--framed | --raw] [--read-only] [--yang <dir>]… | open a session; --yang adds a directory of YANG modules for JSON output |
listen <target> [--port n] [--address a] [--read-only] [--timeout ms] | wait for the target's device to call home (RFC 8071); see Call home |
disconnect | close the session |
status | target, kind, session-id, base version, framing, profile, read-only |
trace [bytes] [frames] [xml] | off | watch the wire; --file <path> also writes to a file |
output [xml | json | raw] | the default output format |
show-last [--raw | --json | --xml] | the last result or rpc-error again |
history, targets, help, exit |
Try them against the simulated device: Run types a command into the terminal at the bottom of the page.
nnc> targets
nnc> connect lab
nnc lab> status
nnc lab> trace frames
nnc lab> history
nnc lab> disconnectClient sessions
Messages layer (help messages)
| Command | |
|---|---|
hello | the server's <hello> as received |
capabilities | capability URIs, after the profile's corrections; for YANG modules and features, see modules |
rpc <xml> | any RPC; nnc adds the <rpc> wrapper and message-id |
notifications [--follow] [--json] | notifications received so far, or as they arrive |
nnc lab> hello
nnc lab> capabilities
nnc lab> rpc <get-config><source><running/></source></get-config>Operations layer (help operations)
get, get-config, edit-config, copy-config, delete-config, lock, unlock, validate, commit, cancel-commit, discard-changes and kill-session, plus every operation from the extensions the device has the capabilities for, such as get-data, compare and establish-subscription. Operations the device lacks the capabilities for are left out of completion.
Extension reads
Extensions also describe what they can read and decode, so these are commands too. They print JSON, never change anything, and so work on read-only targets.
| Command | |
|---|---|
monitoring-sessions, monitoring-schemas, monitoring-datastores, monitoring-statistics | /netconf-state: open sessions, offered schemas, datastores and their lock holders, counters (RFC 6022) |
notification-streams | event streams (RFC 5277) |
subscription-streams, subscription-list, subscription-support | streams, dynamic subscriptions, and supported features for subscriptions (RFC 8639) |
yang-library [--refresh] | the modules each datastore implements (RFC 8525); read once per session unless --refresh |
Content layer (help content)
| Command | |
|---|---|
read <path> [--datastore <ds>] [--state] | the elements at a path |
value <path> | one leaf's value as plain text |
set <path> <value> | change a leaf, following the profile's workflow, showing each step |
remove <path> | remove a node; fine if it doesn't exist |
resolve <path> | how a path resolves, and the filter a read would send, without sending anything |
diff [<path>] [--source <ds>] [--target <ds>] | how two datastores differ, by default what the candidate would commit (running → candidate); works on any device, comparing with its YANG schema |
datastores | the device's datastores: from its YANG library on an NMDA server (with each one's schema), otherwise from its capabilities, saying which |
modules [<module>] [--datastore <ds>] [--schema <name>] [--all-features] | the device's YANG modules and the features it supports, for a datastore (default running) or YANG library schema: from its YANG library, otherwise from its hello, saying which. --all-features reads each module's source and lists every feature it declares, supported or not |
namespaces [<module>] [--source <source>] | the module namespaces paths resolve with, and where each came from (the target's namespaces, the device profile, the hello or the YANG library), with any it overrode. --source given|profile|hello|library lists that source's own namespaces instead, whether or not an earlier source wins |
diff reads both datastores and compares them in nnc, so it works on devices without compare. It prints one line per change, then a count:
nnc router1> diff
~ replace /ietf-interfaces:interfaces/interface[name='eth0']/mtu 1500 → 9000
+ create /ietf-interfaces:interfaces/interface[name='eth1']
{
"name": "eth1"
}
2 changes (running → candidate)namespaces shows where a module's namespace came from. When the device profile corrects one the hello gets wrong, the hello's is under OVERRIDES:
nnc router1> namespaces acme-system
MODULE NAMESPACE SOURCE OVERRIDES
─────────────────────────────────────────────────────────
acme-system urn:acme:system profile hello urn:acme:sys--source lists one source's own namespaces, as the library's moduleNamespacesInfo({ source }) does: namespaces --source hello is every module the hello names, with the namespace it gives. The SOURCE column is left out, and OVERRIDES then shows only where the source disagrees with itself, such as two YANG library module sets.
A <path> is a YANG path or a profile's named path: @systemName, or @ifDescription(eth0) for one with parameters, and more of the path may follow: set @interface(eth0)/description uplink. A read may leave out a parameter that fills a whole predicate to read every entry (read @ifDescription); set and remove need them all. profile lists each named path's parameters.
Transactions
| Command | |
|---|---|
begin | start queuing set and remove changes; the prompt shows [tx N] |
changes | the queued changes |
apply [--confirmed --confirm-timeout <s>] | send them all as one edit; --confirmed makes a confirmed commit |
confirm / revert | keep or roll back a pending confirmed commit |
abandon | drop the queued changes |
Subscriptions (RFC 8639, 8641)
| Command | |
|---|---|
establish-subscription --stream <name> | subscribe to an event stream; nnc reads the subscription for as long as it is open |
establish-subscription --datastore <ds> --period <cs> | --on-change | subscribe to a datastore's contents (YANG-Push) |
modify-subscription <id>, resync-subscription <id>, delete-subscription <id> | change, resynchronise or end one of this session's subscriptions |
kill-subscription <id> | end any session's subscription |
Each update shows above the prompt as a line naming the subscription and what the update is:
notification 4 · 2026-11-08T10:00:02Z · subscription 7 · suspended · insufficient-resources
notification 5 · 2026-11-08T10:00:04Z · subscription 7 · resumed
subscription 7 ended · deletednotifications lists them the same way, and --json includes the decoded update. status lists the open subscriptions.
Device profile
| Command | |
|---|---|
profile [--json] | the profile in use, why it was chosen, its quirks, workflow, paths and operations; --json adds its full effective definition |
profile <operation> [--json] | one operation's full definition: what it sends, how its reply is read, whether it changes state. Sends nothing |
device [--json] | the profile's operations, with their parameters |
device <operation> [--param value …] | run a profile operation on the device, such as device cli --command "show version" |
profile only reads what the library loaded, so it is safe on any target. device sends, and on a read-only target it refuses operations the profile doesn't mark "mutates": false. In help, the profile's operations are listed with the other operations, under device · profile <id>.
Call home
listen router1 waits for router1's device to connect to you, on port 4334 for an SSH target or 4335 for a TLS target. When it calls, the connection becomes a client session exactly as connect router1 would make it.
nnc> listen router1
listening for router1 on 0.0.0.0:4334 (ssh); Ctrl-C stops waiting
refused a call from 192.0.2.9:50122: unknown device (SHA256:Qx…); not the host key /home/you/.ssh/known_hosts lists for router1:830
router1 called home from 192.0.2.7:41234 · session-id 12 · base:1.1 · profile nokia-7210-sasA caller must prove it is the target with the same checks connect makes: over SSH, its host key must match the target's pinned hostKey, or else be the one your known_hosts file lists for the target's host and port; over TLS, its certificate must match the target's fingerprint, or chain to its ca and name its host. Its address is never trusted, and any other caller is refused before credentials are sent. Credentials are gathered before listening. A target with hostKey: insecure-accept-any takes the first device that calls, so nnc warns before listening; use --address to listen on one interface. Ctrl-C or --timeout stops waiting.
Framed sessions
Transport layer (help transport): framed messages.
| Command | |
|---|---|
hello [--base 1.0 | 1.1] | send a standard client hello |
send <xml> | @file | --edit | frame and send one message, exactly as typed |
framing [chunked] | show the framing, or switch to chunked |
server-hello [--raw] | the server's hello |
show [<n>] [--raw] | list received messages, or show one again |
Raw sessions
Transport layer (help transport): bytes.
| Command | |
|---|---|
send <text> | write bytes as typed; \n, \r, \t, \\ and \xHH escapes are understood |
send-hex <hex> | write bytes given in hex |
send-file <path> | write a file's bytes |
received [> file] | everything received |
eof | close our side of the stream |
Output
output [xml | json | raw] sets the format, and --xml, --json and --raw set it for one command. > file and >> file write a result to a file. See Output and input for formats, result views, paging and files.