Creating entries directly into a collection though the CLI


We have an automation in place that automatically changes credentials which syncs nicely to bitwarden though the CLI.

However since we cant assign the new entries directly to a collection on creation, the Sales people will have access to root credentials for routers. Ideally we would like to separate the two…

We are evaluating enterprise as of now and if we could get this to work we will grab 30+ licenses since we already have people replacing Lastpass with bitwarden on their own.

Shouldn’t something along these lines be possible? Feels like I’m missing something but cant for my life figure out what we’re doing wrong.

bw get template item \
| jq ‘.name = “cust-test”
| .notes = “note-body-here”
| .organizationId = “9fe9bxxb59-xxxx-xxxxx-xxxxx-xxxxxxx”
| .login = “item.securenote”
| .collectionIds = [“8272b209-d915-xxxxxxx-xxxxxxxxx”]’
| bw encode
| bw create item

According to this closed thread it should be technically possible

If someone can point us in the right direction we’ll be forever grateful!

Yes, this should be possible using something like you are trying here. Do you get some type of error or something?

You could also create the item first and then use the share command to transfer it to the organization and associated collections.

Running a share command directly after the create solved it!

Was fiddling with this during some midnight cluster maintenance, brain was tired, should have read the docs more closely.

Thanks @kspearrin for fixing the behind-keyboard-error! =)