Input Handling
jkit reads JSON from one of two places, in this order:
stdin— when something is piped in or a file is redirected.- System clipboard — when
stdinis an interactive terminal (nothing piped in).
You never need to specify which one to use. jkit figures it out by checking whether stdin is a character device.
Pipe
bash
echo '{"a":1}' | jkit f
curl -s https://api.example.com/user | jkit fRedirect from a file
bash
jkit f < data.jsonClipboard fallback
When you run jkit f without piping anything in, it reads from the clipboard. This is the most ergonomic mode for one-off use:
bash
# 1. Copy a JSON blob from anywhere (a browser, an editor, a chat...)
# 2. Run:
jkit fClipboard isn't magic
The clipboard fallback only triggers when stdin is a terminal. So if you cat empty.json | jkit f and empty.json is empty, you get the empty-stdin error — not the clipboard. This avoids surprising behavior in scripts.
When there's no input
If stdin is empty and the clipboard is empty, jkit exits with code 1:
bash
> jkit f
jkit: no input from stdin or clipboard