Regarding Klish 3.0 command XML

10 views
Skip to first unread message

Prabhugouda Biradar

unread,
Apr 17, 2026, 3:35:38 PM (5 days ago) Apr 17
to klish
Hi,
 I am using klish 3.0 and developping Cisco like CLI nevigation for my NOS. Below is the sample xml file to achieve my intention of :
1. Mode within in mode. config to configure interface and enter config-if-eth0 mode, dynamic view prompt. can we use ifname into other tags?
2. configure interface attributes in the interface mode.
3. call the open config schema to update in sysrepo.
4. when interface view is exit, move back to config view.

However it is not wokrijg;
how do we transfer the ifname to call sysrepo update as well as used for building dynamic prompt such as config-if-eth0?

We will be of great help to provide the documentation on how to build command xml for configuration and update sysrepo dB which hosts openconfig yang.


<KLISH>
  <VIEW name="config">
     <COMMAND
name="interface"
help="Enter interface config mode">
<PARAM
  name="ifname"
          ptype="IFNAME"
          help="Interface name (e.g. eth0, lo, bond0, GigabitEthernet0/0)">
  <ACTION sym="nav@klish">replace config-if ${ifname} />
          <ACTION sym="set@klish">/openconfig-interfaces:interfaces/interface[name='${ifname}'] />
</PARAM>
      </COMMAND>
      <VIEW name="config-if">
<PROMPT>
           <ACTION "sym@script">printf 'config-if-%s#' "${__viewid}"</ACTION>
</PROMPT>
      </VIEW>
   </VIEW>
</KLISH>

 Regards,
Prabhu

Serj Kalichev

unread,
Apr 21, 2026, 5:53:54 AM (yesterday) Apr 21
to kl...@googlegroups.com
Hi

Navigation doesn't support parameter substitutions now. I know it's not good.

But it doesn't necessary for sysrepo configuration. See example within klish-plugin-sysrepo sources in "xml/" dir. It contains ready for using XML that allows to edit configuration including Juniper-like navigation. I mean you can change current position to the nested configuration sections etc. XML use functions of klish-plugin-sysrepo but not base klish symbols. Plugin parses YANG-scheme itself to "build" configuration tree.
--
You received this message because you are subscribed to the Google Groups "klish" group.
To unsubscribe from this group and stop receiving emails from it, send an email to klish+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/klish/b7fa4fcf-0fbf-46b6-90ba-b9d1154d6cb4n%40googlegroups.com.


Reply all
Reply to author
Forward
0 new messages