12f17c0075
Add the -json flag to maglevc(1): the contract verified by a live smoke
test against a maglevd (chbtl2) — show/query commands print the object
as JSON, actions (set/sync/config reload) print {} on success, and
failures print {"error": "..."} on stderr with a non-zero exit. JSON
output is never colorized. Also corrects the -color description (the
palette is now bright blue, shared from golang-cli) and refreshes the
man date.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
129 lines
3.2 KiB
Groff
129 lines
3.2 KiB
Groff
.TH MAGLEVC 1 "June 2026" "vpp\-maglev" "User Commands"
|
|
.SH NAME
|
|
maglevc \- Maglev health\-checker CLI client
|
|
.SH SYNOPSIS
|
|
.B maglevc
|
|
[\fB\-server\fR \fIaddr\fR]
|
|
[\fB\-color\fR[=\fIbool\fR]]
|
|
[\fB\-json\fR]
|
|
[\fIcommand\fR [\fIargs\fR...]]
|
|
.SH DESCRIPTION
|
|
.B maglevc
|
|
is an interactive CLI client for
|
|
.BR maglevd (8).
|
|
Without arguments it opens a readline shell with tab completion and
|
|
inline help.
|
|
A command may also be passed directly on the command line for one\-shot
|
|
use, which is useful for scripting; in that mode ANSI color is
|
|
disabled by default so the output is script\-safe. Pass
|
|
.B \-color=true
|
|
explicitly if you want color in one\-shot mode.
|
|
.PP
|
|
When the shell starts it prints the build version and connects to the
|
|
.B maglevd
|
|
gRPC server specified by
|
|
.BR \-server .
|
|
All static tokens support tab completion; dynamic names (frontend,
|
|
backend, health\-check names) are completed by querying the server.
|
|
Type
|
|
.B ?
|
|
at any point to list completions without advancing the input.
|
|
.SH OPTIONS
|
|
Flags may also be supplied via an environment variable (shown in
|
|
parentheses where applicable); the flag takes precedence.
|
|
.TP
|
|
.BI \-server " addr"
|
|
Address of the
|
|
.B maglevd
|
|
gRPC server.
|
|
.RI "(default: " localhost:9090 "; env: " MAGLEV_SERVER )
|
|
.TP
|
|
.BR \-color [=\fIbool\fR]
|
|
Colorize static field labels in output using ANSI blue. The
|
|
default is mode\-aware: enabled (true) in the interactive shell, and
|
|
disabled (false) in one\-shot mode so that output piped into scripts
|
|
or files stays free of escape codes. Pass
|
|
.B \-color=true
|
|
or
|
|
.B \-color=false
|
|
explicitly to override the default for either mode.
|
|
.TP
|
|
.B \-json
|
|
Emit JSON instead of human\-readable text, for scripting. Every
|
|
.B show
|
|
or query command prints the underlying object as JSON; an action that
|
|
changes state
|
|
.RB ( set ", " sync ", " "config reload" )
|
|
prints
|
|
.B {}
|
|
on success; and any failure prints
|
|
.B {\(dqerror\(dq: \(dq...\(dq}
|
|
on stderr with a non\-zero exit status. JSON output is never colorized.
|
|
.TP
|
|
.B \-version
|
|
Print version, commit hash, and build date, then exit.
|
|
.SH EXAMPLES
|
|
Open the interactive shell (no command on the command line). Tab
|
|
completes the current token; typing
|
|
.B ?
|
|
lists candidates at the cursor.
|
|
.B quit
|
|
or
|
|
.B exit
|
|
(or Ctrl\-D) leaves the shell:
|
|
.PP
|
|
.RS
|
|
.EX
|
|
$ maglevc
|
|
maglevc> show frontends
|
|
\&...
|
|
maglevc> quit
|
|
.EE
|
|
.RE
|
|
.PP
|
|
One\-shot query passed on the command line (color is off by default
|
|
in this mode so the output is script\-safe):
|
|
.PP
|
|
.RS
|
|
.EX
|
|
$ maglevc show frontends
|
|
.EE
|
|
.RE
|
|
.PP
|
|
Query VPP version and connection status, forcing color on:
|
|
.PP
|
|
.RS
|
|
.EX
|
|
$ maglevc \-color=true show vpp info
|
|
.EE
|
|
.RE
|
|
.PP
|
|
Emit JSON for scripting. A query returns the object; an action returns
|
|
.BR {} ;
|
|
a failure returns
|
|
.B {"error": ...}
|
|
with a non\-zero exit status:
|
|
.PP
|
|
.RS
|
|
.EX
|
|
$ maglevc \-json show frontend nginx\-ip4\-http
|
|
$ maglevc \-json sync vpp lb state
|
|
{}
|
|
.EE
|
|
.RE
|
|
.SH "FULL DOCUMENTATION"
|
|
This manpage documents only the invocation of
|
|
.BR maglevc .
|
|
For the complete command reference — every
|
|
.BR show ", " set ", " sync ", " config ", and " watch
|
|
command, with examples and operational notes — see the user guide at:
|
|
.PP
|
|
.RS
|
|
https://git.ipng.ch/ipng/vpp-maglev/docs/user-guide.md
|
|
.RE
|
|
.SH SEE ALSO
|
|
.BR maglevd (8),
|
|
.BR maglevd\-frontend (8)
|
|
.SH AUTHOR
|
|
Pim van Pelt <pim@ipng.ch>
|