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 agoOnePassword.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);
}
- 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
1Password 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
I did come right eventually. Tx