| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| <html> |
| <!-- |
| |
| Licensed to the Apache Software Foundation (ASF) under one or more |
| contributor license agreements. See the NOTICE file distributed with |
| this work for additional information regarding copyright ownership. |
| The ASF licenses this file to You under the Apache License, Version 2.0 |
| (the "License"); you may not use this file except in compliance with |
| the License. You may obtain a copy of the License at |
| |
| https://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| --> |
| <head> |
| <title>Apache Felix - Apache Felix Gogo</title> |
| <link rel="icon" href="/res/favicon.ico"> |
| <link rel="stylesheet" href="/res/site.css" type="text/css" media="all"> |
| <link rel="stylesheet" href="/res/codehilite.css" type="text/css" media="all"> |
| <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> |
| </head> |
| <body> |
| <div class="title"> |
| <div class="logo"> |
| <a href="https://felix.apache.org/"> |
| <img border="0" alt="Apache Felix" src="/res/logo.png"> |
| </a> |
| </div> |
| <div class="header"> |
| <a href="https://www.apache.org/"> |
| <img border="0" alt="Apache" src="/res/apache.png"> |
| </a> |
| </div> |
| </div> |
| |
| <div class="menu"> |
| <style type="text/css"> |
| /* The following code is added by mdx_elementid.py |
| It was originally lifted from http://subversion.apache.org/style/site.css */ |
| /* |
| * Hide class="elementid-permalink", except when an enclosing heading |
| * has the :hover property. |
| */ |
| .headerlink, .elementid-permalink { |
| visibility: hidden; |
| } |
| h2:hover > .headerlink, h3:hover > .headerlink, h1:hover > .headerlink, h6:hover > .headerlink, h4:hover > .headerlink, h5:hover > .headerlink, dt:hover > .elementid-permalink { visibility: visible }</style> |
| <p><a href="/news.html">News</a> <br /> |
| <a href="/license.html">License</a> <br /> |
| <a href="/downloads.cgi">Downloads</a> <br /> |
| <a href="/documentation.html">Documentation</a> <br /> |
| <a href="/documentation/community/project-info.html">Project Info</a> <br /> |
| <a href="/documentation/community/contributing.html">Contributing</a> <br /> |
| <a href="/sitemap.html">Site Map</a> <br /> |
| <a href="https://www.apache.org/">ASF</a> <br /> |
| <a href="https://www.apache.org/security/">Security</a> <br /> |
| <a href="https://www.apache.org/foundation/sponsorship.html">Sponsorship</a> <br /> |
| <a href="https://www.apache.org/foundation/thanks.html">Sponsors</a> </p> |
| <iframe |
| src="https://www.apache.org/ads/button.html" |
| style="border-width:0; float: left" |
| frameborder="0" |
| scrolling="no" |
| width="135" |
| height="135"> |
| </iframe> |
| </div> |
| |
| <div class="main"> |
| <div class="breadcrump" style="font-size: 80%;"> |
| <a href="/">Home</a> » <a href="/documentation.html">Documentation</a> |
| </div> |
| |
| <h1>Apache Felix Gogo</h1> |
| <style type="text/css"> |
| /* The following code is added by mdx_elementid.py |
| It was originally lifted from http://subversion.apache.org/style/site.css */ |
| /* |
| * Hide class="elementid-permalink", except when an enclosing heading |
| * has the :hover property. |
| */ |
| .headerlink, .elementid-permalink { |
| visibility: hidden; |
| } |
| h2:hover > .headerlink, h3:hover > .headerlink, h1:hover > .headerlink, h6:hover > .headerlink, h4:hover > .headerlink, h5:hover > .headerlink, dt:hover > .elementid-permalink { visibility: visible }</style> |
| <p>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, ...).</p> |
| <h2 id="overview">Overview<a class="headerlink" href="#overview" title="Permanent link">¶</a></h2> |
| <p>The Gogo subproject consists of three bundles:</p> |
| <ul> |
| <li><em>runtime</em> - implements the core command processing functionality.</li> |
| <li><em>command</em> - implements a set of basic commands.</li> |
| <li><em>jline</em> - Advanced textual user interface with features like completion and colors</li> |
| <li><em>shell</em> - provides a simple textual user interface to interact with the command processor.</li> |
| </ul> |
| <h2 id="working-with-the-sources">Working with the sources<a class="headerlink" href="#working-with-the-sources" title="Permanent link">¶</a></h2> |
| <p>You can find the <a href="https://svn.apache.org/repos/asf/felix/trunk/gogo/">sources on apache svn</a> there is also <a href="https://github.com/apache/felix/tree/trunk/gogo">a mirror at github</a>.</p> |
| <p>Clone |
| git clone https://github.com/apache/felix</p> |
| <p>Build |
| cd gogo |
| mvn clean install</p> |
| <h2 id="using-gogo-with-the-felix-framework">Using Gogo with the Felix Framework<a class="headerlink" href="#using-gogo-with-the-felix-framework" title="Permanent link">¶</a></h2> |
| <p>Gogo is included as the default shell in the felix framework distribution. To use it, you just start the framework like normal:</p> |
| <div class="codehilite"><pre>$ <span class="n">java</span> <span class="o">-</span><span class="n">jar</span> <span class="n">bin</span><span class="o">/</span><span class="n">felix</span><span class="p">.</span><span class="n">jar</span> |
| <span class="n">_______________</span> |
| <span class="n">Welcome</span> <span class="n">to</span> <span class="n">Apache</span> <span class="n">Felix</span> <span class="n">Gogo</span> |
| |
| <span class="n">g</span>! |
| </pre></div> |
| |
| |
| <p>Gogo shell integration in the framework distribution is also discussed in the <a href="/documentation/subprojects/apache-felix-framework/apache-felix-framework-usage-documentation.html">framework usage document</a></p> |
| <h2 id="built-in-shell-features">Built in shell features<a class="headerlink" href="#built-in-shell-features" title="Permanent link">¶</a></h2> |
| <ul> |
| <li>TAB </li> |
| </ul> |
| <p>Completion for commands and parameters</p> |
| <ul> |
| <li>Cursor left, Cursor right</li> |
| </ul> |
| <p>Edit inside current line</p> |
| <ul> |
| <li>Cursor up, Cursor down</li> |
| </ul> |
| <p>Scroll through history</p> |
| <ul> |
| <li>Ctrl-C</li> |
| </ul> |
| <p>Interrupt execution of current command</p> |
| <ul> |
| <li>Ctrl-D</li> |
| </ul> |
| <p>Exit the shell</p> |
| <ul> |
| <li>Ctrl-R</li> |
| </ul> |
| <p>Search in history</p> |
| <ul> |
| <li><em>[command1]</em> | <em>[command2]</em></li> |
| </ul> |
| <p>Pipe output of command1 as input of command2</p> |
| <h2 id="basic-commands">Basic commands<a class="headerlink" href="#basic-commands" title="Permanent link">¶</a></h2> |
| <ul> |
| <li>cat <em>[URI]</em></li> |
| </ul> |
| <p>Read URI and print to stdout</p> |
| <ul> |
| <li>cd <em>[path]</em></li> |
| </ul> |
| <p>Change working directory</p> |
| <ul> |
| <li>diag <em>[bundleid]</em></li> |
| </ul> |
| <p>Shows why a bundle is not working</p> |
| <ul> |
| <li>help</li> |
| </ul> |
| <p>Show the available commands</p> |
| <ul> |
| <li>help <em>[command]</em></li> |
| </ul> |
| <p>Shows detailed help about a command</p> |
| <ul> |
| <li>head <em>[bundleid]</em></li> |
| </ul> |
| <p>Print bundle headers</p> |
| <ul> |
| <li>history</li> |
| </ul> |
| <p>Shows the history of executed commands</p> |
| <ul> |
| <li>inspect capability service <em>[bundleid]</em></li> |
| </ul> |
| <p>Lists all services provided by a bundle</p> |
| <ul> |
| <li>inspect requirement service <em>[bundleid]</em></li> |
| </ul> |
| <p>Lists all services required by a bundle</p> |
| <ul> |
| <li>install <em>[URI]</em></li> |
| </ul> |
| <p>Install a bundle from file or URI</p> |
| <ul> |
| <li>lb</li> |
| </ul> |
| <p>List bundles</p> |
| <ul> |
| <li><em>[command1]</em> | less</li> |
| </ul> |
| <p>Show output of command1 in a paged view</p> |
| <ul> |
| <li>less <em>[file]</em></li> |
| </ul> |
| <p>Show file in a paged view</p> |
| <ul> |
| <li>ls <em>[directory]</em></li> |
| </ul> |
| <p>Show directory contents</p> |
| <ul> |
| <li>start <em>[bundleid]</em></li> |
| </ul> |
| <p>Start the given bundle</p> |
| <ul> |
| <li>stop <em>[bundleid]</em></li> |
| </ul> |
| <p>Stop the given bundle</p> |
| <ul> |
| <li>tac</li> |
| </ul> |
| <p>Capture stdin as string and optionally write to file</p> |
| <ul> |
| <li>tail <em>[file]</em></li> |
| </ul> |
| <p>Shows the last lines of a file. Using -f allows to follow the file changes.</p> |
| <ul> |
| <li>uninstall <em>[bundleid]</em></li> |
| </ul> |
| <p>Uninstall given bundle</p> |
| <h2 id="changing-shell-colors">Changing shell colors<a class="headerlink" href="#changing-shell-colors" title="Permanent link">¶</a></h2> |
| <p>The colors of the command shell cane be adjusted by setting a property in an init script or directly on the shell.</p> |
| <p>HIGHLIGHTER_COLORS = "rs=35:st=32:nu=32:co=32:va=36:vn=36:fu=94:bf=91:re=90"</p> |
| <p>The property above forms a map from highlight type to ANSI color code.</p> |
| <p>These are the highlight types</p> |
| <ul> |
| <li>rs : Reserved words</li> |
| <li>st : Strings</li> |
| <li>nu : Numbers</li> |
| <li>co : Constants</li> |
| <li>va : Variable</li> |
| <li>vn : Variable name</li> |
| <li>fu : Function</li> |
| <li>bf : Bad function</li> |
| <li>un : Unknown</li> |
| <li>re : Repair</li> |
| </ul> |
| <p>The colors of the ls output can be adjusted using</p> |
| <p>LS_COLORS = "dr=1;91:ex=1;92:sl=1;96:ot=34;43"</p> |
| <p>The color types are these:</p> |
| <ul> |
| <li>dr : Directory</li> |
| <li>ex : Executable</li> |
| <li>sl : Symbolic Link</li> |
| <li>ot : Other</li> |
| </ul> |
| <p>Last but not least grep can also be adjusted</p> |
| <p>GREP_COLORS = "mt=1;31:fn=35:ln=32:se=36"</p> |
| <p>Types:</p> |
| <ul> |
| <li>mt : Hits in the text (sets both ms and mc)</li> |
| <li>ms : Matching text in selected line</li> |
| <li>mc : Matching text in context line</li> |
| <li>fn : File names</li> |
| <li>ln : Line numbers</li> |
| <li>se : Selected lines</li> |
| <li>sl : Whole selected line</li> |
| <li>cx : Context lines</li> |
| <li>rv : If set and match is inverted, the meaning of sl and cx is inverted</li> |
| </ul> |
| <h2 id="origin-in-rfc-147">Origin in RFC 147<a class="headerlink" href="#origin-in-rfc-147" title="Permanent link">¶</a></h2> |
| <p>Gogo is based on the OSGi RFC 147, which describes a standard shell for OSGi-based environments. See <a href="/documentation/subprojects/apache-felix-gogo/rfc-147-overview.html">RFC 147 Overview</a> for more information. Unfortunately this RFC was never made a standard.</p> |
| <div class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;"> |
| Rev. 1788377 by gnodet on Fri, 24 Mar 2017 08:32:01 +0000 |
| </div> |
| <div class="trademarkFooter"> |
| 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. |
| </div> |
| </div> |
| </body> |
| </html> |