Skip to content

Add API to list/discover available 1Password accounts for desktop app integration #244

@jaydenthoruparcserve

Description

@jaydenthoruparcserve

Use Case

Summary

When using WithDesktopAppIntegration(accountName), developers must provide the exact account name as shown in the 1Password desktop app sidebar. However, there's no API to discover what accounts are available on the machine.

Current Situation

Must hardcode account name (e.g., "Corporate-Passwords", "My 1Password")
Must manually instruct users to open 1Password and read the account name from the sidebar
Trial-and-error approach (trying empty string, common names) causes errors
Multi-account users have no way to programmatically select between accounts
Proposed Solution

Add an API to list available accounts, such as:

accounts, err := onepassword.ListAccounts(context.Background())
// Returns: []Account{
// {Name: "Arcserve", Domain: "arcserve.1password.com"},
// {Name: "Our Family", Domain: nil},
// }

Or allow the desktop app integration to query accounts:

client, err := onepassword.NewClient(
context.Background(),
onepassword.WithDesktopAppIntegration(""), // Empty string lists accounts
)
accounts := client.ListAccounts()

Use Cases

Multi-account users (work + personal) need to select which account to use at runtime
Better UX: Applications can present a dropdown/menu of available accounts
Better error messages: "Available accounts: X, Y, Z" instead of generic "Account not found"
Configuration tools: Apps can auto-discover and suggest accounts during setup

Current Workaround

Requiring users to manually:

Open 1Password desktop app
Look at the exact account name at the top of the sidebar
Add it to a config file: onepassword_account: "AccountName"
This is error-prone (case-sensitive, exact match required) and creates friction for users.

Real-World Context

I am Building a remote connection manager (MremoteGO) that uses 1Password SDK for password management. Users may have multiple accounts (work/personal) and need a way to choose which one to use without hardcoding account names.

Related

Desktop app integration introduced in v0.4.0-beta.2
Similar to how 1Password CLI has "op account list" command

Requirements and desired behavior

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions