1pwd 中文文档教程
1pwd
1Password CLI 包装器。
Requirements
- Node.js >= 6
esm
loader- Official 1Password
op
CLI op signin
with exported session token
Install
$ yarn add 1pwd
Usage
op
op --help
(commands: string[], options?: {}) => Promise<string>
import { op } from '1pwd'
const result = await op(['list', 'vaults'])
// unparsed stdout as is
getItem
op get item --help
(item: string) => Promise<{}>
import { getItem } from '1pwd'
const result = await getItem('item', {
vault: 'vault',
includeTrash: true
})
// parsed JSON
getTotp
op get totp --help
(item: string) => Promise<string>
import { getTotp } from '1pwd'
const result = await getTotp('item')
// string
TODO
- check for session token and handle
op signin
- wrap more
op
CLI commands
1pwd
1Password CLI wrapper.
Requirements
- Node.js >= 6
esm
loader- Official 1Password
op
CLI op signin
with exported session token
Install
$ yarn add 1pwd
Usage
op
op --help
(commands: string[], options?: {}) => Promise<string>
import { op } from '1pwd'
const result = await op(['list', 'vaults'])
// unparsed stdout as is
getItem
op get item --help
(item: string) => Promise<{}>
import { getItem } from '1pwd'
const result = await getItem('item', {
vault: 'vault',
includeTrash: true
})
// parsed JSON
getTotp
op get totp --help
(item: string) => Promise<string>
import { getTotp } from '1pwd'
const result = await getTotp('item')
// string
TODO
- check for session token and handle
op signin
- wrap more
op
CLI commands