| Crates.io | onepassword-cli |
| lib.rs | onepassword-cli |
| version | 0.3.4 |
| created_at | 2021-03-13 13:58:37.900954+00 |
| updated_at | 2021-04-04 10:28:57.883255+00 |
| description | a wrapper for 1password-cli, which focus on easy-to-use |
| homepage | |
| repository | https://github.com/sinyo-matu/onepassword-cli |
| max_upload_size | |
| id | 368295 |
| size | 39,098 |
A wrapper for 1password-cli. It intent to offering a similar usage with the cli, make it easy-to-use. For using this crate, you need to setup 1password-cli first. Please see 1password-cli getting started For now, only part of the cli utility have been implemented
cargo add onepassword-cli
extern crate dotenv;
extern crate onepassword_cli;
use onepassword_cli::OpCLI;
dotenv::dotenv().unwrap();
let pass = dotenv::var("OP_PASS").unwrap();
let op_cli = OpCLI::new_with_pass("my", &pass)
.await
.unwrap();
let account = op_cli.get().account().run().await;
assert!(account.is_ok())
extern crate dotenv;
extern crate onepassword_cli;
use onepassword_cli::OpCLI;
dotenv::dotenv().unwrap();
let pass = dotenv::var("OP_PASS").unwrap();
let op_cli = OpCLI::new_with_pass("my", &pass).await.unwrap();
let item_lite = op_cli.get().item_lite("facebook").run().await;
assert!(item_lite.is_ok());
println!("{:?}", &item_lite.unwrap().password);
extern crate dotenv;
extern crate onepassword_cli;
use onepassword_cli::OpCLI;
dotenv::dotenv().unwrap();
let pass = dotenv::var("OP_PASS").unwrap();
let op_cli = OpCLI::new_with_pass("my", &pass)
.await
.unwrap();
let doc = op_cli.create().document("auth.log").run().await;
assert!(doc.is_ok())
extern crate dotenv;
extern crate onepassword_cli;
use onepassword_cli::OpCLI;
dotenv::dotenv().unwrap();
let pass = dotenv::var("OP_PASS").unwrap();
let op_cli = OpCLI::new_with_pass("my", &pass)
.await
.unwrap();
let otps = op_cli.get().totp("facebook").run().await;
assert!(otps.is_ok())