Inject a JSON literal like a number, array, or object.
Section: Arguments and Shell Integration
Pass JSON value
bash
bash
count=42; jq -n --argjson count "$count" '{count: $count}'Explanation
Use `--argjson` when the value should remain JSON, not a string.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Arguments and Shell Integration
Read another JSON file into variable
Load a JSON file into jq as an array of documents.
Read one JSON file into variable
Load one JSON document into a jq variable.