A simple command-line tool for getting and setting first-level keys in JSON dictionary files.
jgetset provides a straightforward way to read and write top-level key-value pairs in JSON files that contain dictionaries (objects). It's designed for simple configuration files and quick JSON manipulation.
Important: This tool only works with JSON files containing a dictionary at the root level, and only operates on first-level keys. Nested paths are not supported.
cargo build --releasejgetset <file> <key>Example:
jgetset config.json username
# Output: "alice"jgetset <file> <key>=<value>Example:
jgetset config.json username=aliceValues are stored as strings in the JSON file.
Given config.json:
{
"host": "localhost",
"port": "8080"
}# Get a value
$ jgetset config.json host
"localhost"
# Set a value
$ jgetset config.json timeout=30Result:
{
"host": "localhost",
"port": "8080",
"timeout": "30"
}- Only works with JSON dictionaries (not arrays or primitives)
- Only accesses first-level keys (no nested path support like
user.name) - Values are always stored as strings
- No support for deleting keys