diff --git a/cli/src/main/java/org/onosproject/cli/net/OpticalConnectPointCompleter.java b/cli/src/main/java/org/onosproject/cli/net/OpticalConnectPointCompleter.java
new file mode 100644
index 0000000..869d2c9
--- /dev/null
+++ b/cli/src/main/java/org/onosproject/cli/net/OpticalConnectPointCompleter.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2019-present Open Networking Foundation
+ *
+ * Licensed 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.
+ */
+package org.onosproject.cli.net;
+
+import org.apache.karaf.shell.api.console.CommandLine;
+import org.apache.karaf.shell.api.console.Completer;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
+import org.apache.karaf.shell.api.console.Session;
+import org.apache.karaf.shell.support.completers.StringsCompleter;
+import org.onosproject.cli.AbstractShellCommand;
+import org.onosproject.net.Device;
+import org.onosproject.net.Port;
+import org.onosproject.net.device.DeviceService;
+
+import java.util.List;
+import java.util.SortedSet;
+
+/**
+ * Optical ConnectPoint completer.
+ */
+@Service
+public class OpticalConnectPointCompleter implements Completer {
+    @Override
+    public int complete(Session session, CommandLine commandLine, 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);
+
+        // Generate the device ID/port number identifiers
+        for (Device device : service.getDevices()) {
+            SortedSet<String> strings = delegate.getStrings();
+            for (Port port : service.getPorts(device.id())) {
+                if (!port.number().isLogical() && (port.type().equals(Port.Type.OCH) ||
+                        port.type().equals(Port.Type.OMS) || port.type().equals(Port.Type.OTU))) {
+                    strings.add(device.id().toString() + "/" + port.number());
+                }
+            }
+        }
+
+        // Now let the completer do the work for figuring out what to offer.
+        return delegate.complete(session, commandLine, candidates);
+    }
+}
diff --git a/cli/src/main/java/org/onosproject/cli/net/PowerConfigCommand.java b/cli/src/main/java/org/onosproject/cli/net/PowerConfigCommand.java
index b7d5020..c85d0ea 100644
--- a/cli/src/main/java/org/onosproject/cli/net/PowerConfigCommand.java
+++ b/cli/src/main/java/org/onosproject/cli/net/PowerConfigCommand.java
@@ -24,6 +24,7 @@
 import org.onosproject.cli.AbstractShellCommand;
 import org.onosproject.net.ConnectPoint;
 import org.onosproject.net.Device;
+import org.onosproject.net.Direction;
 import org.onosproject.net.Port;
 import org.onosproject.net.behaviour.PowerConfig;
 import org.onosproject.net.device.DeviceService;
@@ -52,7 +53,7 @@
 
     @Argument(index = 1, name = "connection point", description = "{DeviceID}/{PortNumber}",
             required = true, multiValued = false)
-    @Completion(ConnectPointCompleter.class)
+    @Completion(OpticalConnectPointCompleter.class)
     private String connectPoint = null;
 
     @Argument(index = 2, name = "value", description = "target-output-power value. Unit: dBm",
@@ -68,18 +69,25 @@
             print("[ERROR] %s does not exist", cp);
             return;
         }
+        if (!port.type().equals(Port.Type.OCH) &&
+                !port.type().equals(Port.Type.OTU) &&
+                !port.type().equals(Port.Type.OMS)) {
+            log.warn("The power of selected port %s isn't editable.", port.number().toString());
+            print("The power of selected port %s isn't editable.", port.number().toString());
+            return;
+        }
         Device device = deviceService.getDevice(cp.deviceId());
         PowerConfig powerConfig = device.as(PowerConfig.class);
         // FIXME the parameter "component" equals NULL now, because there is one-to-one mapping between
         //  <component> and <optical-channel>.
         if (operation.equals("get")) {
-            Optional<Long> val = powerConfig.getTargetPower(cp.port(), null);
+            Optional<Long> val = powerConfig.getTargetPower(cp.port(), Direction.ALL);
             long power = val.isPresent() ? val.get() : Long.MIN_VALUE;
             print("The target-output-power value in port %s on device %s is %d.",
                     cp.port().toString(), cp.deviceId().toString(), power);
         } else if (operation.equals("edit-config")) {
             checkNotNull(value);
-            powerConfig.setTargetPower(cp.port(), null, value);
+            powerConfig.setTargetPower(cp.port(), Direction.ALL, value);
         } else {
             log.warn("Operation {} are not supported now.", operation);
         }
