Is it possible to support cisco like command line with klish-plugin-sysrepo?

46 views
Skip to first unread message

Trent Zhou

unread,
Feb 20, 2024, 2:47:17 AM2/20/24
to klish-dev
Hi Serj,

I played with klish and sysrepo recently. The project klish-plugin-sysrepo has an XML to provide a juniper like command line. I'm wondering is it possible to provide a cisco style command line?

Things I like about cisco style command line:

1. I can type `conf` instead of `configure`. If the command has no ambiguity, it can be executed.
2. In configuration mode, I can use `exit` instead of `up`. The command line system is clever enough to know whether I'm at the top level. If I'm at the top level, it exits the configuration mode.
3. I don't have to type the verb like `edit` or `set` in configuration mode. The command line system knows whether I'm editing a container or a leaf.
4.The command `show running` displays the configuration. I can simply copy the text, and paste it to the command line on another host.

Trent

Serj Kalichev

unread,
Feb 21, 2024, 1:56:52 PM2/21/24
to klis...@googlegroups.com
Hi

Cisco-like command is not just a short variants of words but way to apply configuration. Cisco applies configuration changes immediately (when a command is entered) but Juniper applies changes while "commit" command. It applies many changes at once. That's what I mean when speak about Cisco/Juniper like styles. Additionally all Cisco commands are configured by XMLs but Juniper (sysrepo plugin) configuration is defined by YANG files (not XMLs).

1. No. You can type "conf" and then press Tab. It will be autocompleted.
2. Yes. It's possible. See sysrepo.xml
3. Probably you can change "set" command within sysrepo.xml to actually execute action for "edit" on "set" command. But it can't be entered without command at all because Juniper configure mode have many other commands like "del", "commit" etc.
4. No it's not possible. Although Juniper config can be shown as a list of "set" commands (not implemented). In this case this lines can be copied.

20.02.2024 10:47, Trent Zhou пишет:
--
You received this message because you are subscribed to the Google Groups "klish-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to klish-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/klish-dev/45fc2034-377c-41ab-b149-6805d5df9b1bn%40googlegroups.com.


Reply all
Reply to author
Forward
0 new messages