Skip to content

cli tour

Thomas Mangin edited this page Jul 25, 2026 · 3 revisions

Pre-Alpha. This page describes behavior that may change.

The Ze CLI is a network-OS shell, not a Unix CLI bolted on top of a daemon. You connect over SSH, you get tab completion driven by the YANG schema, and the workflow is the one you would expect from a JunOS or Cisco operator: you edit, you diff, you commit, and you can roll back. This page is the five-minute tour. The full reference lives at interfaces/cli.md.

Connecting

Ze does not have a separate management daemon. Every CLI access goes through the SSH server built into the Ze process. Once ze start is running, you have three ways to talk to it.

ze cli                              # Interactive shell
ze cli -c "peer list"               # One-shot command
ze show peer upstream show           # Read-only query, safe in scripts

The interactive shell (ze cli) is what you use day to day. ze show is the read-only path you put in monitoring scripts and dashboards because it cannot mutate state.

A first session

Drop into the shell, list your peers, and look at one in detail.

$ ze cli
ze# peer list
NAME       REMOTE          AS       STATE
upstream   10.0.0.1        65001    ESTABLISHED
ixp        192.0.2.42      65010    ESTABLISHED

ze# peer upstream show
peer upstream {
    connection { remote { ip 10.0.0.1; } }
    session    { asn { remote 65001; } }
    state established
    uptime 2h13m
    capabilities [ four-octet-asn add-path route-refresh ]
}

Tab completion works on every position: command verbs, peer names, address families, log levels. Hit Tab twice to see the candidates.

Edit, diff, commit, rollback

This is the part that distinguishes Ze from a script-driven daemon. Configuration changes happen in a draft session that belongs to you. They are invisible to other users until you commit them, and they survive disconnection.

ze# edit bgp peer upstream
ze[bgp peer upstream]# set timer hold-time 180
ze[bgp peer upstream]# top
ze# diff
+ bgp peer upstream timer hold-time 180
- bgp peer upstream timer hold-time 90
ze# commit
Commit successful.

If you mistype, discard throws away the draft. If you want a safety net for a remote change you might lock yourself out of, commit confirmed runs a rollback timer: if you do not type commit confirm again within the window, Ze reverts.

ze# commit confirmed 60
Commit applied. Auto-rollback in 60s if not confirmed.
ze# commit confirm

rollback 1 undoes the last commit. The archive keeps every committed config, so rollback 5 is also legal, and you can show archive to see what is in the history.

Pipes, JSON, and one-liners

The shell has a small set of pipe operators borrowed from network OS shells, not from Unix.

ze# bgp summary | json
ze# peer list | match upstream
ze# rib routes received upstream | count

| json is the one you will use most often, both interactively (to inspect a structure) and from scripts (to parse the output cleanly). | no-more disables paging when you want to dump a long table into a file.

For automation, the one-shot form is what you want. ze cli -c runs a single command and exits, and ze show does the same for read-only queries. The exit code is non-zero on error, so you can chain it into shell pipelines without surprises.

Where to go next

Adapted from main/docs/guide/cli.md.

Home

About

First Steps

Configuration

Operation

Interfaces

Plugins

Plugin Development

Chaos Testing

Blueprints

Development

Reference

Clone this wiki locally