diff --git a/tools/nfdc/command-arguments.hpp b/tools/nfdc/command-arguments.hpp
index a949f99..164a672 100644
--- a/tools/nfdc/command-arguments.hpp
+++ b/tools/nfdc/command-arguments.hpp
@@ -31,7 +31,6 @@
 
 #include <ndn-cxx/encoding/nfd-constants.hpp>
 
-#include <boost/any.hpp>
 #include <boost/logic/tribool.hpp>
 
 namespace nfd {
@@ -43,19 +42,9 @@
 
 /** \brief contains named command arguments
  */
-class CommandArguments : public std::map<std::string, boost::any>
+class CommandArguments : public std::map<std::string, ndn::any>
 {
 public:
-  /** \return the argument value, or a default value if the argument is omitted on command line
-   */
-  template<typename T>
-  T
-  get(const std::string& key, const T& defaultValue = T()) const
-  {
-    auto i = find(key);
-    return i == end() ? defaultValue : boost::any_cast<T>(i->second);
-  }
-
   /** \return the argument value, or nullopt if the argument is omitted on command line
    */
   template<typename T>
@@ -63,10 +52,16 @@
   getOptional(const std::string& key) const
   {
     auto i = find(key);
-    if (i == end()) {
-      return nullopt;
-    }
-    return boost::any_cast<T>(i->second);
+    return i == end() ? nullopt : ndn::make_optional(ndn::any_cast<T>(i->second));
+  }
+
+  /** \return the argument value, or a default value if the argument is omitted on command line
+   */
+  template<typename T>
+  T
+  get(const std::string& key, const T& defaultValue = T()) const
+  {
+    return getOptional<T>(key).value_or(defaultValue);
   }
 
   /** \brief get an optional boolean argument as tribool
@@ -76,10 +71,7 @@
   getTribool(const std::string& key) const
   {
     auto value = getOptional<bool>(key);
-    if (value) {
-      return *value;
-    }
-    return boost::logic::indeterminate;
+    return value ? boost::logic::tribool(*value) : boost::logic::indeterminate;
   }
 };
 
diff --git a/tools/nfdc/command-definition.cpp b/tools/nfdc/command-definition.cpp
index 27b30f2..9dce67a 100644
--- a/tools/nfdc/command-definition.cpp
+++ b/tools/nfdc/command-definition.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2017,  Regents of the University of California,
+ * Copyright (c) 2014-2018,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -24,6 +24,7 @@
  */
 
 #include "command-definition.hpp"
+
 #include <ndn-cxx/util/logger.hpp>
 
 namespace nfd {
@@ -240,18 +241,17 @@
   BOOST_THROW_EXCEPTION(std::invalid_argument("unrecognized FacePersistency '" + s + "'"));
 }
 
-boost::any
+ndn::any
 CommandDefinition::parseValue(ArgValueType valueType, const std::string& token) const
 {
   switch (valueType) {
     case ArgValueType::NONE:
     case ArgValueType::ANY:
       BOOST_ASSERT(false);
-      return boost::any();
+      return {};
 
-    case ArgValueType::BOOLEAN: {
+    case ArgValueType::BOOLEAN:
       return parseBoolean(token);
-    }
 
     case ArgValueType::UNSIGNED: {
       // boost::lexical_cast<uint64_t> will accept negative number
@@ -290,7 +290,7 @@
   }
 
   BOOST_ASSERT(false);
-  return boost::any();
+  return {};
 }
 
 } // namespace nfdc
diff --git a/tools/nfdc/command-definition.hpp b/tools/nfdc/command-definition.hpp
index 5661ff2..c512948 100644
--- a/tools/nfdc/command-definition.hpp
+++ b/tools/nfdc/command-definition.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2017,  Regents of the University of California,
+ * Copyright (c) 2014-2018,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -130,11 +130,7 @@
   class Error : public std::invalid_argument
   {
   public:
-    explicit
-    Error(const std::string& what)
-      : std::invalid_argument(what)
-    {
-    }
+    using std::invalid_argument::invalid_argument;
   };
 
   CommandDefinition(const std::string& noun, const std::string& verb);
@@ -195,13 +191,12 @@
   parse(const std::vector<std::string>& tokens, size_t start = 0) const;
 
 private:
-  boost::any
+  ndn::any
   parseValue(ArgValueType valueType, const std::string& token) const;
 
 private:
   std::string m_noun;
   std::string m_verb;
-
   std::string m_title;
 
   struct Arg
@@ -211,8 +206,7 @@
     bool isRequired;
     std::string metavar;
   };
-  typedef std::map<std::string, Arg> ArgMap;
-  ArgMap m_args;
+  std::map<std::string, Arg> m_args;
   std::set<std::string> m_requiredArgs;
   std::vector<std::string> m_positionalArgs;
 };
