This kind of thing has its place and can be useful, but I think there should be options to enable/disable such magic. Personally I'd lean towards it being opt-in, but I think with the cli it's a lot harder to not have it opt-out. Everythint is a string in the cli, but not so much when it comes to json. That's why I think it makes sense, providing you can disable the magic.
jo opaque_id=$(command used in prod that returns digits + letters for three months and everything works just fine and then suddenly at 3am on a Sunday it returns 1979 and breaks everything)
I'm sure it'd be a patch of a few lines to make the type specification mandatory on the command line (I would certainly prefer that also), but it comes down to the opinion of the maintainer if that is wanted or not.
I'm very skeptical of this. If I put x=001979 in as a value I dont think I want you trying to guess if that's supposed to be an integer or a string.
This sounds like the Norway Problem waiting to happen.