{"id":18002559,"url":"https://github.com/dvcrn/go-1password-cli","last_synced_at":"2025-06-20T15:41:10.972Z","repository":{"id":142362674,"uuid":"597317292","full_name":"dvcrn/go-1password-cli","owner":"dvcrn","description":"Golang wrapper around 1Passwords `op` CLI ","archived":false,"fork":false,"pushed_at":"2025-01-15T09:53:09.000Z","size":19,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-07T05:26:58.505Z","etag":null,"topics":["1password","1password-cli","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dvcrn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-02-04T06:43:09.000Z","updated_at":"2025-01-15T14:38:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"52e8c28b-9ce7-46b4-952f-d209d32c24fc","html_url":"https://github.com/dvcrn/go-1password-cli","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dvcrn/go-1password-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvcrn%2Fgo-1password-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvcrn%2Fgo-1password-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvcrn%2Fgo-1password-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvcrn%2Fgo-1password-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dvcrn","download_url":"https://codeload.github.com/dvcrn/go-1password-cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvcrn%2Fgo-1password-cli/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260973380,"owners_count":23091105,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["1password","1password-cli","golang"],"created_at":"2024-10-29T23:22:36.404Z","updated_at":"2025-06-20T15:41:05.944Z","avatar_url":"https://github.com/dvcrn.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-1password-cli\n\nSuper thin wrapper around 1passwords `op` CLI tool.\n\n**Note:** This is not for the secret automation API, but for the CLI tool. There is no authentication, you need to have the `op` CLI tool installed and logged in.\n\n1Password will prompt you if you want to allow access on usage.\n\n\n## Installation\n```\ngo get github.com/dvcrn/go-1password-cli\n```\n\n## Usage\n\n```go\npackage main\n\nimport (\n    \"github.com/dvcrn/go-1password-cli/op\"\n)\n\nfunc main() {\n\tclient := op.NewOpClient()\n\n\t// get all vaults\n\tvaults, err := client.Vaults()\n\n\t// get a specific vault\n\tvault, err := client.Vault(\"Private\")\n\tvault, err := client.Vault(\"\u003cvaultID\u003e\")\n\n\t// get item\n\titem, err := client.Item(\"Netflix\")\n\titem, err := client.Item(\"\u003citemID\u003e\")\n}\n```\n\n## API Reference\n\n- [type Vault](\u003c#type-vault\u003e)\n- [type Item](\u003c#type-item\u003e)\n- [type OpClient](\u003c#type-opclient\u003e)\n  - [func NewOpClient() *OpClient](\u003c#func-newopclient\u003e)\n  - [func (c *OpClient) Item(itemIDOrName string) (*Item, error)](\u003c#func-opclient-item\u003e)\n  - [func (c *OpClient) LookupField(vaultIdOrName string, itemIdOrName string, fieldName string) (string, error)](\u003c#func-opclient-lookupfield\u003e)\n  - [func (c *OpClient) Vault(vaultIDOrName string) (*Vault, error)](\u003c#func-opclient-vault\u003e)\n  - [func (c *OpClient) VaultItem(itemIDOrName string, vaultIDOrName string) (*Item, error)](\u003c#func-opclient-vaultitem\u003e)\n  - [func (c *OpClient) Vaults() ([]*Vault, error)](\u003c#func-opclient-vaults\u003e)\n\n\n## type Item\n\n```go\ntype Item struct {\n    AdditionalInformation string    `json:\"additional_information,omitempty\"`\n    Category              string    `json:\"category\"`\n    CreatedAt             time.Time `json:\"created_at\"`\n    Favorite              bool      `json:\"favorite,omitempty\"`\n    ID                    string    `json:\"id\"`\n    LastEditedBy          string    `json:\"last_edited_by\"`\n    Tags                  []string  `json:\"tags,omitempty\"`\n    Title                 string    `json:\"title\"`\n    UpdatedAt             time.Time `json:\"updated_at\"`\n    Urls                  []struct {\n        Href    string `json:\"href\"`\n        Label   string `json:\"label,omitempty\"`\n        Primary bool   `json:\"primary,omitempty\"`\n    }   `json:\"urls,omitempty\"`\n    Vault struct {\n        ID   string `json:\"id\"`\n        Name string `json:\"name\"`\n    }   `json:\"vault\"`\n    Version int `json:\"version\"`\n}\n```\n\n## type Vault\n\n```go\ntype Vault struct {\n    ContentVersion int    `json:\"content_version\"`\n    ID             string `json:\"id\"`\n    Name           string `json:\"name\"`\n}\n```\n\n## type OpClient\n\n```go\ntype OpClient struct{}\n```\n\n### func NewOpClient\n\n```go\nfunc NewOpClient() *OpClient\n```\n\n### func \\(\\*OpClient\\) Item\n\n```go\nfunc (c *OpClient) Item(itemIDOrName string) (*Item, error)\n```\n\nItem returns an item by its ID or name, across all Vaults the user has access to To get items scoped to a specific Vault, use VaultItem\\(\\)\n\n```go\nfunc (c *Client) CreateItem(vaultIDOrName string, category string, title string, opts ...ItemCreateOption) (*Item, error) {\n```\n\nCreates a new item in the specified Vault\n\n### func \\(\\*OpClient\\) ReadItemField\n\n```go\nfunc (c *OpClient) ReadItemField(vaultIdOrName string, itemIdOrName string, fieldName string) (string, error)\n```\n\nReadItemField does a lookup of a specific field within an item, within a vault This is equivalent to op read op://\\\u003cvault\\\u003e/\\\u003citem\\\u003e/\\\u003cfield\\\u003e\n\n### func \\(\\*OpClient\\) EditItemField\n\n```go\nfunc (c *OpClient) EditItemField(vaultIdOrName string, itemIdOrName string, assignments ...Assignment) (*Item, error)\n```\n\nEditItemField does a lookup of a specific field within an item, within a vault and edit the fields in the item. This is equivalent to op item edit \u003citem-id\u003e field=value ...\n\n\n### func \\(\\*OpClient\\) Vault\n\n```go\nfunc (c *OpClient) Vault(vaultIDOrName string) (*Vault, error)\n```\n\n```go\nfunc (c *Client) CreateVault(name string, opts ...VaultCreateOption) (*Vault, error) {\n```\n\nCreates a new Vault\n\nVault retrieves a vault by its ID or name If you have a Vault named \"Private\", you can specify this as either \"Private\" or with its ID\n\n### func \\(\\*OpClient\\) VaultItem\n\n```go\nfunc (c *OpClient) VaultItem(itemIDOrName string, vaultIDOrName string) (*Item, error)\n```\n\nVaultItem returns an item by it's ID or name, within the specified Vault To get items across all Vaults, use Item\\(\\)\n\n### func \\(\\*OpClient\\) Vaults\n\n```go\nfunc (c *OpClient) Vaults() ([]*Vault, error)\n```\n\nVaults returns a list of all vaults in the current 1Password account\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdvcrn%2Fgo-1password-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdvcrn%2Fgo-1password-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdvcrn%2Fgo-1password-cli/lists"}