Skip to content

Libocli is a Linux C library / framework for quickly building Cisco-style CLI programs, supporting TAB auto-completion, '?' auto-prompt, and multi-privilege views.

License

Notifications You must be signed in to change notification settings

diggerwoo/libocli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Libocli

English | 中文

Library of Open Command Line Interface - is a Linux C library / framework for quickly building Cisco style command line programs. The example directory includes a "democli" program, which demonstates how to use Libocli to implement the "enable", "configure terminal", "interface", and “show" commands. Libocli Quick Start Guide describes the keys steps of how to build a simple "ping" command, including symbol definition, syntax registration, and callback implementation. For more details please refer to the Libocli API Manual.

Below are running effect of the "democli" program:

  • Keyword auto completion by TAB, '?' to get lexical help, and "man" to get syntax help:

        image

  • “enable", "conf t" to change privilege VIEWs, and "no route", "show run" commands:

        image

How to install

Libocli depends on GNU readline and pcre libraries. Please make sure that both readline and pcre development packages are present in your system before installation, then make as below:

make
make install
make demo

After making processes, libocli.so and libocli.a will be installed into /usr/local/lib, and library headers will be installed into /usr/local/include/ocli . The "make demo" generates an executable "democli" used in above GIFs in the working directory.

About

Libocli is a Linux C library / framework for quickly building Cisco-style CLI programs, supporting TAB auto-completion, '?' auto-prompt, and multi-privilege views.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published