Added some CLI commands and fixed pom.xml and features.xml to use commons-lang 2.6 (bundle)
diff --git a/cli/src/main/java/org/onlab/onos/cli/net/DeviceIdCompleter.java b/cli/src/main/java/org/onlab/onos/cli/net/DeviceIdCompleter.java
new file mode 100644
index 0000000..2614d51
--- /dev/null
+++ b/cli/src/main/java/org/onlab/onos/cli/net/DeviceIdCompleter.java
@@ -0,0 +1,34 @@
+package org.onlab.onos.cli.net;
+
+import org.apache.karaf.shell.console.Completer;
+import org.apache.karaf.shell.console.completer.StringsCompleter;
+import org.onlab.onos.cli.AbstractShellCommand;
+import org.onlab.onos.net.Device;
+import org.onlab.onos.net.device.DeviceService;
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.SortedSet;
+
+/**
+ * Device ID completer.
+ */
+public class DeviceIdCompleter implements Completer {
+    @Override
+    public int complete(String buffer, int cursor, List<String> candidates) {
+        // Delegate string completer
+        StringsCompleter delegate = new StringsCompleter();
+
+        // Fetch our service and feed it's offerings to the string completer
+        DeviceService service = AbstractShellCommand.get(DeviceService.class);
+        Iterator<Device> it = service.getDevices().iterator();
+        SortedSet<String> strings = delegate.getStrings();
+        while (it.hasNext()) {
+            strings.add(it.next().id().uri().toString());
+        }
+
+        // Now let the completer do the work for figuring out what to offer.
+        return delegate.complete(buffer, cursor, candidates);
+    }
+
+}
diff --git a/cli/src/main/java/org/onlab/onos/cli/net/DevicePortsListCommand.java b/cli/src/main/java/org/onlab/onos/cli/net/DevicePortsListCommand.java
new file mode 100644
index 0000000..f09e39a
--- /dev/null
+++ b/cli/src/main/java/org/onlab/onos/cli/net/DevicePortsListCommand.java
@@ -0,0 +1,33 @@
+package org.onlab.onos.cli.net;
+
+import org.apache.karaf.shell.commands.Argument;
+import org.apache.karaf.shell.commands.Command;
+import org.onlab.onos.cli.AbstractShellCommand;
+import org.onlab.onos.net.Port;
+import org.onlab.onos.net.device.DeviceService;
+
+import static org.onlab.onos.net.DeviceId.deviceId;
+
+/**
+ * Lists all infrastructure links.
+ */
+@Command(scope = "onos", name = "ports",
+         description = "Lists all ports of a device")
+public class DevicePortsListCommand extends AbstractShellCommand {
+
+    private static final String FMT = "port=%s, state=%s";
+
+    @Argument(index = 0, name = "deviceId", description = "Device ID",
+              required = true, multiValued = false)
+    String deviceId = null;
+
+    @Override
+    protected Object doExecute() throws Exception {
+        DeviceService service = getService(DeviceService.class);
+        Iterable<Port> ports = service.getPorts(deviceId(deviceId));
+        for (Port port : ports) {
+            print(FMT, port.number(), port.isEnabled() ? "enabled" : "disabled");
+        }
+        return null;
+    }
+}
diff --git a/cli/src/main/java/org/onlab/onos/cli/net/DevicesListCommand.java b/cli/src/main/java/org/onlab/onos/cli/net/DevicesListCommand.java
new file mode 100644
index 0000000..b3dd18d
--- /dev/null
+++ b/cli/src/main/java/org/onlab/onos/cli/net/DevicesListCommand.java
@@ -0,0 +1,26 @@
+package org.onlab.onos.cli.net;
+
+import org.apache.karaf.shell.commands.Command;
+import org.onlab.onos.cli.AbstractShellCommand;
+import org.onlab.onos.net.Device;
+import org.onlab.onos.net.device.DeviceService;
+
+/**
+ * Lists all infrastructure devices.
+ */
+@Command(scope = "onos", name = "devices",
+         description = "Lists all infrastructure devices")
+public class DevicesListCommand extends AbstractShellCommand {
+
+    private static final String FMT =
+            "id=%s, type=%s, mfr=%s, hw=%s, sw=%s, serial=%s";
+
+    @Override
+    protected Object doExecute() throws Exception {
+        for (Device device : getService(DeviceService.class).getDevices()) {
+            print(FMT, device.id(), device.type(), device.manufacturer(),
+                  device.hwVersion(), device.swVersion(), device.serialNumber());
+        }
+        return null;
+    }
+}
diff --git a/cli/src/main/java/org/onlab/onos/cli/net/LinksListCommand.java b/cli/src/main/java/org/onlab/onos/cli/net/LinksListCommand.java
new file mode 100644
index 0000000..87be1f2
--- /dev/null
+++ b/cli/src/main/java/org/onlab/onos/cli/net/LinksListCommand.java
@@ -0,0 +1,36 @@
+package org.onlab.onos.cli.net;
+
+import org.apache.karaf.shell.commands.Argument;
+import org.apache.karaf.shell.commands.Command;
+import org.onlab.onos.cli.AbstractShellCommand;
+import org.onlab.onos.net.Link;
+import org.onlab.onos.net.link.LinkService;
+
+import static org.onlab.onos.net.DeviceId.deviceId;
+
+/**
+ * Lists all infrastructure links.
+ */
+@Command(scope = "onos", name = "links",
+         description = "Lists all infrastructure links")
+public class LinksListCommand extends AbstractShellCommand {
+
+    private static final String FMT = "src=%s/%s, dst=%s/%s, type=%s";
+
+    @Argument(index = 0, name = "deviceId", description = "Device ID",
+              required = false, multiValued = false)
+    String deviceId = null;
+
+
+    @Override
+    protected Object doExecute() throws Exception {
+        LinkService service = getService(LinkService.class);
+        Iterable<Link> links = deviceId != null ?
+                service.getDeviceLinks(deviceId(deviceId)) : service.getLinks();
+        for (Link link : links) {
+            print(FMT, link.src().deviceId(), link.src().port(),
+                  link.dst().deviceId(), link.dst().port(), link.type());
+        }
+        return null;
+    }
+}