shell-plugins icon indicating copy to clipboard operation
shell-plugins copied to clipboard

Generic way to provide environment variables

Open Nitive opened this issue 4 months ago • 0 comments

op CLI version

2.31.1

Goal or desired behavior

It would be nice to have a way to specify env variables (regardless of the plugin used), as it's common to provide configuration for tools like this. For example, I need to specify PGSSLROOTCERT for my PostgreSQL connection, someone else wants to set PGTARGETSESSIONATTRS, etc. Of course, we can map all env from documentation, but it would require a lot of work to do so for all plugins.

Maybe a better solution would be to have generic mappers. For example, we can map all env.MY_ENV fields to respective environment variables. The same can be applied to command-line arguments (args.--my-arg)

Current behavior

Right now I have to provide environment variables manually PGSSLROOTCERT=$HOME/.config/my-cloud/ca.pem psql

Nitive avatar Aug 22 '25 13:08 Nitive