onepassword-cli

crate.io

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

Installation

How to use

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 itemlite = opcli.get().itemlite("facebook").run().await; assert!(itemlite.isok()); println!("{:?}", &itemlite.unwrap().password); ```

dotenv::dotenv().unwrap(); let pass = dotenv::var("OPPASS").unwrap(); let opcli = OpCLI::newwithpass("my", &pass) .await .unwrap(); let doc = opcli.create().document("auth.log").run().await; assert!(doc.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()) ```