Skip to content

Expose new-cli --json commands in the repl #10108

Open
@roberth

Description

Is your feature request related to a problem? Please describe.

jq is fun, but not as fun as Nix.

We could add a primop to the repl only, to do all the dirty things that the language can't normally do, and manipulate the result with Nix in the repl.

Describe the solution you'd like

Something like

nix-repl> ping = builtins.runCLI ["store" "ping"]

nix-repl> ping.url
"daemon"

There's a whole bunch more interesting commands of course.

Describe alternatives you've considered

nix-repl> :nix store ping
Store URL: daemon
Version: 2.23.1
Trusted: 1

nix-repl> :sh nix store ping
[ ... similar ... ]

These don't produce proper values though.

Additional context

Priorities

Add 👍 to issues you find important.

Metadata

Assignees

No one assigned

    Labels

    featureFeature request or proposalnew-cliRelating to the "nix" commandreplThe Read Eval Print Loop, "nix repl" command and debugger

    Type

    No type

    Projects

    • Status

      ⚖ To discuss

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions