doy / rbw

unofficial bitwarden cli
https://git.tozt.net/rbw
Other
581 stars 83 forks source link

add support for raw json output #97

Closed classabbyamp closed 1 year ago

classabbyamp commented 1 year ago

This is a very basic implementation, and I wanted to get some feedback on the direction before taking it further. What do you think so far? My goal is compatibility with chezmoi's bitwarden and bitwardenFields functions, which uses the official cli's json output, but general usability is also good.

fixes #36

example usage:

$ cargo run -q --bin rbw -- get --raw test-entry
{
  "id": "adf723e1-ab03-4ff3-81aa-f5f3c2b68a5f",
  "folder": null,
  "name": "test-entry",
  "data": {
    "username": "foo",
    "password": "hunter2",
    "totp": null,
    "uris": [
      {
        "uri": "example.com",
        "match_type": null
      }
    ]
  },
  "fields": [
    {
      "name": "some-text",
      "value": "idk"
    },
    {
      "name": "something-hidden",
      "value": "a secret"
    },
    {
      "name": "bool-thing",
      "value": "true"
    },
    {
      "name": "idk",
      "value": null
    }
  ],
  "notes": "blah",
  "history": []
}
mindrunner commented 1 year ago

Can we move this forward please? :)

benedikt-bartscher commented 1 year ago

Thanks @classabbyamp! I just tested it and it works flawless on my side. Can you implement the same for rbw list?

doy commented 1 year ago

happy to merge this if the conflicts are resolved!

mindrunner commented 1 year ago

@classabbyamp are you able to fix that? :)

classabbyamp commented 1 year ago

happy to merge this if the conflicts are resolved!

@doy cheers, should be done

are you able to fix that? :)

@mindrunner chill out, I saw what doy wrote and people have lives y'know

mindrunner commented 1 year ago

chill out, I saw what doy wrote and people have lives y'know

I asked because if you were not able to in near future, I'd have done it. Did not intend to put some pressure or take you out of other important things you need to do. Also put a smiley at the end of my question to signal that I come with good intentions. Your answer feels kinda rude to be honest. Idk why I am getting downvoted by @pschmitt. What's going on here? I just wanted to have this fixed for quite a while now because of another issue depending on this change. So I was ready to finish it up if OP is not able to.