sedo-rs

Run a command and provide environment variables from an environment section in a 1Password item.

Requirements

1Password's CLI tool op to be installed somewhere on your PATH.

Installing

The Makefile has an install target which will create the file ~/.cargo/bin/sedo. You will need to make sure that ~/.cargo/bin is on your PATH.

bash make install

Usage

```txt sedo 0.2.0 Run a command with environment variables set from values in a 1Password item.

Environment values are set based on entries in a section called "environment".

USAGE: sedo [FLAGS] [OPTIONS] ... -c

FLAGS: -h, --help Prints help information -i, --interactive Pass the -i flag to the subshell for the command -l, --login Pass the -l flag to the subshell for the command -V, --version Prints version information

OPTIONS: -c The command string to execute --config The config file to use -e The sedo environment to use

ARGS: ... The command to run ```

Sample config ~/.config/sedo/conf.toml:

```toml [sedo] default_env = "git"

[[sedo.environments]] name = "git" signinaddress = "my.1password.com" [[sedo.environments.items]] # GitLab vaultid = "1234567890asdfghjklqwertyu" itemid = "uytrewqlkjhgfdsa0987654321" [[sedo.environments.items]] # GitHub vaultid = "1234567890asdfghjklqwertyu" itemid = "asdfghjklqwertyuiop1234567"

[[sedo.environments]] name = "cloudflare" signinaddress = "my.1password.com" [[sedo.environments.items]] vaultid = "1234567890asdfghjklqwertyu" itemid = "7654321poiuytrewqlkjhgfdsa" ```