How to capitalize first letter in JQ

To capitalize the first letter of a string in JQ, you can use the following expression:

with given input

{
  "name": "john"
}

the expression will be

def capitalize:
  (.[:1] | ascii_upcase) + .[1:];

.name | capitalize

You can also try that in a playground