diff --git a/tools/nfdc/face-module.cpp b/tools/nfdc/face-module.cpp
index ae6ba16..7bde8bf 100644
--- a/tools/nfdc/face-module.cpp
+++ b/tools/nfdc/face-module.cpp
@@ -310,10 +310,8 @@
 void
 FaceModule::destroy(ExecuteContext& ctx)
 {
-  const boost::any& faceIdOrUri = ctx.args.at("face");
-
   FindFace findFace(ctx);
-  FindFace::Code res = findFace.execute(faceIdOrUri);
+  FindFace::Code res = findFace.execute(ctx.args.at("face"));
 
   ctx.exitCode = static_cast<int>(res);
   switch (res) {
diff --git a/tools/nfdc/find-face.cpp b/tools/nfdc/find-face.cpp
index 918693f..bb6183d 100644
--- a/tools/nfdc/find-face.cpp
+++ b/tools/nfdc/find-face.cpp
@@ -56,14 +56,14 @@
 }
 
 FindFace::Code
-FindFace::execute(const boost::any& faceIdOrUri, bool allowMulti)
+FindFace::execute(const ndn::any& faceIdOrUri, bool allowMulti)
 {
-  const uint64_t* faceId = boost::any_cast<uint64_t>(&faceIdOrUri);
+  const uint64_t* faceId = ndn::any_cast<uint64_t>(&faceIdOrUri);
   if (faceId != nullptr) {
     return this->execute(*faceId);
   }
   else {
-    return this->execute(boost::any_cast<FaceUri>(faceIdOrUri), allowMulti);
+    return this->execute(ndn::any_cast<FaceUri>(faceIdOrUri), allowMulti);
   }
 }
 
diff --git a/tools/nfdc/find-face.hpp b/tools/nfdc/find-face.hpp
index 68e5f7b..ea1245b 100644
--- a/tools/nfdc/find-face.hpp
+++ b/tools/nfdc/find-face.hpp
@@ -71,12 +71,12 @@
   execute(uint64_t faceId);
 
   /** \brief find face by FaceId or FaceUri
-   *  \param faceIdOrUri a boost::any that contains uint64_t or FaceUri
+   *  \param faceIdOrUri a ndn::any that contains uint64_t or FaceUri
    *  \param allowMulti effective only if \p faceIdOrUri contains a FaceUri
-   *  \throw boost::bad_any_cast faceIdOrUri is neither uint64_t nor FaceUri
+   *  \throw ndn::bad_any_cast faceIdOrUri is neither uint64_t nor FaceUri
    */
   Code
-  execute(const boost::any& faceIdOrUri, bool allowMulti = false);
+  execute(const ndn::any& faceIdOrUri, bool allowMulti = false);
 
   /** \brief find face by FaceQueryFilter
    *  \pre execute has not been invoked
diff --git a/tools/nfdc/rib-module.cpp b/tools/nfdc/rib-module.cpp
index 47acd0c..b41d33a 100644
--- a/tools/nfdc/rib-module.cpp
+++ b/tools/nfdc/rib-module.cpp
@@ -144,7 +144,7 @@
 RibModule::add(ExecuteContext& ctx)
 {
   auto prefix = ctx.args.get<Name>("prefix");
-  const boost::any& nexthop = ctx.args.at("nexthop");
+  auto nexthop = ctx.args.at("nexthop");
   auto origin = ctx.args.get<RouteOrigin>("origin", ndn::nfd::ROUTE_ORIGIN_STATIC);
   auto cost = ctx.args.get<uint64_t>("cost", 0);
   bool wantChildInherit = !ctx.args.get<bool>("no-inherit", false);
@@ -212,7 +212,7 @@
 RibModule::remove(ExecuteContext& ctx)
 {
   auto prefix = ctx.args.get<Name>("prefix");
-  const boost::any& nexthop = ctx.args.at("nexthop");
+  auto nexthop = ctx.args.at("nexthop");
   auto origin = ctx.args.get<RouteOrigin>("origin", ndn::nfd::ROUTE_ORIGIN_STATIC);
 
   FindFace findFace(ctx);
