op secret provisioning in vscode

jamesstidardjamesstidard
Community Member
in CLI

Hi all,

I've been looking to integrate the secret provision from op run -- into vscode, so I can start using it for my local development. However, there doesn't seem to be a way to integrate a tool like this (that I can think of) into vscode at the moment - specifically vscode-python.

I've created a feature request on the vscode-python GitHub repo, it needs to get :thumbsup: reactions for it to be considered. Thought, 'd cross-post here to maybe catch the eye of anyone else who's potentially interested and could throw a thumb behind it.

Here's the feature request: https://github.com/microsoft/vscode-python/issues/19132


1Password Version: Not Provided
Extension Version: Not Provided
OS Version: Not Provided

Comments

  • Horia.Culea_1PHoria.Culea_1P

    Team Member

    Hey @jamesstidard,

    Thank you for opening up the ticket! This is a super nice idea. I know this is possible with vscode-go, but no idea about other languages. I do agree that it would be super cool to have this feature over the best known extensions of VSC, I've been using the Go feature a lot.

    Left a :thumbs-up: :) Please keep us posted with any development on this, and, if this needs a hand from 1Password in any way, make sure to let us know!

    Best,
    Horia

  • jamesstidardjamesstidard
    Community Member

    Oh, I appreciate the thumb. I didn’t know vscode-go had support for this. I’ll add this to the ticket, as probably makes sense to copy whoever they’ve done it so it’s consistent.

    Thanks :)

  • jamesstidardjamesstidard
    Community Member
    edited May 16

    @Horia.Culea_1P I've not used the vscode-go extension at all. I was hoping I would be able to find it fairly easy in the launch.json or settings.json documentation, but wasn't able to. How do you currently get op playing nice with vscode-go? Be nice to see how they've supported it.

  • Horia.Culea_1PHoria.Culea_1P

    Team Member
    edited May 17

    In vscode-go, it would go something like this:
    1. create a custom runner, save it somewhere (e.g. ~/.op/runners/go):

    #!/bin/bash
    if [ $# -ge 1 ] && ([ $1 = 'run' ] || [ $1 = 'test' ]); then
        op run -- go [email protected]
    else
        go [email protected]
    fi
    
    1. in your project, in settings.json, update go.alternateTools to point to the new runner:
    "go.alternateTools":
        {
             "go":"~/.op/runners/go"
        }
    

    Let me know if this helps.

    Best,
    Horia

  • jamesstidardjamesstidard
    Community Member

    @Horia.Culea_1P that's perfect. Thanks for the help. Did actually try something similar with python by making a fake python runner as you did here, but vscode-python was too smart for it, and rejected using it.

    Anyway, thanks for the help.

  • Horia.Culea_1PHoria.Culea_1P

    Team Member

    No worries. Let us know how it goes on the vs-python side.
    Once again, if you need help with anything else, don't hesitate to reach out!

    Best,
    Horia

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file