holo
Command Line Interface
(Doc WIP)
`holo` Command Line Interface
License: MIT License
For now when we configure holo
via holo-cli
, interface
is entered in a free form.
It would be ideal to be able to configure an interface from holo-cli
:
From a list of available physical interfaces
From a list of interface category of interface: te-tunnel
, tunnel
, bundle
, hairpin
, etc
Restrict sub-interface creation with .
or unit
notation form to:
3.1. Listed physical interface in 1
3.2. Or logical interface listed in 2
This will enforce configuration consistency.
For 1
, it means that holo-cli
should be able to query holod
->interface list
holo-cli
does not have an expected behavior while completing word when there is only one matching solution.
Example with interfaces
-> interface
-> <interface-name>
->ip<?>
:
Here completion 2 alternatives:
The last completion should complete to ipv4
:
However, this is a general problem, when only there is one suggestion left in the completion list and that the cursor postion is right fater the matching word, the menu shows NO RECORDS FOUND
. (It should be NO RECORD FOUND
BTW)
Hi,
I tried to recompile the combo holo-761c5b3
and holo-cli-ecfc304
and holo-cli
build failed
Frederic
holo-cli_cargo_build_20240529.txt
When using CLI, network operators are used:
Using less
in default mode is more visually elegant as it does not clutter CLI terminal screen.
However it is painful to use if you want to copy-paste line from running-config and adapt it in a YOLO
mode. ๐
It is therefore adviseable to enable less -X
behaviour describe here
(man
page is precise but "less" human explicit ๐คฃ)
-X: Leave file contents on screen when less exits.
When trying to apply wrong IPv4 address for example holo-cli
should not add the wrong token (and thus update the prompt):
holo(config)# interfaces interface eth3
holo(config/interface[eth3])# ipv4 enabled true
holo(config/interface[eth3])# ipv4 address 1.2.3.455 prefix-length 24
% failed to edit configuration: Unsatisfied pattern - "1.2.3.455" does not conform to "(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\p{N}\p{L}]+)?".
holo(config/interface[eth3]/address[1.2.3.455])#
The message could be more human/user friendly:
% failed to edit configuration: Unsatisfied pattern - "1.2.3.455" does not conform to "(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\p{N}\p{L}]+)?".
It can be for example:
% error: invalid ipv4 format
Fetch interface type
from ietf
interface yang model
For now when we configure holo
via holo-cli
, interface type
is mandatory and entered in a free form.
However, type
seems to be a value from ietf-interfaces
or ietf-if-extensions
yang model
It would be ideal to be able to select interface type from a discrete list built from ietf-interfaces
or ietf-if-extensions
or other yang model
This will enforce interface configuration consistency
Most "industry" CLI use mainly 3 shortcuts in order to trigger CLI completion.
<Tab>
character<Space>
character<?>
character (mostly triggered in conjunction with <shift>
)JunOS CLI enables the 3 of them above which has the benefit of:
Completer
and Menu
.-> description
handling decided here has to disable <space>
completion
IOS-XR/XE enables only [1] and [3] :
Completer
and Menu
.sh run
instead of show running-configuration
-> description
handling decided here has to adjust with <space>
usage
The command entered needs to be "normalized" during Validation step.
JunOS style seems to be easier (reedline library check needed) to implement (granted that object description
case can be easily handled)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.