Skip to main content
April 25, 2024
Question

--format json could influence the error outputs

  • April 25, 2024
  • 1 reply
  • 77 views

When you add "--format json" to a command, for example:


op item get sandwich --vault private --format json

If sandwich doesn't exist, you'll get:


[ERROR] 2024/04/24 20:11:53 "sandwich" isn't an item in the "private" vault. Specify the item with its UUID, name, or domain.

Perhaps it would be more useful for us mere mortals wrapping this CLI to get back something like:

json
{
"err": "ErrMissingItem",
"time": "2024/04/24 20:11:53 ",
"msg": "\"sandwich\" isn't an item in the \"private\" vault. Specify the item with its UUID, name, or domain."
}

You know, something a machine can parse. Extra credit if we start to do some formal error types. That, or get us a golang sdk that can talk directly to the desktop app, or both! 😘


1Password Version: 8.10.30
Extension Version: 2.27.0
OS Version: macOS 14.4.1
Browser: Chrome

1 reply

Dayton_ag
1Password Employee
May 3, 2024

Hey @flyinprogrammer, good idea! I can definitely see how JSON-formatted errors would be helpful, especially when invoking the CLI in a context where it's desired to handle the error. I can't make any promises for future changes, but I've shared this feedback with the team. 😃