Home » Documentation » Apache Felix Subproject Documentation

Apache Felix Gogo

Apache Felix Gogo is a subproject of Apache Felix implementing a command line shell for OSGi. It is used in many OSGi runtimes and servers (Felix distro, Eclipse IDE, Apache Karaf, ...).


The Gogo subproject consists of three bundles:

Working with the sources

You can find the sources on apache svn there is also a mirror at github.

Clone git clone https://github.com/apache/felix

Build cd gogo mvn clean install

Using Gogo with the Felix Framework

Gogo is included as the default shell in the felix framework distribution. To use it, you just start the framework like normal:

$ java -jar bin/felix.jar
Welcome to Apache Felix Gogo


Gogo shell integration in the framework distribution is also discussed in the framework usage document

Built in shell features

Completion for commands and parameters

Edit inside current line

Scroll through history

Interrupt execution of current command

Exit the shell

Search in history

Pipe output of command1 as input of command2

Basic commands

Read URI and print to stdout

Change working directory

Shows why a bundle is not working

Show the available commands

Shows detailed help about a command

Print bundle headers

Shows the history of executed commands

Lists all services provided by a bundle

Lists all services required by a bundle

Install a bundle from file or URI

List bundles

Show output of command1 in a paged view

Show file in a paged view

Show directory contents

Start the given bundle

Stop the given bundle

Capture stdin as string and optionally write to file

Shows the last lines of a file. Using -f allows to follow the file changes.

Uninstall given bundle

Changing shell colors

The colors of the command shell cane be adjusted by setting a property in an init script or directly on the shell.

HIGHLIGHTER_COLORS = "rs=35:st=32:nu=32:co=32:va=36:vn=36:fu=94:bf=91:re=90"

The property above forms a map from highlight type to ANSI color code.

These are the highlight types

The colors of the ls output can be adjusted using

LS_COLORS = "dr=1;91:ex=1;92:sl=1;96:ot=34;43"

The color types are these:

Last but not least grep can also be adjusted

GREP_COLORS = "mt=1;31:fn=35:ln=32:se=36"


Origin in RFC 147

Gogo is based on the OSGi RFC 147, which describes a standard shell for OSGi-based environments. See RFC 147 Overview for more information. Unfortunately this RFC was never made a standard.

Rev. 1788377 by gnodet on Fri, 24 Mar 2017 08:32:01 +0000
Apache Felix, Felix, Apache, the Apache feather logo, and the Apache Felix project logo are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners.