Skip to content
jc-rs
GitHub

env

--envv1.4.0

Converts `env` and `printenv` command output to JSON

LinuxmacOSFreeBSDcommandslurpable
$ env | jc-rs --env

A real pair

From the reference corpus (generic/env-multiline.json). The left pane is the input the fixture ships; the right pane is the corpus's expected JSON. CI compares jc-rs with it field by field under the published differential. Hover a value to see where it came from.

envgeneric
TERM_PROGRAM=Apple_Terminal
SHELL=/bin/zsh
TERM=xterm-256color
TMPDIR=/var/folders/8g/r6tdh9kj6z35x9rfmgtt3x6r0000gn/T/
TERM_PROGRAM_VERSION=447
TERM_SESSION_ID=A7F0FFB1-C12A-42EA-A8D9-0757BB2D4DDE
USER=kelly
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.6IQJQijqVl/Listeners
PATH=/Users/kelly/.pyenv/shims:/Users/kelly/.gem/ruby/2.6.0/bin:/Users/kelly/.local/bin:/Users/kelly/.cargo/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin
LaunchInstanceID=3D00D30B-5C8B-421F-958D-91B196167506
__CFBundleIdentifier=com.apple.Terminal
PWD=/Users/kelly/temp
XPC_FLAGS=0x0
XPC_SERVICE_NAME=0
SHLVL=1
HOME=/Users/kelly
LOGNAME=kelly
SECURITYSESSIONID=186a3
OLDPWD=/Users/kelly/git/jc/tests/fixtures/ubuntu-22.04
JC_COLORS=cyan,default,default,default
JELLO_COLORS=cyan,default,default,default
PYENV_ROOT=/Users/kelly/.pyenv
PYENV_SHELL=zsh
MYVAR=hello world
hello=world
KELLYVAR=This is a multiline
variable that has var=1 a definition
inside of it
LANG=en_US.UTF-8
_=/usr/bin/env
expected outputjson
Use the Left and Right arrow keys to highlight the matching value in the input.
[
  {
    "name": "TERM_PROGRAM",
    "value": "Apple_Terminal"
  },
  {
    "name": "SHELL",
    "value": "/bin/zsh"
  },
  {
    "name": "TERM",
    "value": "xterm-256color"
  },
  {
    "name": "TMPDIR",
    "value": "/var/folders/8g/r6tdh9kj6z35x9rfmgtt3x6r0000gn/T/"
  },
  {
    "name": "TERM_PROGRAM_VERSION",
    "value": "447"
  },
  {
    "name": "TERM_SESSION_ID",
    "value": "A7F0FFB1-C12A-42EA-A8D9-0757BB2D4DDE"
  },
  {
    "name": "USER",
    "value": "kelly"
  },
  {
    "name": "SSH_AUTH_SOCK",
    "value": "/private/tmp/com.apple.launchd.6IQJQijqVl/Listeners"
  },
  {
    "name": "PATH",
    "value": "/Users/kelly/.pyenv/shims:/Users/kelly/.gem/ruby/2.6.0/bin:/Users/kelly/.local/bin:/Users/kelly/.cargo/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin"
  },
  {
    "name": "LaunchInstanceID",
    "value": "3D00D30B-5C8B-421F-958D-91B196167506"
  },
  {
    "name": "__CFBundleIdentifier",
    "value": "com.apple.Terminal"
  },
  {
    "name": "PWD",
    "value": "/Users/kelly/temp"
  },
  {
    "name": "XPC_FLAGS",
    "value": "0x0"
  },
  {
    "name": "XPC_SERVICE_NAME",
    "value": "0"
  },
  {
    "name": "SHLVL",
    "value": "1"
  },
  {
    "name": "HOME",
    "value": "/Users/kelly"
  },
  {
    "name": "LOGNAME",
    "value": "kelly"
  },
  {
    "name": "SECURITYSESSIONID",
    "value": "186a3"
  },
  {
    "name": "OLDPWD",
    "value": "/Users/kelly/git/jc/tests/fixtures/ubuntu-22.04"
  },
  {
    "name": "JC_COLORS",
    "value": "cyan,default,default,default"
  },
  {
    "name": "JELLO_COLORS",
    "value": "cyan,default,default,default"
  },
  {
    "name": "PYENV_ROOT",
    "value": "/Users/kelly/.pyenv"
  },
  {
    "name": "PYENV_SHELL",
    "value": "zsh"
  },
  {
    "name": "MYVAR",
    "value": "hello world"
  },
  {
    "name": "hello",
    "value": "world"
  },
  {
    "name": "KELLYVAR",
    "value": "This is a multiline\nvariable that has var=1 a definition\ninside of it"
  },
  {
    "name": "LANG",
    "value": "en_US.UTF-8"
  },
  {
    "name": "_",
    "value": "/usr/bin/env"
  }
]

Fixture coverage

4/4oracle-valid pairs match under the published structural JSON comparison

Magic syntax

jc-rs envjc-rs runs the command itself and parses what it prints. Recognised for: `env`, `printenv`

Source: crates/jc-rs-parsers/src/system/env.rs. jc-rs targets the schemas defined by the original Python tool. Fixture coverage above is the measured evidence for this parser; test the inputs your pipeline depends on. Compare