This came in handy when rummaging, managing, deduplicating, and improving the health of a company 1password
op vault list | cut -d' ' -f4- | sed 's,^ ,,g'
op vault list --format=json | \
op vault get - --format json | \
jq -M -s . | \
jq -r '(map(keys) | add | unique) as $cols | map(. as $row | $cols | map($row[.])) as $rows | $cols, $rows[] | @csv'
op group list --format=json | \
jq -r '.[].name' | \
while read id; do \
op group user list $id --format=json | \
jq '.[] + {"group": "'"$id"'"}'; \
done | \
jq -M -s . | \
jq -r '(map(keys) | add | unique) as $cols | map(. as $row | $cols | map($row[.])) as $rows | $cols, $rows[] | @csv'
op group create "<group>"
op group user grant --group "<group>" --user "<user>"
This gives fewer permissions than the default
op vault group grant \
--vault <vault> \
--group <group> \
--permissions allow_viewing,create_items,edit_items,archive_items,delete_items,import_items
For full permissions use --permissions allow_viewing,allow_editing,allow_managing
op group list --user <user>
op user list --group <group>
op users list --vault <vault>
op group list --vault <vault>
op group list --user <user>
op item list --tags <tag> --format json | \
jq -r '.[] | ("\"" + .title + "\",\"" + .vault.name + "\"")'