To list the contents of a path, you can use the ls command:

secrethub ls [options] [<path>]

The ls command is somewhat similar to the UNIX ls command. To distinguish between directories and secrets, directories are shown ending in a forward slash /.

Keep an eye on the STATUS field, as it indicates the security status of an organization, repository, directory, or secret. For instance, directories containing a flagged secret will have their status flagged. This works recursively, directories containing a flagged directory will also share that same status.

For scripting, you may want to disable the table format output. Use the --quiet flag to make the command only print out path values.


<path> (string)
The path to list contents of. Depending on the value of the argument, the ls command behaves a bit differently:
  • When left empty, this command aliases to the repo ls command, listing repositories you have access to.
  • When set to <namespace>, it will print out the repositories contained in that namespace.
  • When set to <namespace>/<repo>[/<dir>], it will print out the secrets and directories directly contained in that directory.
  • When set to <namespace>/<repo>[/<dir>]/<secret>, it will print out all version names for that secret.
  • When set to <namespace>/<repo>[/<dir>]/<secret>:<version>, it will print out the version name for that version. This can e.g. be used to discover the version number by passing <secret>:latest to it.


-q, --quiet (boolean)
Only print path values.