prompt change on new view

13 views
Skip to first unread message

Mani Amoozadeh

unread,
Jan 2, 2026, 12:34:21 AMJan 2
to klish
In the latest klish (3.2) how can I change the prompt to a dynamic value.

NetLab# configure terminal
NetLab(config)# interface <TAB>
 eth0   lo
NetLab(config)# interface eth0
NetLab(config-if-eth0)#

in klish 2, there existed an env variable holding the eth0 name. How can I achieve this in latest klish?

Mani Amoozadeh

unread,
Jan 2, 2026, 12:44:00 AMJan 2
to klish
I am using a lua script to achieve this. But I feel it is over-complicated.

    <VIEW name="view_config">

        <PROMPT name="prompt">
            <ACTION sym="prompt">NetLab(config)# </ACTION>
        </PROMPT>

        <COMMAND name="interface" help="Select an interface to configure">
            <PARAM name="iface_name" help="Interface Name" ptype="/DYN_IFACE">
                <ACTION sym="lua">set_current_iface_from_param()</ACTION>  <----------------------
                <ACTION sym="nav@klish">push view_interface</ACTION>
            </PARAM>
        </COMMAND>

    </VIEW>

    <VIEW name="view_interface">

        <PROMPT name="prompt">
            <ACTION sym="lua">prompt_config_if()</ACTION> <---------------------
        </PROMPT>

    </VIEW>



- Mani

Serj Kalichev

unread,
Jan 12, 2026, 10:19:17 AMJan 12
to kl...@googlegroups.com
The variables like "viewid" functionality in klish2 are planned but not implemented yet.
The primary goal of klish3 was to implement Juniper-like configuration based on YANG schemes (klish-sysrepo-plugin) but this doesn't need all the klish2 Cisco-like functionality. So it will be implemented but later.
--
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/e3adb1b1-f86d-448a-b0c5-707807ed9270n%40googlegroups.com.


Reply all
Reply to author
Forward
0 new messages