diff --git a/src/utils/clean-cid.js b/src/utils/clean-cid.js
index <HASH>..<HASH> 100644
--- a/src/utils/clean-cid.js
+++ b/src/utils/clean-cid.js
@@ -7,6 +7,9 @@ module.exports = function (cid) {
   if (Buffer.isBuffer(cid)) {
     cid = bs58.encode(cid)
   }
+  if (CID.isCID(cid)) {
+    cid = cid.toBaseEncodedString()
+  }
   if (typeof cid !== 'string') {
     throw new Error('unexpected cid type: ' + typeof cid)
   }
feat: add ability to files.cat with a cid instance

License: MIT