diff --git a/vpd_tool.cpp b/vpd_tool.cpp
index e0e010a..9e76331 100644
--- a/vpd_tool.cpp
+++ b/vpd_tool.cpp
@@ -1,11 +1,16 @@
+#include "utils.hpp"
 #include "vpd_tool_impl.hpp"
 
 #include <CLI/CLI.hpp>
+#include <filesystem>
 #include <fstream>
 #include <iostream>
 
 using namespace CLI;
 using namespace std;
+namespace fs = std::filesystem;
+using namespace openpower::vpd;
+using json = nlohmann::json;
 
 int main(int argc, char** argv)
 {
@@ -17,6 +22,7 @@
     string recordName{};
     string keyword{};
     string val{};
+    string path{};
 
     auto object =
         app.add_option("--object, -O", objectPath, "Enter the Object Path");
@@ -27,6 +33,10 @@
         "--value, -V", val,
         "Enter the value. The value to be updated should be either in ascii or "
         "in hex. ascii eg: 01234; hex eg: 0x30313233");
+    auto pathOption =
+        app.add_option("--path, -P", path,
+                       "Path - if hardware option is used, give either EEPROM "
+                       "path/Object path; if not give the object path");
 
     auto dumpObjFlag =
         app.add_flag("--dumpObject, -o",
@@ -55,7 +65,7 @@
                "--writeKeyword/-w/--updateKeyword/-u "
                "--object/-O object-name --record/-R record-name --keyword/-K "
                "keyword-name --value/-V value-to-be-updated }")
-            ->needs(object)
+            ->needs(pathOption)
             ->needs(record)
             ->needs(kw)
             ->needs(valOption);
@@ -63,6 +73,12 @@
     auto forceResetFlag = app.add_flag(
         "--forceReset, -f, -F", "Force Collect for Hardware. { vpd-tool-exe "
                                 "--forceReset/-f/-F }");
+    auto Hardware = app.add_flag(
+        "--Hardware, -H",
+        "This is a supplementary flag to read/write directly from/to hardware. "
+        "Enter the hardware path while using the object option in "
+        "corresponding read/write flags. This --Hardware flag is to be given "
+        "along with readKeyword/writeKeyword.");
 
     CLI11_PARSE(app, argc, argv);
 
@@ -71,6 +87,28 @@
 
     try
     {
+        if (*Hardware)
+        {
+            if (!fs::exists(path)) // dbus object path
+            {
+                string p = getVpdFilePath(INVENTORY_JSON_SYM_LINK, path);
+                if (p.empty()) // object path not present in inventory json
+                {
+                    string errorMsg = "Invalid object path : ";
+                    errorMsg += path;
+                    errorMsg += ". Unable to find the corresponding EEPROM "
+                                "path for the given object path : ";
+                    errorMsg += path;
+                    errorMsg += " in the vpd inventory json : ";
+                    errorMsg += INVENTORY_JSON_SYM_LINK;
+                    throw runtime_error(errorMsg);
+                }
+                else
+                {
+                    path = p;
+                }
+            }
+        }
         if (*dumpObjFlag)
         {
             VpdTool vpdToolObj(move(objectPath));
@@ -90,10 +128,10 @@
             vpdToolObj.readKeyword();
         }
 
-        else if (*writeFlag)
+        else if (*writeFlag && !*Hardware)
         {
-            VpdTool vpdToolObj(move(objectPath), move(recordName),
-                               move(keyword), move(val));
+            VpdTool vpdToolObj(move(path), move(recordName), move(keyword),
+                               move(val));
             rc = vpdToolObj.updateKeyword();
         }
 
@@ -103,6 +141,13 @@
             vpdToolObj.forceReset(jsObject);
         }
 
+        else if (*writeFlag && *Hardware)
+        {
+            VpdTool vpdToolObj(move(path), move(recordName), move(keyword),
+                               move(val));
+            rc = vpdToolObj.updateHardware();
+        }
+
         else
         {
             throw runtime_error("One of the valid options is required. Refer "
