Skip to content
Back to skills

Jq

ASecurity

Use when the user needs to query, filter, reshape, extract, create, or construct JSON data — including API responses, config files, log output, or any structured data — or when helping the user write or debug JSON transformations.

  • 2 stars
  • 0 votes
  • 1 copy
  • 3 views
  • Added October 24, 2026
ai-agentsgoshellbashexpressgitapi

Works with

  • api

Security analysis

A100/100

Scanned October 24, 2026

npx -y skills add dev-dami/deck --skill jq --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Jq?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Jq
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/dev-dami-deck/badge)](https://www.skillsdirectory.com/skills/dev-dami-deck)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: jq
description: Use when the user needs to query, filter, reshape, extract, create, or construct JSON data — including API responses, config files, log output, or any structured data — or when helping the user write or debug JSON transformations.
---

# jq — Built-in JSON Processor

Deck ships a built-in `jq` command (via `github.com/itchyny/gojq`) available
in the bash tool. No external binary is required.

## Supported Flags

| Flag | Description |
|------|-------------|
| `-r`, `--raw-output` | Output strings without quotes |
| `-j`, `--join-output` | Like `-r` but no trailing newline |
| `-c`, `--compact-output` | One-line JSON output |
| `-s`, `--slurp` | Read all inputs into an array |
| `-n`, `--null-input` | Use `null` as input (ignore stdin) |
| `-e`, `--exit-status` | Exit 1 if last output is `false` or `null` |
| `-R`, `--raw-input` | Read each line as a string, not JSON |
| `--arg name value` | Bind `$name` to a string value |
| `--argjson name value` | Bind `$name` to a parsed JSON value |

File arguments after the filter are also supported: `jq '.foo' file.json`.

## Differences from Standard jq

The built-in uses gojq, which is a pure-Go jq implementation. Key
differences:

- **No object key ordering** — keys are sorted by default; `keys_unsorted`
  and `-S` are unavailable.
- **Arbitrary-precision integers** — large integers keep full precision
  (addition, subtraction, multiplication, modulo, division when divisible).
- **String indexing** — `"abcde"[2]` returns `"c"`.
- **Not supported** — `--ascii-output`, `--seq`, `--stream`,
  `--stream-errors`, `-f`/`--from-file`, `--slurpfile`, `--rawfile`,
  `--args`, `--jsonargs`, `input_line_number`, `$__loc__`, some regex
  features (backreferences, look-around).
- **YAML** — gojq supports `--yaml-input`/`--yaml-output` but the
  built-in does not currently expose these flags.

## Common Patterns

Extract a field:
```sh
echo '{"name":"deck"}' | jq '.name'
```

Filter an array:
```sh
echo '[1,2,3,4,5]' | jq '[.[] | select(. > 3)]'
```

Reshape objects:
```sh
echo '{"first":"Ada","last":"Lovelace"}' | jq '{full: (.first + " " + .last)}'
```

Use variables:
```sh
echo '{}' | jq --arg host localhost --argjson port 8080 '{host: $host, port: $port}'
```

Slurp multiple JSON values:
```sh
echo '{"a":1}{"b":2}' | jq -s '.'
```

Compact output for piping:
```sh
echo '{"a":1}' | jq -c '.a += 1'
```

Raw string output:
```sh
echo '["one","two","three"]' | jq -r '.[]'
```

Process a file:
```sh
jq '.dependencies | keys' package.json
```

Null input for constructing JSON:
```sh
jq -n --arg msg hello '{"message": $msg}'
```

## Tips

- Pipe jq output to other commands: `jq -r '.url' data.json | xargs curl`
- Chain filters with `|` inside the expression, not shell pipes.
- Use `try` to suppress errors on missing keys: `jq 'try .foo.bar'`
- Use `// "default"` for fallback values: `jq '.name // "unknown"'`
- Use `@csv`, `@tsv`, `@base64`, `@html`, `@uri` for format strings.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.