Skip to content

Feature Request: read --json from a file or stdin #229

Open

Description

@FluteBlade

--json takes the whole input inline, which the README recommends for machine-generated invocations such as an LLM calling the CLI. Linux limits a single argument to 128 KiB, though, so a larger input cannot be passed at all: with a 131,072-byte value the shell fails with "Argument list too long" before the CLI starts. An input that carries file contents is easily that large.

curl's -d handles the same case with a prefix: "If you start the data with the letter @, the rest should be a filename. "@-" makes curl read the data from stdin." gh api -F key=@file works the same way. --json @path and --json @- would cover it without a new option, and cannot be confused with inline JSON, which never starts with @.

We currently rewrite our own --input <file> into --json <contents> before calling run(). Would you accept @path and @- for --json?

Activity

  1. pullfrog commented on Oct 23, 2026

    @pullfrog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions