Feature: General cli command for getting "type" info about a hash #3430
Labels
help wanted
Seeking public contribution on this issue
kind/enhancement
A net-new feature or improvement to an existing feature
need/analysis
Needs further analysis before proceeding
topic/commands
Topic commands
Projects
Type: Feature
Priority: Impacts Developer Experience
Description:
It would be very useful to have a general
ipfs stat <thing>
command or maybeipfs info <hash>
oripfs object type <hash>
that would tell you, at the very least, what type of object the hash corresponds to (ie. blob, directory, etc.)Example
If I do this:
I'd like to be able to do something like this:
... really I'd be happy with any means of getting ipfs to tell me the object's type. Currently the only way to figure out what type of object a hash represents is to try commands with the hash and inspect the error messages for type mis-matches.
Can't You use
ipfs object stat
?It seems like
ipfs object stat
might provide this info but it just returns info like:So you could potentially add type info into the response from this command, but currently
ipfs object stat
isn't returning any type info.Why do this?
I'd like to be able to know that
QmQBcXur...
is a blob andQmWw4vu...
is a directory because different types of objects require different commands to be useful. Given a hash, I need to know its type in order to know what commands to use in order to make sense of it:I can run
and I can run
but not the other way around — I can't
cat
a directory object nor can I meaningfullyls
a blob object.and
ipfs ls <blob-hash>
doesn’t return anything at all.The text was updated successfully, but these errors were encountered: