Categorygithub.com/ContainerSolutions/onepassword
repositorypackage
0.1.0
Repository: https://github.com/containersolutions/onepassword.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# README

Codefresh build status Go Report Card

1Password Client

Thin wrapper around the 1Password CLI for use in Golang.

This is a stub and should not be used in production.

Hopefully 1Password creates their own client library. See discussion.

Usage

First install the 1Password CLI.

Import the package, create a client, and retrieve an item.

import (
    "os"

    op "github.com/ameier38/onepassword"
)

func main() {
    password := os.GetEnv("OP_PASSWORD")
    secretKey := os.GetEnv("OP_SECRET_KEY")
    client := op.NewClient("op", "subdomain", "[email protected]", password, secretKey)
    item := client.GetItem(VaultName("test-vault"), ItemName("test-item"))
}

Resources