I see this in the help
keyring -h
usage: keyring [-h] [-p KEYRING_PATH] [-b KEYRING_BACKEND] [--list-backends] [--disable]
[operation] [service] [username]
positional arguments:
operation get|set|del
service
username
optional arguments:
-h, --help show this help message and exit
-p KEYRING_PATH, --keyring-path KEYRING_PATH
Path to the keyring backend
-b KEYRING_BACKEND, --keyring-backend KEYRING_BACKEND
Name of the keyring backend
--list-backends List keyring backends and exit
--disable Disable keyring and exit
However without remembering what I stored there a long time ago I can't figure out how to list the secrets stored there. What is the right command line for this ?
The keyring command line tool does not support that.
A feature request has been discussed in this thread (link) , but it has not been implemented.
The 'keyring' tool is not a keychain service in itself, but a wrapper for other keychain services, called backends.
It can get and set secrets in a variety of keychain services, including: KWallet, SecretService, Windows Credential Locker, etc. These are called backends.
Use the underlying keychain service for getting a list.
In my case, on Ubuntu 22.04, the underlying default keychain tool is SecretService. I was able to get a list with the following Python code.
The underlying Python library does partly support this
The keyring command line tool is just the command line part of a Python library https://github.com/jaraco/keyring.
With some Python knowledge you are able to use keyring to get such a list.
However, I suspect it only lists the secrets for one backend (the default/preferred one), in my case SecretService. I assume most people only have one keychain service in use, but there might be cases where there is more than one.