Getting started with 1Password for your growing team, or refining your setup? Our Secured Success quickstart guide is for you.
Forum Discussion
Former Member
3 years ago1password cli op run with python in Visual Studio Code using remote SSH
I am really interested in using 1password cli in Visual studio code but needing to add 'op run --' before the command is nearly impossible when using VSC python debugger. At least I have not found a...
JohannesKnust
2 years agoNew Contributor
I solved it by using the following snippet
import subprocess
import os
import boto3
Retrieve API key and other credentials using the 1Password CLI ('op' command)
url = get_op_secret('op://Test/Token/URL').decode('utf-8')
Set environment variables for credentials
os.environ['URL'] = URL
- no usage of the .env file at the moment because I wasted already to much time to solve it :)