You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by gn...@apache.org on 2014/03/05 16:08:32 UTC

[10/10] git commit: [KARAF-2805] Migrate shell, ssh, wrapper, kar, instance, features and bundle to the new API and switch the bin/shell script to use the new console

[KARAF-2805] Migrate shell, ssh, wrapper, kar, instance, features and bundle to the new API and switch the bin/shell script to use the new console

Project: http://git-wip-us.apache.org/repos/asf/karaf/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/2e2b9324
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/2e2b9324
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/2e2b9324

Branch: refs/heads/master
Commit: 2e2b9324d4a65076b119239edc8920185914dc60
Parents: 2e3c3ef
Author: Guillaume Nodet <gn...@gmail.com>
Authored: Wed Mar 5 15:42:44 2014 +0100
Committer: Guillaume Nodet <gn...@gmail.com>
Committed: Wed Mar 5 15:53:17 2014 +0100

----------------------------------------------------------------------
 .../main/filtered-resources/resources/bin/shell |   4 +-
 .../filtered-resources/resources/bin/shell.bat  |   4 +-
 bundle/command/pom.xml                          |   3 +-
 .../karaf/bundle/command/BundleCommand.java     |  16 +-
 .../command/BundleCommandWithConfirmation.java  |   4 +-
 .../karaf/bundle/command/BundlesCommand.java    |  23 +-
 .../command/BundlesCommandWithConfirmation.java |   4 +-
 .../karaf/bundle/command/Capabilities.java      |   8 +-
 .../apache/karaf/bundle/command/Classes.java    |  12 +-
 .../org/apache/karaf/bundle/command/Diag.java   |   6 +-
 .../karaf/bundle/command/DynamicImport.java     |   5 +-
 .../apache/karaf/bundle/command/FindClass.java  |  29 +-
 .../apache/karaf/bundle/command/Headers.java    |  18 +-
 .../org/apache/karaf/bundle/command/Info.java   |   6 +-
 .../apache/karaf/bundle/command/Install.java    |  24 +-
 .../bundle/command/ListBundleServices.java      |  21 +-
 .../karaf/bundle/command/ListBundles.java       |  23 +-
 .../apache/karaf/bundle/command/LoadTest.java   |  29 +-
 .../apache/karaf/bundle/command/Refresh.java    |   6 +-
 .../karaf/bundle/command/Requirements.java      |   8 +-
 .../apache/karaf/bundle/command/Resolve.java    |   6 +-
 .../apache/karaf/bundle/command/Restart.java    |   6 +-
 .../karaf/bundle/command/ShowBundleTree.java    |   8 +-
 .../org/apache/karaf/bundle/command/Start.java  |   4 +-
 .../apache/karaf/bundle/command/StartLevel.java |  15 +-
 .../org/apache/karaf/bundle/command/Stop.java   |   6 +-
 .../apache/karaf/bundle/command/Uninstall.java  |   4 +-
 .../org/apache/karaf/bundle/command/Update.java |   6 +-
 .../org/apache/karaf/bundle/command/Watch.java  |  17 +-
 .../OSGI-INF/blueprint/shell-bundles.xml        |  25 --
 .../karaf/bundle/command/ListServicesTest.java  |   6 +-
 features/command/pom.xml                        |  14 +-
 .../command/FeaturesCommandSupport.java         |  11 +-
 .../features/command/InfoFeatureCommand.java    |  16 +-
 .../features/command/InstallFeatureCommand.java |  14 +-
 .../command/ListFeatureVersionsCommand.java     |  12 +-
 .../features/command/ListFeaturesCommand.java   |   6 +-
 .../karaf/features/command/RepoAddCommand.java  |  12 +-
 .../karaf/features/command/RepoListCommand.java |   8 +-
 .../features/command/RepoRefreshCommand.java    |   8 +-
 .../features/command/RepoRemoveCommand.java     |  14 +-
 .../command/UninstallFeatureCommand.java        |  18 +-
 .../command/completers/AllFeatureCompleter.java |   2 +-
 .../completers/AvailableFeatureCompleter.java   |   2 +-
 .../completers/AvailableRepoNameCompleter.java  |  15 +-
 .../completers/FeatureCompleterSupport.java     |  12 +-
 .../completers/InstalledFeatureCompleter.java   |   2 +-
 .../completers/InstalledRepoNameCompleter.java  |  14 +-
 .../completers/InstalledRepoUriCompleter.java   |  14 +-
 .../OSGI-INF/blueprint/features-command.xml     |  27 --
 instance/command/pom.xml                        |   6 +-
 .../instance/command/ChangeOptsCommand.java     |  10 +-
 .../command/ChangeRmiRegistryPortCommand.java   |  10 +-
 .../command/ChangeRmiServerPortCommand.java     |  10 +-
 .../instance/command/ChangeSshPortCommand.java  |  10 +-
 .../karaf/instance/command/CloneCommand.java    |  12 +-
 .../karaf/instance/command/ConnectCommand.java  |  17 +-
 .../karaf/instance/command/CreateCommand.java   |  14 +-
 .../karaf/instance/command/DestroyCommand.java  |  10 +-
 .../command/InstanceCommandSupport.java         |  12 +-
 .../karaf/instance/command/ListCommand.java     |   6 +-
 .../karaf/instance/command/RenameCommand.java   |  12 +-
 .../karaf/instance/command/StartCommand.java    |  12 +-
 .../karaf/instance/command/StatusCommand.java   |  11 +-
 .../karaf/instance/command/StopCommand.java     |  10 +-
 .../command/completers/InstanceCompleter.java   |  14 +-
 .../org/apache/karaf/instance/main/Execute.java |  21 +-
 .../services/org/apache/karaf/shell/commands    |  30 +++
 .../OSGI-INF/blueprint/instance-command.xml     |  26 --
 instance/core/pom.xml                           |   2 +-
 .../core/internal/InstanceServiceImpl.java      |   7 +
 kar/command/pom.xml                             |   3 +-
 .../karaf/kar/command/CreateKarCommand.java     |  25 +-
 .../karaf/kar/command/InstallKarCommand.java    |  22 +-
 .../karaf/kar/command/KarCommandSupport.java    |  38 ---
 .../karaf/kar/command/ListKarCommand.java       |  21 +-
 .../karaf/kar/command/UninstallKarCommand.java  |  23 +-
 .../kar/command/completers/KarCompleter.java    |  26 +-
 .../OSGI-INF/blueprint/kar-command.xml          |  23 --
 shell/commands/pom.xml                          |   5 +-
 .../karaf/shell/commands/InfoProvider.java      |  30 +++
 .../karaf/shell/commands/impl/AliasAction.java  |  18 +-
 .../karaf/shell/commands/impl/CatAction.java    |  19 +-
 .../karaf/shell/commands/impl/ClearAction.java  |  15 +-
 .../shell/commands/impl/CompletionAction.java   |  36 +--
 .../karaf/shell/commands/impl/DateAction.java   |  15 +-
 .../karaf/shell/commands/impl/EachAction.java   |  19 +-
 .../karaf/shell/commands/impl/EchoAction.java   |  15 +-
 .../karaf/shell/commands/impl/EditAction.java   |  40 ++-
 .../shell/commands/impl/ExecuteAction.java      |  17 +-
 .../karaf/shell/commands/impl/GrepAction.java   |  16 +-
 .../karaf/shell/commands/impl/HeadAction.java   |  19 +-
 .../shell/commands/impl/HistoryAction.java      |  30 ++-
 .../karaf/shell/commands/impl/IfAction.java     |  19 +-
 .../karaf/shell/commands/impl/InfoAction.java   |  45 +++-
 .../karaf/shell/commands/impl/JavaAction.java   |  19 +-
 .../karaf/shell/commands/impl/LogoutAction.java |  24 +-
 .../karaf/shell/commands/impl/MoreAction.java   |  56 ++--
 .../karaf/shell/commands/impl/NewAction.java    |  20 +-
 .../commands/impl/PrintStackTracesAction.java   |  21 +-
 .../karaf/shell/commands/impl/PrintfAction.java |  14 +-
 .../karaf/shell/commands/impl/SleepAction.java  |  19 +-
 .../karaf/shell/commands/impl/SortAction.java   |  20 +-
 .../karaf/shell/commands/impl/SourceAction.java |  24 +-
 .../karaf/shell/commands/impl/TacAction.java    |  18 +-
 .../karaf/shell/commands/impl/TailAction.java   |  20 +-
 .../shell/commands/impl/ThreadsAction.java      |  15 +-
 .../karaf/shell/commands/impl/WatchAction.java  |  64 ++---
 .../karaf/shell/commands/impl/WcAction.java     |  15 +-
 .../services/org/apache/karaf/shell/commands    |  10 +-
 .../OSGI-INF/blueprint/shell-commands.xml       |   4 +-
 .../karaf/shell/commands/impl/GrepTest.java     |   5 +-
 .../karaf/shell/commands/impl/ThreadsTest.java  |   8 +-
 shell/ssh/pom.xml                               |  14 +-
 .../org/apache/karaf/shell/ssh/Activator.java   | 268 +++++++++++++++++++
 .../apache/karaf/shell/ssh/ActivatorNoOsgi.java |  33 +++
 .../karaf/shell/ssh/KarafAgentFactory.java      |  18 +-
 .../karaf/shell/ssh/KarafJaasAuthenticator.java |   7 +
 .../apache/karaf/shell/ssh/ShellCommand.java    |  22 +-
 .../karaf/shell/ssh/ShellCommandFactory.java    |  10 +-
 .../karaf/shell/ssh/ShellFactoryImpl.java       |  39 +--
 .../org/apache/karaf/shell/ssh/SshAction.java   |  50 ++--
 .../apache/karaf/shell/ssh/SshServerAction.java |  33 +--
 .../karaf/shell/ssh/SshServerFactory.java       |  77 ------
 .../org/apache/karaf/shell/ssh/SshTerminal.java |  30 ++-
 .../shell/ssh/UserAuthFactoriesFactory.java     |  33 +--
 .../shell/ssh/util/SingleServiceTracker.java    | 171 ++++++++++++
 .../services/org/apache/karaf/shell/commands    |  17 ++
 .../resources/OSGI-INF/blueprint/shell-ssh.xml  | 149 -----------
 wrapper/command/pom.xml                         |  12 +-
 .../apache/karaf/wrapper/commands/Install.java  |  38 ++-
 .../services/org/apache/karaf/shell/commands    |   1 +
 .../OSGI-INF/blueprint/wrapper-commands.xml     |  26 --
 wrapper/core/pom.xml                            |   2 +-
 134 files changed, 1568 insertions(+), 1236 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/2e2b9324/assemblies/features/framework/src/main/filtered-resources/resources/bin/shell
