Difference between the CLI and the API

It seems that the CLI has been enhanced to make accessing secrets easier than when using the API directly

So with the CLI I can do the following

echo “$doppler_token” | doppler configure set token --scope
SSH_KEY=$(doppler secrets get --silent --plain SSH_KEY)

So the CLI is using the token to ‘learn’ the required values for the environment and config params.

The API does not have this as a standard feature, instead to get a secret the project name and config name must be provided. The result being

I must store not just the token, but also the project and config names it relates to. For tokens generated against a config, this is extra work for no benefit with all the issues caused by errors.

or

I need to make a number of extra calls to tree walk the system to get the information via calls to
projects/list
environments/list
config/list

It would be helpful if the API could gain a helper interface to return such info in one go. This would make coding simpler and reduce the chance of hitting plan limits.

The background to this request is the fact that someone at RedHat put together a basic ansible collection for working with Doppler, but it involves a lot of extra work compared to the CLI as these values have to be provided rather than discovered for every secret.