https://github.com/deepsweet/1pwd
🔑 1Password CLI wrapper
https://github.com/deepsweet/1pwd
1password 1password-cli api password-manager
Last synced: 6 months ago
JSON representation
🔑 1Password CLI wrapper
- Host: GitHub
- URL: https://github.com/deepsweet/1pwd
- Owner: deepsweet
- License: mit
- Created: 2018-07-18T19:46:10.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-05-10T20:34:33.000Z (over 6 years ago)
- Last Synced: 2025-03-17T19:31:35.530Z (10 months ago)
- Topics: 1password, 1password-cli, api, password-manager
- Language: TypeScript
- Size: 99.6 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license.md
Awesome Lists containing this project
README
# 1pwd
[](https://www.npmjs.com/package/1pwd) [](https://travis-ci.org/deepsweet/1pwd) [](https://codecov.io/github/deepsweet/1pwd)
[1Password CLI](https://blog.agilebits.com/2017/09/06/announcing-the-1password-command-line-tool-public-beta/) wrapper.
## Requirements
* Node.js >= 6
* [`esm` loader](https://github.com/standard-things/esm)
* Official [1Password `op` CLI](https://support.1password.com/command-line-getting-started/#set-up-the-command-line-tool)
* [`op signin`](https://support.1password.com/command-line-getting-started/#get-started-with-the-command-line-tool) with exported session token
## Install
```sh
$ yarn add 1pwd
# or
$ npm install 1pwd
```
## Usage
### `op`
```sh
op --help
```
```ts
(commands: string[], options?: {}) => Promise
```
```js
import { op } from '1pwd'
const result = await op(['list', 'vaults'])
// unparsed stdout as is
```
### `getItem`
```sh
op get item --help
```
```ts
(item: string, options?: {}) => Promise<{}>
```
```js
import { getItem } from '1pwd'
const result = await getItem('item', {
vault: 'vault',
includeTrash: true
})
// parsed JSON
```
### `getTotp`
```sh
op get totp --help
```
```ts
(item: string) => Promise
```
```js
import { getTotp } from '1pwd'
const result = await getTotp('item')
// string
```
## TODO
* check for session token and handle `op signin`
* wrap more `op` CLI commands