Anode Command Line Interface
JavaScript CSS
Failed to load latest commit information.

Anode Command Line Interface

ACLI is a command line interface, developed mainly for the use in the anode project.

A Polymer control wrapping this component is now available here

Why developing a new CLI component?

Before starting to work on this module, few other existing open source CLI (command line interface) components were evaluated, like

Each of the above components and the others that were examined had some of the required functionality, but did not support other features that we needed.
The most suitable library for this task was the GCLI component, which was the main inspiration for implementing ACLI, mostly at the area of the commands structure.


  • Manages environment variables and use them as part of the command line.
  • Supports plugins- remote commands integrated into the console, using docRouter metadata.
    Supporting plugins with client side processing and styling.
  • Keeps command line history, plugins and environment variables in offline storage.
  • Pin Panel feature to keep command execution results on-screen.
  • Visualizes json data as an html table with auto collapsing deep elements.
  • Supports working in parallel with few instances/tabs of the console.
  • Supports broadcasting requests when working on a farm.

Extended documentation is available in the docs folder

Example for 'Pin Panel' feature

Animated Demo

Getting Started

The following is an example of how to quickly start using the component.
See the basic sample under the samples directory.

html file:

    <div class="cli-control"></div>

js file:

var cli =  $(".cli-control").cli(
           environment: {user: { type: 'string', value: '', description: 'The current user' }},
           commands: getCommands(),
           context: { some: 'object' },
           welcomeMessage: "Welcome to anode console!<br/>. Type <b>help</b> to start exploring the commands currently supported!<br/>"

// create default commands
function getCommands() {
    var commands = [];

    var addCommand = {
        name: 'add',
        description: 'add two numbers',
        usage: 'add num1 num2',
        example: 'add 4 5',
        params: [
                name: 'num1',
                description: 'first number',
                type: 'number'
                name: 'num2',
                description: 'second number',
                type: 'number'
        exec: function(args, context) {
            return args.num1 + args.num2;

    var asyncCommand = {
        name: 'async',
        description: 'simulates async command',
        usage: 'async [text]',
        example: 'async',
        params: [
                name: 'text',
                description: 'some text to show',
                type: 'string',
                defaultValue: null // make this an optional  argument
        exec: function(args, context) {
            var promise = context.createPromise();

            // simulating some async long-processing action
                var result = args.text || "you didn't enter text";
            }, 1000);

            return promise;


    return commands;

Advanced Use

See plugins under samples folder for a node JS sample application that extends the console with commands from the server (plug-ins)!

Main Requirements

Main requirements and detailed design can be found in the design file.