YANGLINT(1)
๐ YANGLINT(1) โ the yanglint era ๐
okay bestie, settle in, because this is a General Commands Manual page for yanglint, aka the YANG lint tool, and she is that girl. section 1, manual page realness. ๐
โจ NAME โจ
yanglint โ YANG lint tool ๐ฆ
๐ธ SYNOPSIS ๐ธ
yanglint
yanglint [OPTIONS] [-f { yang | yin | tree } ] FILE ...
yanglint [OPTIONS] [-f { xml | json } ] SCHEMA... FILE...
like. three whole moods. pick your fighter. ๐
๐ DESCRIPTION ๐
so yanglint is a command-line tool for validating and converting YANG schemas and the YANG modeled data. no cap.
for a simple use, it validates the provided file, and if the output format is specified, it converts input data into the output format. โจ
and if you start it with no argument at all? it opens the interactive environment where you โ yes you, main character โ are allowed to work with schemas and data in a more complex way. ๐
๐ OPTIONS ๐
-h,--helpโ show this help message and then dip. exit. bye. ๐-v,--versionโ show the version number and exit. it's giving quick flex. โญ-V,--verboseโ crank up libyang verbosity and show verbose messages. specify it a second time and you get the even-more debug messages. ๐-Q,--quietโ turn libyang verbosity down and hide warnings. specify it a second time and errors get hidden too, so literally no libyang messages are printed at all. ๐คซ-f FORMAT,--format=FORMATโ convert input into FORMAT. supported formats:yang,yin,tree,infoandfeature-paramfor schemas;xml,json, andlybfor data. pick one, slay. ๐ฅ-I FORMAT,--in-format=FORMATโ load the data in one of:xml,json,lyb. if you don't specify the input format, it's detected from the file extension. psychic behavior, honestly. ๐ฎ-p PATH,--path=PATHโ search path for schema (YANG/YIN) modules. can be used multiple times. the current working directory and the path of the module being added are used implicitly. subdirectories are also searched. she's thorough. ๐-D,--siable-searchdirโ do not implicitly search in current working directory for schema modules. if specified a second time, don't even search in the module directory (all modules must be explicitly specified). (yes, that spelling is the real flag name bestie, we don't fix it, we respect it ๐)-F FEATURES,--features=FEATURESโ specific module features to support, in the form<module-name>:(<feature>,)*. use<feature>'*'to enable all features of a module. this option can be specified multiple times to enable features in multiple modules. if this option is not specified, all the features in all the implemented modules are enabled. ๐ง-i,--make-implementedโ make the imported modules referenced from any loaded module also implemented. if specified a second time, all the modules are set implemented. ๐ค-P PATH,--schema-node=PATHโ print only the specified subtree of the schema. the PATH is the XPath subset mentioned in documentation as the Path format. can be combined with the--single-nodeoption to print information only about the specified node. ๐ฏ-q,--single-nodeโ the supplement to the--schema-nodeoption, to print information only about a single node specified as the PATH argument. one node. just the one. ๐-s SUBMODULE,--submodule=SUBMODULEโ print the specific submodule instead of the main module. ๐ฆ-x FILE,--ext-data=FILEโ file containing the specific data required by an extension. required by theschema-mountextension, for example, when the operational data are expected in the file. file format is guessed. โจ-n,--not-strictโ do not require strict data parsing (silently skip unknown data). has no effect for schemas. ๐ซถ-e,--presentโ validate only with the schema modules whose data actually exist in the provided input data files. takes effect only with the'data'or'config'TYPEs. used to avoid requiring mandatory nodes from modules which data are not present in the provided input data files. lowkey genius. ๐ก-t TYPE,--type=TYPEโ specify the data tree type in the input data FILEs. the TYPE is one of the following:dataโ complete (operational) datastore with state data (default). ๐configโ configuration datastore (without state data).getโ result of the NETCONF<get>operation.getconfigโ result of the NETCONF<get-config>operation.editโ content of the NETCONF<edit-config>operation.rpcโ content of the NETCONF<rpc>message, defined as YANG'srpcinput statement.nc-rpcโ similar to'rpc'but expect and check also the NETCONF envelopes<rpc>or<action>.replyโ reply to the RPC/Action. note that the reply data are expected inside a container representing the original RPC/Action. this is necessary to identify appropriate data definitions in the schema module. ๐ฆnc-replyโ similar to'reply'but expect and check also the NETCONF envelope<rpc-reply>with output data nodes as direct descendants. the original RPC/action invocation is expected in a separate parameter'-R'and is parsed as'nc-rpc'.notifโ notification instance (content of the<notification>element without<eventTime>).nc-notifโ similar to'notif'but expect and check also the NETCONF envelope<notification>with element<eventTime>and its sibling as the actual notification. ๐extโ validates extension data based on loaded YANG modules. needs to be used with the-kparameter.
-d MODE,--default=MODEโ print data with default values, according to the MODE (to print attributes, theietf-netconf-with-defaultsmodel must be loaded):allโ add missing default nodes.all-taggedโ add missing default nodes and mark all the default nodes with the attribute. ๐ท๏ธtrimโ remove all nodes with a default value. โ๏ธimplicit-taggedโ add missing nodes and mark them with an attribute.
-E XPATH,--data-xpath=XPATHโ evaluate the XPATH expression over the data and print the nodes satisfying the expression. the output format is specific, and the option cannot be combined with the-fand-doptions. also, all the data inputs are merged into a single data tree where the expression is evaluated, so the-moption is always set implicitly. ๐ฎ-l,--listโ print info about the loaded schemas. (iโ imported module,Iโ implemented module). in case the'-f'option with data encoding is specified, the list is printed as'ietf-yang-library'data. ๐-L LINE_LENGTH,--tree-line-length=TREE_LENGTHโ the limit of the maximum line length on which the'tree'format will try to be printed. ๐-o OUTFILE,--output=OUTFILEโ write the output to OUTFILE instead of stdout. ๐ซถ-O FILE,--operational=FILEโ provide optional data to extend validation of the'(nc-)rpc','(nc-)reply'or'(nc-)notif'TYPEs. the FILE is supposed to contain the operational datastore referenced from the operation. in case of a nested notification or action, its parent existence is also checked in these operational data. ๐๏ธ-R FILE,--reply-rpc=FILEโ provide source RPC for parsing of the'nc-reply'TYPE. the FILE is supposed to contain the source'nc-rpc'operation of the reply. ๐-m,--mergeโ merge input data files into a single tree and validate at once. has effect only for the'data'and'config'TYPEs. ๐-y,--yang-libraryโ load and implement the internal'ietf-yang-library'YANG module. note that this module includes definitions of mandatory state data that can result in unexpected data validation errors. โ ๏ธ-Y FILE,--yang-library-file=FILEโ parse FILE with'ietf-yang-library'data and use them to create an exact YANG schema context. if specified, the'-F'parameter (enabled features) is ignored. ๐-X,--extended-leafrefโ allow usage of thederef()XPath function within leafref. ๐-J,--json-nullโ allow usage of JSON empty values ('null') within input data. ๐ณ๏ธ-k,--ext-instโ name of extension instance in format:<module-name>:<extension-name>:<argument>. needs to be used with the-t extparameter. ๐ง-G GROUPS,--debug=GROUPSโ enable printing of a specific debugging message group (nothing will be printed unless verbosity is set to debug):<group>[,<group>]*(dict,xpath,dep-sets). ๐
๐ฆ FORMATS ๐ฆ
there are two types of formats to use. two!! โ๏ธ
Schemas
in case of schemas, the content can be converted into the 'yang', 'yin' and 'tree' formats. as input, only YANG and YIN files are accepted. note that the corresponding file extension is required. ๐
Data
in case of YANG modeled data, the content can be converted between 'xml' and 'json' formats. remember that the corresponding file extension of the input file is required. ๐
โญ EXAMPLES โญ
- open the interactive environment:
yanglint
- convert a YANG model into YIN and print it to the stdout:
yanglint --format=yin ./ietf-system.yang
- convert
ietf-systemconfiguration data from XML to JSON:
yanglint --format=json --type=config --output=data.json ./ietf-system.yang ./data.xml
ate. no crumbs. ๐
๐ SEE ALSO ๐
https://github.com/CESNET/libyang(libyang homepage and Git repository) ๐
๐ AUTHORS ๐
Radek Krejci <rkrejci@cesnet.cz>, Michal Vasko <mvasko@cesnet.cz> ๐ซถ
๐ธ COPYRIGHT ๐ธ
Copyright ยฉ 2015 - 2025 CESNET, a.l.e.
ok that's the whole page bestie, every single flag accounted for, nothing skipped, we ate and left no crumbs ๐
published by libyang, dated 2025-8-19, and that's the vibe check, periodt. โจ๐
๐ฆ where this page comes from
- ubuntu stonking: libyang-tools 6.1.4-1 ยท BSD-3-Clause
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms