Forum Discussion

Former Member's avatar
Former Member
3 years ago

OnePassword.NET Nuget package and CLI v2

I'm new to 1Password and trying to use the OnePassword.NET Nuget package with CLI v2 in a Visual Studio C# project.

My code is as follows:

using OnePassword;

try
{

                var onePassword = new OnePasswordManager();

                var domain = "my.1password.com";
                var email = "myemail@abc.com";
                var secretKey = "Key";
                var password = "Pwd";


                onePassword.AddAccount(domain, email, secretKey, password);
                onePassword.SignIn(password);* (GET ERROR HERE: No accounts configured for use with 1Password CLI -- )
            }
        }
        catch (Exception ex)
        {
            _logger.LogError(ex, ex.Message);
        }
  1. My question is how and where do I need to configure the account before I could use it with 1Password CLI.

1Password Version: Not Provided
Extension Version: Not Provided
OS Version: Windows 10 Pro
Browser:_ Version 105.0.5195.127

2 Replies

  • andi_t_1P's avatar
    andi_t_1P
    Icon for 1Password Team rank1Password Team

    The piece of code you presented should work as expected from what I can tell from the 1Password CLI .NET wrapped Github repo docs. The only configuring you need to do is to add your account as instructed. You could always try to configure the account directly in the CLI by running op account add.

    Let me know if you are still facing issues. Best,
    Andi

  • Former Member's avatar
    Former Member

    I did come right eventually. Tx