A Rust CLI tool to interact with 1Password and download credentials for environment variables.
- Connects to 1Password using the
op
command-line tool. - Retrieves the specified item from 1Password.
- Parses the JSON response and extracts the required credentials.
- Creates a
.env
file with the extracted credentials.
- Rust programming language and Cargo package manager installed.
- 1Password command-line tool (
op
) installed and configured.
- Navigate to the project directory:
cd op-dot-env
Note: Make sure you have the necessary environment variables set up to connect to 1Password.
- Build the project:
cargo build --release
This will compile the project and create the binary file.
- Run the CLI tool with the desired item name:
./target/release/op-dot-env <item-name>
Replace <item-name>
with the name of the 1Password item containing the credentials you want to download.
-
The tool will connect to 1Password, fetch the credentials, and create a
.env
file in the current directory. -
Open the
.env
file to access the downloaded credentials for your environment variables.
This project is licensed under the MIT License.