Forum Discussion

planetf1's avatar
planetf1
New Contributor
2 months ago

1password cli caching (vscode)

I have a credential I need to set in an environment (.env) for Python before running a program.

This is all defined via vscode tasks. I switch between 'groups' of settings (ie multiple environment variables) by just copying a template to the .env file 

An example of one credential is:

export GITHUB_PERSONAL_ACCESS_TOKEN=$(op --cache read --account https://my.ent.1password.com/ "op://Private/Github API token/password")

When my python code is run (which loads .env) I get prompted for biometrics. That's fine, except that there is no caching ie I get prompted every time.

The process being run is of course different each time.

Note : I initially didn't have --cache specified, and have subsequently added it after seeing it mentioned here.

Any suggestions on how to cache these approvals/credentials for a short while (my intent is not to materialise the actual password in a file at any point). Do I need to write my own helper process, or is there something suitable available in the api?

2 Replies

  • planetf1's avatar
    planetf1
    New Contributor

    Anyone have any ideas on this? I'd like to use the cli more in this environment, but having to auth on seemingly every request is a step too far