A wrapper for 1password-cli. It intent to offering a similar usage with the cli, make it easy-to-use. For now, only part of the cli utility have been implemented - get - [x] account - [x] document - [x] item - [x] totp (one time password) - [ ] group - [ ] user - [ ] vault - [ ] template - [ ] group - list - [x] documents - [x] items - [ ] events - [ ] groups - [ ] templates - [ ] users - [ ] vaults - create - [x] document - [ ] group - [ ] item - [ ] user - [ ] vault - add - [ ] group - [ ] user - delete - [ ] document - [ ] group - [ ] item - [ ] trash - [ ] user - [ ] vault - edit - [ ] document - [ ] group - [ ] item - [ ] user - [ ] vault
sh
cargo add onepassword-cli
dotenv::dotenv().unwrap(); let pass = dotenv::var("OPPASS").unwrap(); let opcli = OpCLI::newwithpass("my", &pass) .await .unwrap(); let account = opcli.get().account().run().await; assert!(account.isok()) ```
dotenv::dotenv().unwrap(); let pass = dotenv::var("OPPASS").unwrap(); let opcli = OpCLI::newwithpass("my", &pass) .await .unwrap(); let itemlit = opcli.get().itemlite("facebook").run().await; assert!(itemlite.is_ok()) ```
dotenv::dotenv().unwrap(); let pass = dotenv::var("OPPASS").unwrap(); let opcli = OpCLI::newwithpass("my", &pass) .await .unwrap(); let account = opcli.create().document("auth.log").run().await; assert!(account.isok()) ```
dotenv::dotenv().unwrap(); let pass = dotenv::var("OPPASS").unwrap(); let opcli = OpCLI::newwithpass("my", &pass) .await .unwrap(); let otps = opcli.get().totp("facebook").run().await; assert!(otps.isok()) ```