jq
keys
$ echo '{"obj": {"x": 1, "y": 2}, "num": 42, "txt": "helo world"}' | jq keys [ "num", "obj", "txt" ]
Index