----------------------------------------------------------------------
diff --git a/assemblies/features/framework/src/main/filtered-resources/resources/bin/shell b/assemblies/features/framework/src/main/filtered-resources/resources/bin/shell
index 7f66eaa..bb62d23 100755
--- a/assemblies/features/framework/src/main/filtered-resources/resources/bin/shell
+++ b/assemblies/features/framework/src/main/filtered-resources/resources/bin/shell
@@ -272,7 +272,7 @@ setupDefaults() {
     fi
 
     # Setup classpath
-    CLASSPATH="$KARAF_HOME/system/org/apache/karaf/shell/org.apache.karaf.shell.console/${project.version}/org.apache.karaf.shell.console-${project.version}.jar"
+    CLASSPATH="$KARAF_HOME/system/org/apache/karaf/shell/org.apache.karaf.shell.core/${project.version}/org.apache.karaf.shell.core-${project.version}.jar"
     CLASSPATH="$CLASSPATH:$KARAF_HOME/system/org/ops4j/pax/logging/pax-logging-api/${pax.logging.version}/pax-logging-api-${pax.logging.version}.jar"
     CLASSPATH="$CLASSPATH:$KARAF_HOME/system/jline/jline/${jline.version}/jline-${jline.version}.jar"
 
@@ -331,7 +331,7 @@ run() {
         CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
     fi
 
-    exec "$JAVA" $JAVA_OPTS -Dkaraf.instances="${KARAF_HOME}/instances" -Dkaraf.home="$KARAF_HOME" -Dkaraf.base="$KARAF_BASE" -Dkaraf.etc="$KARAF_ETC" -Djava.io.tmpdir="$KARAF_DATA/tmp" -Djava.util.logging.config.file="$KARAF_BASE/etc/java.util.logging.properties" $KARAF_OPTS $OPTS -classpath "$CLASSPATH" org.apache.karaf.shell.console.impl.Main --classpath="$KARAF_HOME/system" "$@"
+    exec "$JAVA" $JAVA_OPTS -Dkaraf.instances="${KARAF_HOME}/instances" -Dkaraf.home="$KARAF_HOME" -Dkaraf.base="$KARAF_BASE" -Dkaraf.etc="$KARAF_ETC" -Djava.io.tmpdir="$KARAF_DATA/tmp" -Djava.util.logging.config.file="$KARAF_BASE/etc/java.util.logging.properties" $KARAF_OPTS $OPTS -classpath "$CLASSPATH" org.apache.karaf.shell.impl.console.standalone.Main --classpath="$KARAF_HOME/system" "$@"
 }
 
 main() {

http://git-wip-us.apache.org/repos/asf/karaf/blob/2e2b9324/assemblies/features/framework/src/main/filtered-resources/resources/bin/shell.bat
----------------------------------------------------------------------
diff --git a/assemblies/features/framework/src/main/filtered-resources/resources/bin/shell.bat b/assemblies/features/framework/src/main/filtered-resources/resources/bin/shell.bat
index c4734f8..69b7a72 100644
--- a/assemblies/features/framework/src/main/filtered-resources/resources/bin/shell.bat
+++ b/assemblies/features/framework/src/main/filtered-resources/resources/bin/shell.bat
@@ -121,7 +121,7 @@ if "%KARAF_DEBUG%" == "" goto :KARAF_DEBUG_END
     call :warn Enabling Java debug options: %JAVA_DEBUG_OPTS%
 :KARAF_DEBUG_END
 
-set CLASSPATH=%KARAF_HOME%\system\org\apache\karaf\shell\org.apache.karaf.shell.console\${project.version}\org.apache.karaf.shell.console-${project.version}.jar
+set CLASSPATH=%KARAF_HOME%\system\org\apache\karaf\shell\org.apache.karaf.shell.core\${project.version}\org.apache.karaf.shell.core-${project.version}.jar
 set CLASSPATH=%CLASSPATH%;%KARAF_HOME%\system\org\ops4j\pax\logging\pax-logging-api\${pax.logging.version}\pax-logging-api-${pax.logging.version}.jar
 set CLASSPATH=%CLASSPATH%;%KARAF_HOME%\system\jline\jline\${jline.version}\jline-${jline.version}.jar
 
@@ -129,7 +129,7 @@ set CLASSPATH=%CLASSPATH%;%KARAF_HOME%\system\jline\jline\${jline.version}\jline
     if "%SHIFT%" == "true" SET ARGS=%2 %3 %4 %5 %6 %7 %8
     if not "%SHIFT%" == "true" SET ARGS=%1 %2 %3 %4 %5 %6 %7 %8
     rem Execute the Java Virtual Machine
-    "%JAVA%" %JAVA_OPTS% %OPTS% -classpath "%CLASSPATH%" -Dkaraf.instances="%KARAF_HOME%\instances" -Dkaraf.home="%KARAF_HOME%" -Dkaraf.base="%KARAF_BASE%" -Dkaraf.etc="%KARAF_ETC%" -Djava.io.tmpdir="%KARAF_DATA%\tmp" -Djava.util.logging.config.file="%KARAF_BASE%\etc\java.util.logging.properties" %KARAF_OPTS% org.apache.karaf.shell.console.impl.Main --classpath="%KARAF_HOME%\system" %ARGS%
+    "%JAVA%" %JAVA_OPTS% %OPTS% -classpath "%CLASSPATH%" -Dkaraf.instances="%KARAF_HOME%\instances" -Dkaraf.home="%KARAF_HOME%" -Dkaraf.base="%KARAF_BASE%" -Dkaraf.etc="%KARAF_ETC%" -Djava.io.tmpdir="%KARAF_DATA%\tmp" -Djava.util.logging.config.file="%KARAF_BASE%\etc\java.util.logging.properties" %KARAF_OPTS% org.apache.karaf.shell.impl.console.standalone.Main --classpath="%KARAF_HOME%\system" %ARGS%
 
 rem # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
 

http://git-wip-us.apache.org/repos/asf/karaf/blob/2e2b9324/bundle/command/pom.xml
----------------------------------------------------------------------
diff --git a/bundle/command/pom.xml b/bundle/command/pom.xml
index ebfa147..d6bd26a 100644
--- a/bundle/command/pom.xml
+++ b/bundle/command/pom.xml
@@ -44,7 +44,7 @@
         </dependency>
         <dependency>
             <groupId>org.apache.karaf.shell</groupId>
-            <artifactId>org.apache.karaf.shell.console</artifactId>
+            <artifactId>org.apache.karaf.shell.core</artifactId>
         </dependency>
         <dependency>
             <groupId>org.apache.karaf.bundle</groupId>
@@ -107,6 +107,7 @@
                             org.apache.felix.utils.version;-split-package:=merge-first,
                             org.apache.felix.utils.manifest;-split-package:=merge-first
                         </Private-Package>
+                        <Karaf-Commands>org.apache.karaf.bundle.command.*</Karaf-Commands>
                     </instructions>
                 </configuration>
             </plugin>

http://git-wip-us.apache.org/repos/asf/karaf/blob/2e2b9324/bundle/command/src/main/java/org/apache/karaf/bundle/command/BundleCommand.java
----------------------------------------------------------------------
diff --git a/bundle/command/src/main/java/org/apache/karaf/bundle/command/BundleCommand.java b/bundle/command/src/main/java/org/apache/karaf/bundle/command/BundleCommand.java
index 9aa6c89..dce0ca8 100644
--- a/bundle/command/src/main/java/org/apache/karaf/bundle/command/BundleCommand.java
+++ b/bundle/command/src/main/java/org/apache/karaf/bundle/command/BundleCommand.java
@@ -17,16 +17,17 @@
 package org.apache.karaf.bundle.command;
 
 import org.apache.karaf.bundle.core.BundleService;
-import org.apache.karaf.shell.commands.Argument;
-import org.apache.karaf.shell.console.OsgiCommandSupport;
-import org.apache.karaf.shell.inject.Reference;
-import org.apache.karaf.shell.util.ShellUtil;
+import org.apache.karaf.shell.api.action.Action;
+import org.apache.karaf.shell.api.action.Argument;
+import org.apache.karaf.shell.api.action.lifecycle.Reference;
+import org.apache.karaf.shell.support.ShellUtil;
 import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
 
 /**
  * Unique bundle command.
  */
-public abstract class BundleCommand extends OsgiCommandSupport {
+public abstract class BundleCommand implements Action {
 
     @Argument(index = 0, name = "id", description = "The bundle ID or name or name/version", required = true, multiValued = false)
     String id;
@@ -36,11 +37,14 @@ public abstract class BundleCommand extends OsgiCommandSupport {
     @Reference
     BundleService bundleService;
 
+    @Reference
+    BundleContext bundleContext;
+
     public BundleCommand(boolean defaultAllBundles) {
         this.defaultAllBundles = defaultAllBundles;
     }
 
-    protected Object doExecute() throws Exception {
+    public Object execute() throws Exception {
         return doExecute(true);
     }
 

http://git-wip-us.apache.org/repos/asf/karaf/blob/2e2b9324/bundle/command/src/main/java/org/apache/karaf/bundle/command/BundleCommandWithConfirmation.java
----------------------------------------------------------------------
diff --git a/bundle/command/src/main/java/org/apache/karaf/bundle/command/BundleCommandWithConfirmation.java b/bundle/command/src/main/java/org/apache/karaf/bundle/command/BundleCommandWithConfirmation.java
index 66c324c..c07a357 100644
--- a/bundle/command/src/main/java/org/apache/karaf/bundle/command/BundleCommandWithConfirmation.java
+++ b/bundle/command/src/main/java/org/apache/karaf/bundle/command/BundleCommandWithConfirmation.java
@@ -16,7 +16,7 @@
  */
 package org.apache.karaf.bundle.command;
 
-import org.apache.karaf.shell.commands.Option;
+import org.apache.karaf.shell.api.action.Option;
 
 /**
  * Unique bundle command with confirmation while accessing system bundle.
@@ -30,7 +30,7 @@ public abstract class BundleCommandWithConfirmation extends BundleCommand {
         super(true);
     }
 
-    protected Object doExecute() throws Exception {
+    public Object execute() throws Exception {
         return doExecute(force);
     }
 

http://git-wip-us.apache.org/repos/asf/karaf/blob/2e2b9324/bundle/command/src/main/java/org/apache/karaf/bundle/command/BundlesCommand.java
----------------------------------------------------------------------
diff --git a/bundle/command/src/main/java/org/apache/karaf/bundle/command/BundlesCommand.java b/bundle/command/src/main/java/org/apache/karaf/bundle/command/BundlesCommand.java
index 6a421fe..ff4dd53 100644
--- a/bundle/command/src/main/java/org/apache/karaf/bundle/command/BundlesCommand.java
+++ b/bundle/command/src/main/java/org/apache/karaf/bundle/command/BundlesCommand.java
@@ -19,13 +19,14 @@ package org.apache.karaf.bundle.command;
 import java.util.List;
 
 import org.apache.karaf.bundle.core.BundleService;
-import org.apache.karaf.shell.commands.Argument;
-import org.apache.karaf.shell.console.OsgiCommandSupport;
-import org.apache.karaf.shell.inject.Reference;
-import org.apache.karaf.shell.util.ShellUtil;
+import org.apache.karaf.shell.api.action.Action;
+import org.apache.karaf.shell.api.action.Argument;
+import org.apache.karaf.shell.api.action.lifecycle.Reference;
+import org.apache.karaf.shell.support.ShellUtil;
 import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
 
-public abstract class BundlesCommand extends OsgiCommandSupport {
+public abstract class BundlesCommand implements Action {
 
     @Argument(index = 0, name = "ids", description = "The list of bundle (identified by IDs or name or name/version) separated by whitespaces", required = false, multiValued = true)
     List<String> ids;
@@ -33,13 +34,21 @@ public abstract class BundlesCommand extends OsgiCommandSupport {
     boolean defaultAllBundles = true;
 
     @Reference
+    BundleContext bundleContext;
+
+    @Reference
     BundleService bundleService;
     
     public BundlesCommand(boolean defaultAllBundles) {
         this.defaultAllBundles = defaultAllBundles;
     }
-    
-    protected Object doExecute() throws Exception {
+
+    public void setBundleContext(BundleContext bundleContext) {
+        this.bundleContext = bundleContext;
+    }
+
+    @Override
+    public Object execute() throws Exception {
         doExecute(true);
         return null;
     }

http://git-wip-us.apache.org/repos/asf/karaf/blob/2e2b9324/bundle/command/src/main/java/org/apache/karaf/bundle/command/BundlesCommandWithConfirmation.java
----------------------------------------------------------------------
diff --git a/bundle/command/src/main/java/org/apache/karaf/bundle/command/BundlesCommandWithConfirmation.java b/bundle/command/src/main/java/org/apache/karaf/bundle/command/BundlesCommandWithConfirmation.java
index a6cc62b..271fc42 100644
--- a/bundle/command/src/main/java/org/apache/karaf/bundle/command/BundlesCommandWithConfirmation.java
+++ b/bundle/command/src/main/java/org/apache/karaf/bundle/command/BundlesCommandWithConfirmation.java
@@ -19,8 +19,8 @@ package org.apache.karaf.bundle.command;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.karaf.shell.commands.Option;
-import org.apache.karaf.shell.console.MultiException;
+import org.apache.karaf.shell.api.action.Option;
+import org.apache.karaf.shell.support.MultiException;
 import org.osgi.framework.Bundle;
 
 /**

http://git-wip-us.apache.org/repos/asf/karaf/blob/2e2b9324/bundle/command/src/main/java/org/apache/karaf/bundle/command/Capabilities.java
----------------------------------------------------------------------
diff --git a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Capabilities.java b/bundle/command/src/main/java/org/apache/karaf/bundle/command/Capabilities.java
index 4d8c694..de83a1d 100644
--- a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Capabilities.java
+++ b/bundle/command/src/main/java/org/apache/karaf/bundle/command/Capabilities.java
@@ -22,10 +22,10 @@ import java.util.List;
 import java.util.Map;
 import java.util.regex.Pattern;
 
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.commands.Option;
-import org.apache.karaf.shell.inject.Service;
-import org.apache.karaf.shell.util.ShellUtil;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.Option;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
+import org.apache.karaf.shell.support.ShellUtil;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.Constants;
 import org.osgi.framework.ServiceReference;

http://git-wip-us.apache.org/repos/asf/karaf/blob/2e2b9324/bundle/command/src/main/java/org/apache/karaf/bundle/command/Classes.java
----------------------------------------------------------------------
diff --git a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Classes.java b/bundle/command/src/main/java/org/apache/karaf/bundle/command/Classes.java
index 3a9dc03..b0f80ff 100644
--- a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Classes.java
+++ b/bundle/command/src/main/java/org/apache/karaf/bundle/command/Classes.java
@@ -16,15 +16,15 @@
  */
 package org.apache.karaf.bundle.command;
 
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.commands.Option;
-import org.apache.karaf.shell.inject.Service;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.wiring.BundleWiring;
-
 import java.util.Collection;
 import java.util.List;
 
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.Option;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.wiring.BundleWiring;
+
 @Command(scope = "bundle", name = "classes", description = "Displays a list of classes contained in the bundle")
 @Service
 public class Classes extends BundlesCommand {

http://git-wip-us.apache.org/repos/asf/karaf/blob/2e2b9324/bundle/command/src/main/java/org/apache/karaf/bundle/command/Diag.java
----------------------------------------------------------------------
diff --git a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Diag.java b/bundle/command/src/main/java/org/apache/karaf/bundle/command/Diag.java
index 0a70d72..1e8e11b 100644
--- a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Diag.java
+++ b/bundle/command/src/main/java/org/apache/karaf/bundle/command/Diag.java
@@ -20,9 +20,9 @@ import java.util.List;
 
 import org.apache.karaf.bundle.core.BundleInfo;
 import org.apache.karaf.bundle.core.BundleState;
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.inject.Service;
-import org.apache.karaf.shell.util.ShellUtil;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
+import org.apache.karaf.shell.support.ShellUtil;
 import org.osgi.framework.Bundle;
 
 @Command(scope = "bundle", name = "diag", description = "Displays diagnostic information why a bundle is not Active")

http://git-wip-us.apache.org/repos/asf/karaf/blob/2e2b9324/bundle/command/src/main/java/org/apache/karaf/bundle/command/DynamicImport.java
----------------------------------------------------------------------
diff --git a/bundle/command/src/main/java/org/apache/karaf/bundle/command/DynamicImport.java b/bundle/command/src/main/java/org/apache/karaf/bundle/command/DynamicImport.java
index e2e4759..74fc20a 100644
--- a/bundle/command/src/main/java/org/apache/karaf/bundle/command/DynamicImport.java
+++ b/bundle/command/src/main/java/org/apache/karaf/bundle/command/DynamicImport.java
@@ -16,9 +16,8 @@
  */
 package org.apache.karaf.bundle.command;
 
-import org.apache.karaf.bundle.core.BundleService;
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.inject.Service;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
 import org.osgi.framework.Bundle;
 
 /**

http://git-wip-us.apache.org/repos/asf/karaf/blob/2e2b9324/bundle/command/src/main/java/org/apache/karaf/bundle/command/FindClass.java
----------------------------------------------------------------------
diff --git a/bundle/command/src/main/java/org/apache/karaf/bundle/command/FindClass.java b/bundle/command/src/main/java/org/apache/karaf/bundle/command/FindClass.java
index afafd54..4a9fc75 100644
--- a/bundle/command/src/main/java/org/apache/karaf/bundle/command/FindClass.java
+++ b/bundle/command/src/main/java/org/apache/karaf/bundle/command/FindClass.java
@@ -17,31 +17,36 @@ package org.apache.karaf.bundle.command;
  * limitations under the License.
  */
 
-import org.apache.karaf.shell.commands.Argument;
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.console.OsgiCommandSupport;
-import org.apache.karaf.shell.inject.Service;
-import org.apache.karaf.shell.util.ShellUtil;
-import org.osgi.framework.wiring.BundleWiring;
-import org.osgi.framework.Bundle;
-
 import java.util.Collection;
-import java.util.List;
+
+import org.apache.karaf.shell.api.action.Action;
+import org.apache.karaf.shell.api.action.Argument;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.lifecycle.Reference;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
+import org.apache.karaf.shell.support.ShellUtil;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.wiring.BundleWiring;
 
 @Command(scope = "bundle", name = "find-class", description = "Locates a specified class in any deployed bundle")
 @Service
-public class FindClass extends OsgiCommandSupport {
+public class FindClass implements Action {
 
     @Argument(index = 0, name = "className", description = "Class name or partial class name to be found", required = true, multiValued = false)
     String className;
 
-    protected Object doExecute() throws Exception {
+    @Reference
+    BundleContext bundleContext;
+
+    @Override
+    public Object execute() throws Exception {
         findResource();
         return null;
     }
 
     protected void findResource() {
-        Bundle[] bundles = getBundleContext().getBundles();
+        Bundle[] bundles = bundleContext.getBundles();
         String filter = "*" + className + "*";
         for (Bundle bundle:bundles){
             BundleWiring wiring = bundle.adapt(BundleWiring.class);

http://git-wip-us.apache.org/repos/asf/karaf/blob/2e2b9324/bundle/command/src/main/java/org/apache/karaf/bundle/command/Headers.java
----------------------------------------------------------------------
diff --git a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Headers.java b/bundle/command/src/main/java/org/apache/karaf/bundle/command/Headers.java
index a173a90..16083ff 100644
--- a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Headers.java
+++ b/bundle/command/src/main/java/org/apache/karaf/bundle/command/Headers.java
@@ -25,18 +25,18 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
-import jline.Terminal;
-
 import org.apache.felix.utils.manifest.Attribute;
 import org.apache.felix.utils.manifest.Clause;
 import org.apache.felix.utils.manifest.Directive;
 import org.apache.felix.utils.manifest.Parser;
 import org.apache.felix.utils.version.VersionRange;
 import org.apache.felix.utils.version.VersionTable;
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.commands.Option;
-import org.apache.karaf.shell.inject.Service;
-import org.apache.karaf.shell.util.ShellUtil;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.Option;
+import org.apache.karaf.shell.api.action.lifecycle.Reference;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
+import org.apache.karaf.shell.api.console.Terminal;
+import org.apache.karaf.shell.support.ShellUtil;
 import org.fusesource.jansi.Ansi;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.Constants;
@@ -57,6 +57,9 @@ public class Headers extends BundlesCommand {
 
     @Option(name = "--indent", description = "Indentation method")
     int indent = -1;
+
+    @Reference
+    Terminal terminal;
     
     public Headers() {
         super(true);
@@ -228,8 +231,7 @@ public class Headers extends BundlesCommand {
     }
 
     protected int getTermWidth() {
-        Terminal term = (Terminal) session.get(".jline.terminal");
-        return term != null ? term.getWidth() : 80;
+        return terminal.getWidth();
 
     }
 

http://git-wip-us.apache.org/repos/asf/karaf/blob/2e2b9324/bundle/command/src/main/java/org/apache/karaf/bundle/command/Info.java
----------------------------------------------------------------------
diff --git a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Info.java b/bundle/command/src/main/java/org/apache/karaf/bundle/command/Info.java
index 904c9d6..451ec87 100644
--- a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Info.java
+++ b/bundle/command/src/main/java/org/apache/karaf/bundle/command/Info.java
@@ -25,9 +25,9 @@ import java.util.List;
 import org.apache.karaf.bundle.command.wikidoc.AnsiPrintingWikiVisitor;
 import org.apache.karaf.bundle.command.wikidoc.WikiParser;
 import org.apache.karaf.bundle.command.wikidoc.WikiVisitor;
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.inject.Service;
-import org.apache.karaf.shell.util.ShellUtil;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
+import org.apache.karaf.shell.support.ShellUtil;
 import org.osgi.framework.Bundle;
 
 @Command(scope = "bundle", name = "info", description = "Displays detailed information of a given bundles.")

http://git-wip-us.apache.org/repos/asf/karaf/blob/2e2b9324/bundle/command/src/main/java/org/apache/karaf/bundle/command/Install.java
----------------------------------------------------------------------
diff --git a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Install.java b/bundle/command/src/main/java/org/apache/karaf/bundle/command/Install.java
index 15604cc..11fba89 100644
--- a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Install.java
+++ b/bundle/command/src/main/java/org/apache/karaf/bundle/command/Install.java
@@ -19,17 +19,19 @@ package org.apache.karaf.bundle.command;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.karaf.shell.commands.Argument;
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.commands.Option;
-import org.apache.karaf.shell.console.MultiException;
-import org.apache.karaf.shell.console.OsgiCommandSupport;
-import org.apache.karaf.shell.inject.Service;
+import org.apache.karaf.shell.api.action.Action;
+import org.apache.karaf.shell.api.action.Argument;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.Option;
+import org.apache.karaf.shell.api.action.lifecycle.Reference;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
+import org.apache.karaf.shell.support.MultiException;
 import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
 
 @Command(scope = "bundle", name = "install", description = "Installs one or more bundles.")
 @Service
-public class Install extends OsgiCommandSupport {
+public class Install implements Action {
 
     @Argument(index = 0, name = "urls", description = "Bundle URLs separated by whitespaces", required = true, multiValued = true)
     List<String> urls;
@@ -37,12 +39,16 @@ public class Install extends OsgiCommandSupport {
     @Option(name = "-s", aliases={"--start"}, description="Starts the bundles after installation", required = false, multiValued = false)
     boolean start;
 
-    protected Object doExecute() throws Exception {
+    @Reference
+    BundleContext bundleContext;
+
+    @Override
+    public Object execute() throws Exception {
         List<Exception> exceptions = new ArrayList<Exception>();
         List<Bundle> bundles = new ArrayList<Bundle>();
         for (String url : urls) {
             try {
-                bundles.add(getBundleContext().installBundle(url, null));
+                bundles.add(bundleContext.installBundle(url, null));
             } catch (Exception e) {
                 exceptions.add(new Exception("Unable to install bundle " + url, e));
             }

http://git-wip-us.apache.org/repos/asf/karaf/blob/2e2b9324/bundle/command/src/main/java/org/apache/karaf/bundle/command/ListBundleServices.java
----------------------------------------------------------------------
diff --git a/bundle/command/src/main/java/org/apache/karaf/bundle/command/ListBundleServices.java b/bundle/command/src/main/java/org/apache/karaf/bundle/command/ListBundleServices.java
index b813c52..28f8264 100644
--- a/bundle/command/src/main/java/org/apache/karaf/bundle/command/ListBundleServices.java
+++ b/bundle/command/src/main/java/org/apache/karaf/bundle/command/ListBundleServices.java
@@ -16,14 +16,15 @@
  */
 package org.apache.karaf.bundle.command;
 
+import java.util.Arrays;
+import java.util.HashSet;
 import java.util.List;
+import java.util.Set;
 
-import org.apache.felix.service.command.Function;
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.commands.Option;
-import org.apache.karaf.shell.console.Completer;
-import org.apache.karaf.shell.inject.Service;
-import org.apache.karaf.shell.util.ShellUtil;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.Option;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
+import org.apache.karaf.shell.support.ShellUtil;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.Constants;
 import org.osgi.framework.ServiceReference;
@@ -40,6 +41,11 @@ public class ListBundleServices extends BundlesCommand {
     
     @Option(name = "-p", aliases = {}, description = "Shows the properties of the services", required = false, multiValued = false)
     boolean showProperties = false;
+
+    Set<String> hidden = new HashSet<String>(Arrays.asList(new String[] {
+        "org.apache.felix.service.command.Function",
+        "org.apache.karaf.shell.console.Completer"
+    }));
     
     public ListBundleServices() {
         super(true);
@@ -94,8 +100,7 @@ public class ListBundleServices extends BundlesCommand {
 
     private boolean isCommandOrCompleter(String[] objectClasses) {
         for (String objectClass : objectClasses) {
-            if (objectClass.equals(Function.class.getName())
-                    || objectClass.equals(Completer.class.getName())) {
+            if (hidden.contains(objectClass)) {
                 return true;
             }
         }

http://git-wip-us.apache.org/repos/asf/karaf/blob/2e2b9324/bundle/command/src/main/java/org/apache/karaf/bundle/command/ListBundles.java
----------------------------------------------------------------------
diff --git a/bundle/command/src/main/java/org/apache/karaf/bundle/command/ListBundles.java b/bundle/command/src/main/java/org/apache/karaf/bundle/command/ListBundles.java
index 1cc87ef..4ab0af9 100644
--- a/bundle/command/src/main/java/org/apache/karaf/bundle/command/ListBundles.java
+++ b/bundle/command/src/main/java/org/apache/karaf/bundle/command/ListBundles.java
@@ -19,18 +19,19 @@ package org.apache.karaf.bundle.command;
 import org.apache.karaf.bundle.core.BundleInfo;
 import org.apache.karaf.bundle.core.BundleService;
 import org.apache.karaf.bundle.core.BundleState;
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.commands.Option;
-import org.apache.karaf.shell.console.OsgiCommandSupport;
-import org.apache.karaf.shell.inject.Reference;
-import org.apache.karaf.shell.inject.Service;
 import org.apache.karaf.shell.table.ShellTable;
+import org.apache.karaf.shell.api.action.Action;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.Option;
+import org.apache.karaf.shell.api.action.lifecycle.Reference;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
 import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
 import org.osgi.framework.startlevel.FrameworkStartLevel;
 
 @Command(scope = "bundle", name = "list", description = "Lists all installed bundles.")
 @Service
-public class ListBundles extends OsgiCommandSupport {
+public class ListBundles implements Action {
 
     @Option(name = "-l", aliases = {}, description = "Show the locations", required = false, multiValued = false)
     boolean showLoc;
@@ -48,14 +49,18 @@ public class ListBundles extends OsgiCommandSupport {
     boolean noFormat;
 
     @Reference
+    BundleContext bundleContext;
+
+    @Reference
     private BundleService bundleService;
 
     public void setBundleService(BundleService bundleService) {
         this.bundleService = bundleService;
     }
 
-    protected Object doExecute() throws Exception {
-        Bundle[] bundles = getBundleContext().getBundles();
+    @Override
+    public Object execute() throws Exception {
+        Bundle[] bundles = bundleContext.getBundles();
         if (bundles == null) {
             System.out.println("There are no installed bundles.");
             return null;
@@ -64,7 +69,7 @@ public class ListBundles extends OsgiCommandSupport {
         determineBundleLevelThreshold();
         
         // Display active start level.
-        FrameworkStartLevel fsl = getBundleContext().getBundle(0).adapt(FrameworkStartLevel.class);
+        FrameworkStartLevel fsl = bundleContext.getBundle(0).adapt(FrameworkStartLevel.class);
         if (fsl != null) {
             System.out.println("START LEVEL " + fsl.getStartLevel() + " , List Threshold: " + bundleLevelThreshold);
         }

http://git-wip-us.apache.org/repos/asf/karaf/blob/2e2b9324/bundle/command/src/main/java/org/apache/karaf/bundle/command/LoadTest.java
----------------------------------------------------------------------
diff --git a/bundle/command/src/main/java/org/apache/karaf/bundle/command/LoadTest.java b/bundle/command/src/main/java/org/apache/karaf/bundle/command/LoadTest.java
index 6c8d6c3..7ca43b2 100644
--- a/bundle/command/src/main/java/org/apache/karaf/bundle/command/LoadTest.java
+++ b/bundle/command/src/main/java/org/apache/karaf/bundle/command/LoadTest.java
@@ -24,12 +24,12 @@ import java.util.Random;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.atomic.AtomicBoolean;
 
-import jline.console.ConsoleReader;
-import org.apache.felix.service.command.CommandSession;
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.commands.Option;
-import org.apache.karaf.shell.console.OsgiCommandSupport;
-import org.apache.karaf.shell.inject.Service;
+import org.apache.karaf.shell.api.action.Action;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.Option;
+import org.apache.karaf.shell.api.console.Session;
+import org.apache.karaf.shell.api.action.lifecycle.Reference;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.FrameworkEvent;
@@ -38,7 +38,7 @@ import org.osgi.framework.wiring.FrameworkWiring;
 
 @Command(scope = "bundle", name = "load-test", description = "Load test bundle lifecycle")
 @Service
-public class LoadTest extends OsgiCommandSupport {
+public class LoadTest implements Action {
 
     @Option(name = "--threads", description = "number of concurrent threads")
     int threads = 2;
@@ -55,12 +55,18 @@ public class LoadTest extends OsgiCommandSupport {
     @Option(name = "--excludes", description = "List of bundles (ids or symbolic names) to exclude")
     List<String> excludes = Arrays.asList("0", "org.ops4j.pax.url.mvn", "org.ops4j.pax.logging.pax-logging-api", "org.ops4j.pax.logging.pax-logging-service");
 
+    @Reference
+    Session session;
+
+    @Reference
+    BundleContext bundleContext;
+
     @Override
-    protected Object doExecute() throws Exception {
+    public Object execute() throws Exception {
         if (!confirm(session)) {
             return null;
         }
-        final BundleContext bundleContext = getBundleContext().getBundle(0).getBundleContext();
+        final BundleContext bundleContext = this.bundleContext.getBundle(0).getBundleContext();
         final FrameworkWiring wiring = bundleContext.getBundle().adapt(FrameworkWiring.class);
         final CountDownLatch latch = new CountDownLatch(threads);
         final Bundle[] bundles = bundleContext.getBundles();
@@ -159,11 +165,10 @@ public class LoadTest extends OsgiCommandSupport {
         return null;
     }
 
-    private boolean confirm(CommandSession session) throws IOException {
+    private boolean confirm(Session session) throws IOException {
         for (;;) {
-            ConsoleReader reader = (ConsoleReader) session.get(".jline.reader");
             String msg = "You are about to perform a start/stop/refresh load test on bundles.\nDo you wish to continue (yes/no): ";
-            String str = reader.readLine(msg);
+            String str = session.readLine(msg, null);
             if ("yes".equalsIgnoreCase(str)) {
                 return true;
             }

http://git-wip-us.apache.org/repos/asf/karaf/blob/2e2b9324/bundle/command/src/main/java/org/apache/karaf/bundle/command/Refresh.java
----------------------------------------------------------------------
diff --git a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Refresh.java b/bundle/command/src/main/java/org/apache/karaf/bundle/command/Refresh.java
index bfd0c2d..53adaeb 100644
--- a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Refresh.java
+++ b/bundle/command/src/main/java/org/apache/karaf/bundle/command/Refresh.java
@@ -18,8 +18,8 @@ package org.apache.karaf.bundle.command;
 
 import java.util.List;
 
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.inject.Service;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.wiring.FrameworkWiring;
 
@@ -32,7 +32,7 @@ public class Refresh extends BundlesCommandWithConfirmation {
     }
 
     protected void doExecute(List<Bundle> bundles) throws Exception {
-        FrameworkWiring wiring = getBundleContext().getBundle(0).adapt(FrameworkWiring.class);
+        FrameworkWiring wiring = bundleContext.getBundle(0).adapt(FrameworkWiring.class);
         wiring.refreshBundles(bundles == null || bundles.isEmpty() ? null : bundles);
     }
 

http://git-wip-us.apache.org/repos/asf/karaf/blob/2e2b9324/bundle/command/src/main/java/org/apache/karaf/bundle/command/Requirements.java
----------------------------------------------------------------------
diff --git a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Requirements.java b/bundle/command/src/main/java/org/apache/karaf/bundle/command/Requirements.java
index 3fdc004..c87d4d4 100644
--- a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Requirements.java
+++ b/bundle/command/src/main/java/org/apache/karaf/bundle/command/Requirements.java
@@ -22,10 +22,10 @@ import java.util.List;
 import java.util.Map;
 import java.util.regex.Pattern;
 
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.commands.Option;
-import org.apache.karaf.shell.inject.Service;
-import org.apache.karaf.shell.util.ShellUtil;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.Option;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
+import org.apache.karaf.shell.support.ShellUtil;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.Constants;
 import org.osgi.framework.ServiceReference;

http://git-wip-us.apache.org/repos/asf/karaf/blob/2e2b9324/bundle/command/src/main/java/org/apache/karaf/bundle/command/Resolve.java
----------------------------------------------------------------------
diff --git a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Resolve.java b/bundle/command/src/main/java/org/apache/karaf/bundle/command/Resolve.java
index d72cfce..720f118 100644
--- a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Resolve.java
+++ b/bundle/command/src/main/java/org/apache/karaf/bundle/command/Resolve.java
@@ -18,8 +18,8 @@ package org.apache.karaf.bundle.command;
 
 import java.util.List;
 
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.inject.Service;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.wiring.FrameworkWiring;
 
@@ -32,7 +32,7 @@ public class Resolve extends BundlesCommand {
     }
 
     protected void doExecute(List<Bundle> bundles) throws Exception {
-        FrameworkWiring wiring = getBundleContext().getBundle(0).adapt(FrameworkWiring.class);
+        FrameworkWiring wiring = bundleContext.getBundle(0).adapt(FrameworkWiring.class);
         wiring.resolveBundles(bundles == null || bundles.isEmpty() ? null : bundles);
     }
 

http://git-wip-us.apache.org/repos/asf/karaf/blob/2e2b9324/bundle/command/src/main/java/org/apache/karaf/bundle/command/Restart.java
----------------------------------------------------------------------
diff --git a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Restart.java b/bundle/command/src/main/java/org/apache/karaf/bundle/command/Restart.java
index 16d9b02..95d5dfe 100644
--- a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Restart.java
+++ b/bundle/command/src/main/java/org/apache/karaf/bundle/command/Restart.java
@@ -19,9 +19,9 @@ package org.apache.karaf.bundle.command;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.console.MultiException;
-import org.apache.karaf.shell.inject.Service;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
+import org.apache.karaf.shell.support.MultiException;
 import org.osgi.framework.Bundle;
 
 @Command(scope = "bundle", name = "restart", description = "Restarts bundles.")

http://git-wip-us.apache.org/repos/asf/karaf/blob/2e2b9324/bundle/command/src/main/java/org/apache/karaf/bundle/command/ShowBundleTree.java
----------------------------------------------------------------------
diff --git a/bundle/command/src/main/java/org/apache/karaf/bundle/command/ShowBundleTree.java b/bundle/command/src/main/java/org/apache/karaf/bundle/command/ShowBundleTree.java
index 1e44a4d..a83ce39 100644
--- a/bundle/command/src/main/java/org/apache/karaf/bundle/command/ShowBundleTree.java
+++ b/bundle/command/src/main/java/org/apache/karaf/bundle/command/ShowBundleTree.java
@@ -16,8 +16,6 @@
  */
 package org.apache.karaf.bundle.command;
 
-import static java.lang.String.format;
-
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -31,8 +29,8 @@ import org.apache.felix.utils.version.VersionRange;
 import org.apache.felix.utils.version.VersionTable;
 import org.apache.karaf.bundle.command.bundletree.Node;
 import org.apache.karaf.bundle.command.bundletree.Tree;
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.inject.Service;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.Constants;
 import org.osgi.framework.wiring.BundleCapability;
@@ -43,6 +41,8 @@ import org.osgi.framework.wiring.BundleWiring;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import static java.lang.String.format;
+
 /**
  * Command for showing the full tree of bundles that have been used to resolve
  * a given bundle.

http://git-wip-us.apache.org/repos/asf/karaf/blob/2e2b9324/bundle/command/src/main/java/org/apache/karaf/bundle/command/Start.java
----------------------------------------------------------------------
diff --git a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Start.java b/bundle/command/src/main/java/org/apache/karaf/bundle/command/Start.java
index c3f1882..48e90fa 100644
--- a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Start.java
+++ b/bundle/command/src/main/java/org/apache/karaf/bundle/command/Start.java
@@ -16,8 +16,8 @@
  */
 package org.apache.karaf.bundle.command;
 
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.inject.Service;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
 import org.osgi.framework.Bundle;
 
 @Command(scope = "bundle", name = "start", description = "Starts bundles.")

http://git-wip-us.apache.org/repos/asf/karaf/blob/2e2b9324/bundle/command/src/main/java/org/apache/karaf/bundle/command/StartLevel.java
----------------------------------------------------------------------
diff --git a/bundle/command/src/main/java/org/apache/karaf/bundle/command/StartLevel.java b/bundle/command/src/main/java/org/apache/karaf/bundle/command/StartLevel.java
index 117f21a..30bec0f 100644
--- a/bundle/command/src/main/java/org/apache/karaf/bundle/command/StartLevel.java
+++ b/bundle/command/src/main/java/org/apache/karaf/bundle/command/StartLevel.java
@@ -16,10 +16,11 @@
  */
 package org.apache.karaf.bundle.command;
 
-import org.apache.karaf.shell.commands.Argument;
-import org.apache.karaf.shell.commands.Command;
-import jline.console.ConsoleReader;
-import org.apache.karaf.shell.inject.Service;
+import org.apache.karaf.shell.api.action.Argument;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.console.Session;
+import org.apache.karaf.shell.api.action.lifecycle.Reference;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.startlevel.BundleStartLevel;
 
@@ -30,6 +31,9 @@ public class StartLevel extends BundleCommandWithConfirmation {
     @Argument(index = 1, name = "startLevel", description = "The bundle's new start level", required = false, multiValued = false)
     Integer level;
 
+    @Reference
+    Session session;
+
     protected void doExecute(Bundle bundle) throws Exception {
         // Get package instance service.
         BundleStartLevel bsl = bundle.adapt(BundleStartLevel.class);
@@ -42,9 +46,8 @@ public class StartLevel extends BundleCommandWithConfirmation {
         }
         else if ((level < 50) && (bsl.getStartLevel() > 50) && !force){
             for (;;) {
-                ConsoleReader reader = (ConsoleReader) session.get(".jline.reader");
                 String msg = "You are about to designate bundle as a system bundle.  Do you wish to continue (yes/no): ";
-                String str = reader.readLine(msg);
+                String str = session.readLine(msg, null);
                 if ("yes".equalsIgnoreCase(str)) {
                     bsl.setStartLevel(level);
                     break;

http://git-wip-us.apache.org/repos/asf/karaf/blob/2e2b9324/bundle/command/src/main/java/org/apache/karaf/bundle/command/Stop.java
----------------------------------------------------------------------
diff --git a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Stop.java b/bundle/command/src/main/java/org/apache/karaf/bundle/command/Stop.java
index c5408bc..0b0fed2 100644
--- a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Stop.java
+++ b/bundle/command/src/main/java/org/apache/karaf/bundle/command/Stop.java
@@ -16,9 +16,9 @@
  */
 package org.apache.karaf.bundle.command;
 
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.commands.Option;
-import org.apache.karaf.shell.inject.Service;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.Option;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
 import org.osgi.framework.Bundle;
 
 @Command(scope = "bundle", name = "stop", description = "Stop bundles.")

http://git-wip-us.apache.org/repos/asf/karaf/blob/2e2b9324/bundle/command/src/main/java/org/apache/karaf/bundle/command/Uninstall.java
----------------------------------------------------------------------
diff --git a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Uninstall.java b/bundle/command/src/main/java/org/apache/karaf/bundle/command/Uninstall.java
index 04f15f2..67b5b14 100644
--- a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Uninstall.java
+++ b/bundle/command/src/main/java/org/apache/karaf/bundle/command/Uninstall.java
@@ -16,8 +16,8 @@
  */
 package org.apache.karaf.bundle.command;
 
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.inject.Service;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
 import org.osgi.framework.Bundle;
 
 @Command(scope = "bundle", name = "uninstall", description = "Uninstall bundles.")

http://git-wip-us.apache.org/repos/asf/karaf/blob/2e2b9324/bundle/command/src/main/java/org/apache/karaf/bundle/command/Update.java
----------------------------------------------------------------------
diff --git a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Update.java b/bundle/command/src/main/java/org/apache/karaf/bundle/command/Update.java
index b19bed7..71ae74d 100644
--- a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Update.java
+++ b/bundle/command/src/main/java/org/apache/karaf/bundle/command/Update.java
@@ -19,9 +19,9 @@ package org.apache.karaf.bundle.command;
 import java.io.InputStream;
 import java.net.URL;
 
-import org.apache.karaf.shell.commands.Argument;
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.inject.Service;
+import org.apache.karaf.shell.api.action.Argument;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
 import org.osgi.framework.Bundle;
 
 @Command(scope = "bundle", name = "update", description = "Update bundle.")

http://git-wip-us.apache.org/repos/asf/karaf/blob/2e2b9324/bundle/command/src/main/java/org/apache/karaf/bundle/command/Watch.java
----------------------------------------------------------------------
diff --git a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Watch.java b/bundle/command/src/main/java/org/apache/karaf/bundle/command/Watch.java
index 715455b..9203f59 100644
--- a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Watch.java
+++ b/bundle/command/src/main/java/org/apache/karaf/bundle/command/Watch.java
@@ -19,19 +19,18 @@ package org.apache.karaf.bundle.command;
 import java.util.List;
 
 import org.apache.karaf.bundle.core.BundleWatcher;
-import org.apache.karaf.shell.commands.Argument;
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.commands.Option;
-import org.apache.karaf.shell.console.AbstractAction;
-import org.apache.karaf.shell.console.OsgiCommandSupport;
-import org.apache.karaf.shell.inject.Reference;
-import org.apache.karaf.shell.inject.Service;
+import org.apache.karaf.shell.api.action.Action;
+import org.apache.karaf.shell.api.action.Argument;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.Option;
+import org.apache.karaf.shell.api.action.lifecycle.Reference;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.Constants;
 
 @Command(scope = "bundle", name = "watch", description = "Watches and updates bundles", detailedDescription = "Watches the local maven repo for changes in snapshot jars and redploys changed jars")
 @Service
-public class Watch extends OsgiCommandSupport {
+public class Watch implements Action {
 
     @Argument(index = 0, name = "urls", description = "The bundle IDs or URLs", required = false, multiValued = true)
     List<String> urls;
@@ -59,7 +58,7 @@ public class Watch extends OsgiCommandSupport {
     }
 
     @Override
-    protected Object doExecute() throws Exception {
+    public Object execute() throws Exception {
         if (start && stop) {
             System.err.println("Please use only one of --start and --stop options!");
             return null;

http://git-wip-us.apache.org/repos/asf/karaf/blob/2e2b9324/bundle/command/src/main/resources/OSGI-INF/blueprint/shell-bundles.xml
----------------------------------------------------------------------
diff --git a/bundle/command/src/main/resources/OSGI-INF/blueprint/shell-bundles.xml b/bundle/command/src/main/resources/OSGI-INF/blueprint/shell-bundles.xml
deleted file mode 100644
index 327becd..0000000
--- a/bundle/command/src/main/resources/OSGI-INF/blueprint/shell-bundles.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
-    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
-
-       http://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.
-
--->
-<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
-
-    <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.2.0"
-                    scan="org.apache.karaf.bundle.command.*" />
-
-</blueprint>

http://git-wip-us.apache.org/repos/asf/karaf/blob/2e2b9324/bundle/command/src/test/java/org/apache/karaf/bundle/command/ListServicesTest.java
----------------------------------------------------------------------
diff --git a/bundle/command/src/test/java/org/apache/karaf/bundle/command/ListServicesTest.java b/bundle/command/src/test/java/org/apache/karaf/bundle/command/ListServicesTest.java
index 4ddfbba..2c25a44 100644
--- a/bundle/command/src/test/java/org/apache/karaf/bundle/command/ListServicesTest.java
+++ b/bundle/command/src/test/java/org/apache/karaf/bundle/command/ListServicesTest.java
@@ -38,7 +38,7 @@ public class ListServicesTest {
     @Test
     public void listAllShort() throws Exception {
         System.out.println("listAllShort");
-        listServices.doExecute();
+        listServices.execute();
     }
 
     
@@ -46,7 +46,7 @@ public class ListServicesTest {
     public void listAllLong() throws Exception {
         System.out.println("listAllLong");
         listServices.ids = Arrays.asList(new String[]{"1", "2"});
-        listServices.doExecute();
+        listServices.execute();
     }
 
     @Test
@@ -54,7 +54,7 @@ public class ListServicesTest {
         System.out.println("listAllLongServicesUse");
         listServices.ids = Arrays.asList(new String[]{"1", "2"});
         listServices.inUse = true;
-        listServices.doExecute();
+        listServices.execute();
     }
 
 

http://git-wip-us.apache.org/repos/asf/karaf/blob/2e2b9324/features/command/pom.xml
----------------------------------------------------------------------
diff --git a/features/command/pom.xml b/features/command/pom.xml
index 112d988..debe123 100644
--- a/features/command/pom.xml
+++ b/features/command/pom.xml
@@ -59,7 +59,7 @@
         </dependency>
         <dependency>
             <groupId>org.apache.karaf.shell</groupId>
-            <artifactId>org.apache.karaf.shell.console</artifactId>
+            <artifactId>org.apache.karaf.shell.core</artifactId>
         </dependency>
     </dependencies>
 
@@ -85,17 +85,7 @@
                 <artifactId>maven-bundle-plugin</artifactId>
                 <configuration>
                     <instructions>
-                        <Import-Package>
-                            javax.management,
-                            javax.management.loading,
-                            org.apache.aries.blueprint,
-                            org.osgi.service.blueprint.container,
-                            org.osgi.service.blueprint.reflect,
-                            org.apache.felix.service.command,
-                            org.apache.karaf.shell.commands,
-                            org.apache.karaf.shell.console,
-                            *
-                        </Import-Package>
+                        <Karaf-Commands>org.apache.karaf.features.command.*</Karaf-Commands>
                     </instructions>
                 </configuration>
             </plugin>

http://git-wip-us.apache.org/repos/asf/karaf/blob/2e2b9324/features/command/src/main/java/org/apache/karaf/features/command/FeaturesCommandSupport.java
----------------------------------------------------------------------
diff --git a/features/command/src/main/java/org/apache/karaf/features/command/FeaturesCommandSupport.java b/features/command/src/main/java/org/apache/karaf/features/command/FeaturesCommandSupport.java
index caa8dfa..076650d 100644
--- a/features/command/src/main/java/org/apache/karaf/features/command/FeaturesCommandSupport.java
+++ b/features/command/src/main/java/org/apache/karaf/features/command/FeaturesCommandSupport.java
@@ -17,17 +17,18 @@
 package org.apache.karaf.features.command;
 
 import org.apache.karaf.features.FeaturesService;
-import org.apache.karaf.shell.console.OsgiCommandSupport;
-import org.apache.karaf.shell.inject.Reference;
+import org.apache.karaf.shell.api.action.Action;
+import org.apache.karaf.shell.api.action.lifecycle.Reference;
 
-public abstract class FeaturesCommandSupport extends OsgiCommandSupport {
+public abstract class FeaturesCommandSupport implements Action {
 
     @Reference
     private FeaturesService featuresService;
 
-    protected Object doExecute() throws Exception {
+    @Override
+    public Object execute() throws Exception {
         if (featuresService == null) {
-            featuresService = getService(FeaturesService.class);
+            throw new IllegalStateException("FeaturesService not found");
         }
         doExecute(featuresService);
         return null;

http://git-wip-us.apache.org/repos/asf/karaf/blob/2e2b9324/features/command/src/main/java/org/apache/karaf/features/command/InfoFeatureCommand.java
----------------------------------------------------------------------
diff --git a/features/command/src/main/java/org/apache/karaf/features/command/InfoFeatureCommand.java b/features/command/src/main/java/org/apache/karaf/features/command/InfoFeatureCommand.java
index c030953..7084a6e 100644
--- a/features/command/src/main/java/org/apache/karaf/features/command/InfoFeatureCommand.java
+++ b/features/command/src/main/java/org/apache/karaf/features/command/InfoFeatureCommand.java
@@ -21,18 +21,18 @@ import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.karaf.features.Conditional;
-import org.apache.karaf.features.command.completers.AllFeatureCompleter;
-import org.apache.karaf.shell.commands.Argument;
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.commands.Completer;
-import org.apache.karaf.shell.commands.Option;
 import org.apache.karaf.features.BundleInfo;
+import org.apache.karaf.features.Conditional;
 import org.apache.karaf.features.ConfigFileInfo;
 import org.apache.karaf.features.Dependency;
 import org.apache.karaf.features.Feature;
 import org.apache.karaf.features.FeaturesService;
-import org.apache.karaf.shell.inject.Service;
+import org.apache.karaf.features.command.completers.AllFeatureCompleter;
+import org.apache.karaf.shell.api.action.Argument;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.Completion;
+import org.apache.karaf.shell.api.action.Option;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
 
 @Command(scope = "feature", name = "info", description = "Shows information about selected feature.")
 @Service
@@ -43,7 +43,7 @@ public class InfoFeatureCommand extends FeaturesCommandSupport {
     private static final String CONDITIONAL_CONTENT = "Conditional(%s)";
 
 	@Argument(index = 0, name = "name", description = "The name of the feature", required = true, multiValued = false)
-    @Completer(AllFeatureCompleter.class)
+    @Completion(AllFeatureCompleter.class)
     private String name;
 
     @Argument(index = 1, name = "version", description = "The version of the feature", required = false, multiValued = false)

http://git-wip-us.apache.org/repos/asf/karaf/blob/2e2b9324/features/command/src/main/java/org/apache/karaf/features/command/InstallFeatureCommand.java
----------------------------------------------------------------------
diff --git a/features/command/src/main/java/org/apache/karaf/features/command/InstallFeatureCommand.java b/features/command/src/main/java/org/apache/karaf/features/command/InstallFeatureCommand.java
index 6323a23..e47edf0 100644
--- a/features/command/src/main/java/org/apache/karaf/features/command/InstallFeatureCommand.java
+++ b/features/command/src/main/java/org/apache/karaf/features/command/InstallFeatureCommand.java
@@ -19,13 +19,13 @@ package org.apache.karaf.features.command;
 import java.util.EnumSet;
 import java.util.List;
 
-import org.apache.karaf.features.command.completers.AvailableFeatureCompleter;
-import org.apache.karaf.shell.commands.Completer;
-import org.apache.karaf.shell.commands.Option;
 import org.apache.karaf.features.FeaturesService;
-import org.apache.karaf.shell.commands.Argument;
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.inject.Service;
+import org.apache.karaf.features.command.completers.AvailableFeatureCompleter;
+import org.apache.karaf.shell.api.action.Argument;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.Completion;
+import org.apache.karaf.shell.api.action.Option;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
 
 @Command(scope = "feature", name = "install", description = "Installs a feature with the specified name and version.")
 @Service
@@ -34,7 +34,7 @@ public class InstallFeatureCommand extends FeaturesCommandSupport {
     private static String DEFAULT_VERSION = "0.0.0";
 
     @Argument(index = 0, name = "feature", description = "The name and version of the features to install. A feature id looks like name/version. The version is optional.", required = true, multiValued = true)
-    @Completer(AvailableFeatureCompleter.class)
+    @Completion(AvailableFeatureCompleter.class)
     List<String> features;
     @Option(name = "-c", aliases = "--no-clean", description = "Do not uninstall bundles on failure", required = false, multiValued = false)
     boolean noClean;

http://git-wip-us.apache.org/repos/asf/karaf/blob/2e2b9324/features/command/src/main/java/org/apache/karaf/features/command/ListFeatureVersionsCommand.java
----------------------------------------------------------------------
diff --git a/features/command/src/main/java/org/apache/karaf/features/command/ListFeatureVersionsCommand.java b/features/command/src/main/java/org/apache/karaf/features/command/ListFeatureVersionsCommand.java
index f3f042e..792825c 100644
--- a/features/command/src/main/java/org/apache/karaf/features/command/ListFeatureVersionsCommand.java
+++ b/features/command/src/main/java/org/apache/karaf/features/command/ListFeatureVersionsCommand.java
@@ -22,19 +22,19 @@ import org.apache.karaf.features.Feature;
 import org.apache.karaf.features.FeaturesService;
 import org.apache.karaf.features.Repository;
 import org.apache.karaf.features.command.completers.AllFeatureCompleter;
-import org.apache.karaf.shell.commands.Argument;
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.commands.Completer;
-import org.apache.karaf.shell.commands.Option;
-import org.apache.karaf.shell.inject.Service;
 import org.apache.karaf.shell.table.ShellTable;
+import org.apache.karaf.shell.api.action.Argument;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.Completion;
+import org.apache.karaf.shell.api.action.Option;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
 
 @Command(scope = "feature", name = "version-list", description = "Lists all versions of a feature available from the currently available repositories.")
 @Service
 public class ListFeatureVersionsCommand extends FeaturesCommandSupport {
 
 	@Argument(index = 0, name = "feature", description = "Name of feature.", required = true, multiValued = false)
-    @Completer(AllFeatureCompleter.class)
+    @Completion(AllFeatureCompleter.class)
 	String feature;
 
     @Option(name = "--no-format", description = "Disable table rendered output", required = false, multiValued = false)

http://git-wip-us.apache.org/repos/asf/karaf/blob/2e2b9324/features/command/src/main/java/org/apache/karaf/features/command/ListFeaturesCommand.java
----------------------------------------------------------------------
diff --git a/features/command/src/main/java/org/apache/karaf/features/command/ListFeaturesCommand.java b/features/command/src/main/java/org/apache/karaf/features/command/ListFeaturesCommand.java
index 0a699c9..0cb6d3c 100644
--- a/features/command/src/main/java/org/apache/karaf/features/command/ListFeaturesCommand.java
+++ b/features/command/src/main/java/org/apache/karaf/features/command/ListFeaturesCommand.java
@@ -24,10 +24,10 @@ import java.util.List;
 import org.apache.karaf.features.Feature;
 import org.apache.karaf.features.FeaturesService;
 import org.apache.karaf.features.Repository;
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.commands.Option;
-import org.apache.karaf.shell.inject.Service;
 import org.apache.karaf.shell.table.ShellTable;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.Option;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
 
 @Command(scope = "feature", name = "list", description = "Lists all existing features available from the defined repositories.")
 @Service

http://git-wip-us.apache.org/repos/asf/karaf/blob/2e2b9324/features/command/src/main/java/org/apache/karaf/features/command/RepoAddCommand.java
----------------------------------------------------------------------
diff --git a/features/command/src/main/java/org/apache/karaf/features/command/RepoAddCommand.java b/features/command/src/main/java/org/apache/karaf/features/command/RepoAddCommand.java
index 0594228..16faf42 100644
--- a/features/command/src/main/java/org/apache/karaf/features/command/RepoAddCommand.java
+++ b/features/command/src/main/java/org/apache/karaf/features/command/RepoAddCommand.java
@@ -20,18 +20,18 @@ import java.net.URI;
 
 import org.apache.karaf.features.FeaturesService;
 import org.apache.karaf.features.command.completers.AvailableRepoNameCompleter;
-import org.apache.karaf.shell.commands.Argument;
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.commands.Completer;
-import org.apache.karaf.shell.commands.Option;
-import org.apache.karaf.shell.inject.Service;
+import org.apache.karaf.shell.api.action.Argument;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.Completion;
+import org.apache.karaf.shell.api.action.Option;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
 
 @Command(scope = "feature", name = "repo-add", description = "Add a features repository")
 @Service
 public class RepoAddCommand extends FeaturesCommandSupport {
 
     @Argument(index = 0, name = "name/url", description = "Shortcut name of the features repository or the full URL", required = true, multiValued = false)
-    @Completer(AvailableRepoNameCompleter.class)
+    @Completion(AvailableRepoNameCompleter.class)
     private String nameOrUrl;
     
     @Argument(index = 1, name = "version", description = "The version of the features repository if using features repository name as first argument. It should be empty if using the URL", required = false, multiValued = false)

http://git-wip-us.apache.org/repos/asf/karaf/blob/2e2b9324/features/command/src/main/java/org/apache/karaf/features/command/RepoListCommand.java
----------------------------------------------------------------------
diff --git a/features/command/src/main/java/org/apache/karaf/features/command/RepoListCommand.java b/features/command/src/main/java/org/apache/karaf/features/command/RepoListCommand.java
index b71f866..af180bd 100644
--- a/features/command/src/main/java/org/apache/karaf/features/command/RepoListCommand.java
+++ b/features/command/src/main/java/org/apache/karaf/features/command/RepoListCommand.java
@@ -21,11 +21,11 @@ import java.util.List;
 
 import org.apache.karaf.features.FeaturesService;
 import org.apache.karaf.features.Repository;
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.commands.Option;
-import org.apache.karaf.shell.console.MultiException;
-import org.apache.karaf.shell.inject.Service;
 import org.apache.karaf.shell.table.ShellTable;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.Option;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
+import org.apache.karaf.shell.support.MultiException;
 
 @Command(scope = "feature", name = "repo-list", description = "Displays a list of all defined repositories.")
 @Service

http://git-wip-us.apache.org/repos/asf/karaf/blob/2e2b9324/features/command/src/main/java/org/apache/karaf/features/command/RepoRefreshCommand.java
----------------------------------------------------------------------
diff --git a/features/command/src/main/java/org/apache/karaf/features/command/RepoRefreshCommand.java b/features/command/src/main/java/org/apache/karaf/features/command/RepoRefreshCommand.java
index 6930a93..8c7ed79 100644
--- a/features/command/src/main/java/org/apache/karaf/features/command/RepoRefreshCommand.java
+++ b/features/command/src/main/java/org/apache/karaf/features/command/RepoRefreshCommand.java
@@ -23,14 +23,14 @@ import java.util.List;
 import org.apache.karaf.features.FeaturesService;
 import org.apache.karaf.features.Repository;
 import org.apache.karaf.features.command.completers.InstalledRepoUriCompleter;
-import org.apache.karaf.shell.commands.Argument;
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.commands.Completer;
+import org.apache.karaf.shell.api.action.Argument;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.Completion;
 
 @Command(scope = "feature", name = "repo-refresh", description = "Refresh a features repository")
 public class RepoRefreshCommand extends FeaturesCommandSupport {
     @Argument(index = 0, name = "Feature name or uri", description = "Shortcut name of the feature repository or the full URI", required = false, multiValued = false)
-    @Completer(InstalledRepoUriCompleter.class)
+    @Completion(InstalledRepoUriCompleter.class)
     private String nameOrUrl;
     
     @Argument(index = 1, name = "Feature version", description = "The version of the feature if using the feature name. Should be empty if using the uri", required = false, multiValued = false)

http://git-wip-us.apache.org/repos/asf/karaf/blob/2e2b9324/features/command/src/main/java/org/apache/karaf/features/command/RepoRemoveCommand.java
----------------------------------------------------------------------
diff --git a/features/command/src/main/java/org/apache/karaf/features/command/RepoRemoveCommand.java b/features/command/src/main/java/org/apache/karaf/features/command/RepoRemoveCommand.java
index 4c14f66..0710b72 100644
--- a/features/command/src/main/java/org/apache/karaf/features/command/RepoRemoveCommand.java
+++ b/features/command/src/main/java/org/apache/karaf/features/command/RepoRemoveCommand.java
@@ -18,21 +18,21 @@ package org.apache.karaf.features.command;
 
 import java.net.URI;
 
-import org.apache.karaf.features.command.completers.InstalledRepoNameCompleter;
-import org.apache.karaf.shell.commands.Argument;
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.commands.Completer;
-import org.apache.karaf.shell.commands.Option;
 import org.apache.karaf.features.FeaturesService;
 import org.apache.karaf.features.Repository;
-import org.apache.karaf.shell.inject.Service;
+import org.apache.karaf.features.command.completers.InstalledRepoNameCompleter;
+import org.apache.karaf.shell.api.action.Argument;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.Completion;
+import org.apache.karaf.shell.api.action.Option;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
 
 @Command(scope = "feature", name = "repo-remove", description = "Removes the specified repository features service.")
 @Service
 public class RepoRemoveCommand extends FeaturesCommandSupport {
 
     @Argument(index = 0, name = "repository", description = "Name or url of the repository to remove.", required = true, multiValued = false)
-    @Completer(InstalledRepoNameCompleter.class)
+    @Completion(InstalledRepoNameCompleter.class)
     private String repository;
 
     @Option(name = "-u", aliases = { "--uninstall-all" }, description = "Uninstall all features from the repository", required = false, multiValued = false)

http://git-wip-us.apache.org/repos/asf/karaf/blob/2e2b9324/features/command/src/main/java/org/apache/karaf/features/command/UninstallFeatureCommand.java
----------------------------------------------------------------------
diff --git a/features/command/src/main/java/org/apache/karaf/features/command/UninstallFeatureCommand.java b/features/command/src/main/java/org/apache/karaf/features/command/UninstallFeatureCommand.java
index e22d2f3..b56eac6 100644
--- a/features/command/src/main/java/org/apache/karaf/features/command/UninstallFeatureCommand.java
+++ b/features/command/src/main/java/org/apache/karaf/features/command/UninstallFeatureCommand.java
@@ -16,23 +16,23 @@
  */
 package org.apache.karaf.features.command;
 
-import org.apache.karaf.features.command.completers.InstalledFeatureCompleter;
-import org.apache.karaf.shell.commands.Argument;
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.features.FeaturesService;
-import org.apache.karaf.shell.commands.Completer;
-import org.apache.karaf.shell.commands.Option;
-import org.apache.karaf.shell.inject.Service;
-
 import java.util.EnumSet;
 import java.util.List;
 
+import org.apache.karaf.features.FeaturesService;
+import org.apache.karaf.features.command.completers.InstalledFeatureCompleter;
+import org.apache.karaf.shell.api.action.Argument;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.Completion;
+import org.apache.karaf.shell.api.action.Option;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
+
 @Command(scope = "feature", name = "uninstall", description = "Uninstalls a feature with the specified name and version.")
 @Service
 public class UninstallFeatureCommand extends FeaturesCommandSupport {
 
     @Argument(index = 0, name = "features", description = "The name and version of the features to uninstall. A feature id looks like name/version. The version is optional.", required = true, multiValued = true)
-    @Completer(InstalledFeatureCompleter.class)
+    @Completion(InstalledFeatureCompleter.class)
     List<String> features;
 
     @Option(name = "-r", aliases = "--no-auto-refresh", description = "Do not automatically refresh bundles", required = false, multiValued = false)

http://git-wip-us.apache.org/repos/asf/karaf/blob/2e2b9324/features/command/src/main/java/org/apache/karaf/features/command/completers/AllFeatureCompleter.java
----------------------------------------------------------------------
diff --git a/features/command/src/main/java/org/apache/karaf/features/command/completers/AllFeatureCompleter.java b/features/command/src/main/java/org/apache/karaf/features/command/completers/AllFeatureCompleter.java
index 08fba41..7444b95 100644
--- a/features/command/src/main/java/org/apache/karaf/features/command/completers/AllFeatureCompleter.java
+++ b/features/command/src/main/java/org/apache/karaf/features/command/completers/AllFeatureCompleter.java
@@ -17,7 +17,7 @@
 package org.apache.karaf.features.command.completers;
 
 import org.apache.karaf.features.Feature;
-import org.apache.karaf.shell.inject.Service;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
 
 /**
  * {@link org.apache.karaf.shell.console.Completer} for available features.

http://git-wip-us.apache.org/repos/asf/karaf/blob/2e2b9324/features/command/src/main/java/org/apache/karaf/features/command/completers/AvailableFeatureCompleter.java
----------------------------------------------------------------------
diff --git a/features/command/src/main/java/org/apache/karaf/features/command/completers/AvailableFeatureCompleter.java b/features/command/src/main/java/org/apache/karaf/features/command/completers/AvailableFeatureCompleter.java
index 22ec700..79cd280 100644
--- a/features/command/src/main/java/org/apache/karaf/features/command/completers/AvailableFeatureCompleter.java
+++ b/features/command/src/main/java/org/apache/karaf/features/command/completers/AvailableFeatureCompleter.java
@@ -17,7 +17,7 @@
 package org.apache.karaf.features.command.completers;
 
 import org.apache.karaf.features.Feature;
-import org.apache.karaf.shell.inject.Service;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
 
 /**
  * {@link org.apache.karaf.shell.console.Completer} for features not installed yet.

http://git-wip-us.apache.org/repos/asf/karaf/blob/2e2b9324/features/command/src/main/java/org/apache/karaf/features/command/completers/AvailableRepoNameCompleter.java
----------------------------------------------------------------------
diff --git a/features/command/src/main/java/org/apache/karaf/features/command/completers/AvailableRepoNameCompleter.java b/features/command/src/main/java/org/apache/karaf/features/command/completers/AvailableRepoNameCompleter.java
index 7797715..acefe77 100644
--- a/features/command/src/main/java/org/apache/karaf/features/command/completers/AvailableRepoNameCompleter.java
+++ b/features/command/src/main/java/org/apache/karaf/features/command/completers/AvailableRepoNameCompleter.java
@@ -20,11 +20,12 @@ import java.util.Arrays;
 import java.util.List;
 
 import org.apache.karaf.features.FeaturesService;
-import org.apache.karaf.features.internal.FeatureFinder;
-import org.apache.karaf.shell.console.Completer;
-import org.apache.karaf.shell.console.completer.StringsCompleter;
-import org.apache.karaf.shell.inject.Reference;
-import org.apache.karaf.shell.inject.Service;
+import org.apache.karaf.shell.api.action.lifecycle.Reference;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
+import org.apache.karaf.shell.api.console.CommandLine;
+import org.apache.karaf.shell.api.console.Completer;
+import org.apache.karaf.shell.api.console.Session;
+import org.apache.karaf.shell.support.completers.StringsCompleter;
 
 /**
  * Shows the list of feature repos that can be installed with their short name
@@ -39,9 +40,9 @@ public class AvailableRepoNameCompleter implements Completer {
         this.featuresService = featuresService;
     }
 
-    public int complete(final String buffer, final int cursor, @SuppressWarnings("rawtypes") final List candidates) {
+    public int complete(Session session, CommandLine commandLine, final List<String> candidates) {
         StringsCompleter delegate = new StringsCompleter(Arrays.asList(featuresService.getRepositoryNames()));
-        return delegate.complete(buffer, cursor, candidates);
+        return delegate.complete(session, commandLine, candidates);
     }
 
 }

http://git-wip-us.apache.org/repos/asf/karaf/blob/2e2b9324/features/command/src/main/java/org/apache/karaf/features/command/completers/FeatureCompleterSupport.java
----------------------------------------------------------------------
diff --git a/features/command/src/main/java/org/apache/karaf/features/command/completers/FeatureCompleterSupport.java b/features/command/src/main/java/org/apache/karaf/features/command/completers/FeatureCompleterSupport.java
index 3dd1e2b..d01e5af 100644
--- a/features/command/src/main/java/org/apache/karaf/features/command/completers/FeatureCompleterSupport.java
+++ b/features/command/src/main/java/org/apache/karaf/features/command/completers/FeatureCompleterSupport.java
@@ -20,9 +20,11 @@ import java.util.List;
 
 import org.apache.karaf.features.Feature;
 import org.apache.karaf.features.FeaturesService;
-import org.apache.karaf.shell.console.Completer;
-import org.apache.karaf.shell.console.completer.StringsCompleter;
-import org.apache.karaf.shell.inject.Reference;
+import org.apache.karaf.shell.api.action.lifecycle.Reference;
+import org.apache.karaf.shell.api.console.CommandLine;
+import org.apache.karaf.shell.api.console.Completer;
+import org.apache.karaf.shell.api.console.Session;
+import org.apache.karaf.shell.support.completers.StringsCompleter;
 
 /**
  * Base completer for feature commands.
@@ -39,7 +41,7 @@ public abstract class FeatureCompleterSupport implements Completer {
         this.featuresService = featuresService;
     }
 
-    public int complete(final String buffer, final int cursor, @SuppressWarnings("rawtypes") final List candidates) {
+    public int complete(Session session, final CommandLine commandLine, final List<String> candidates) {
         StringsCompleter delegate = new StringsCompleter();
         try {
             for (Feature feature : featuresService.listFeatures()) {
@@ -50,7 +52,7 @@ public abstract class FeatureCompleterSupport implements Completer {
         } catch (Exception e) {
             // Ignore
         }
-        return delegate.complete(buffer, cursor, candidates);
+        return delegate.complete(session, commandLine, candidates);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/karaf/blob/2e2b9324/features/command/src/main/java/org/apache/karaf/features/command/completers/InstalledFeatureCompleter.java
----------------------------------------------------------------------
diff --git a/features/command/src/main/java/org/apache/karaf/features/command/completers/InstalledFeatureCompleter.java b/features/command/src/main/java/org/apache/karaf/features/command/completers/InstalledFeatureCompleter.java
index e61940f..4c937db 100644
--- a/features/command/src/main/java/org/apache/karaf/features/command/completers/InstalledFeatureCompleter.java
+++ b/features/command/src/main/java/org/apache/karaf/features/command/completers/InstalledFeatureCompleter.java
@@ -17,7 +17,7 @@
 package org.apache.karaf.features.command.completers;
 
 import org.apache.karaf.features.Feature;
-import org.apache.karaf.shell.inject.Service;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
 
 /**
  * {@link org.apache.karaf.shell.console.Completer} for installed features.