Crates.io | jgze |
lib.rs | jgze |
version | 1.1.1 |
source | src |
created_at | 2024-11-16 15:18:21.99035 |
updated_at | 2024-11-17 07:30:22.729861 |
description | A tool for editing gzipped JSON files directly |
homepage | |
repository | https://github.com/teihenn/jgze |
max_upload_size | |
id | 1450426 |
size | 27,989 |
A lightweight CLI tool to edit .json.gz files seamlessly. Edit gzipped JSON files directly in your favorite editor with automatic formatting and compression handling.
.json.gz
files directly using your preferred text editorThe tool supports three JSON formats:
{"name":"John","age":30,"city":"Tokyo"}
{
"name": "John",
"age": 30,
"city": "Tokyo"
}
{"name":"John","age":30}
{"name":"Alice","age":25}
{"name":"Bob","age":35}
For better readability, all formats are automatically converted to pretty-printed format when opened in the editor. After saving, the file is converted back to its original format before compression.
For example, if you open a compact JSON file:
{"name":"John","age":30,"city":"Tokyo"}
{
"name": "John",
"age": 30,
"city": "Tokyo"
}
Suppose you edited this as follows:
{
"name": "John",
"age": 30
}
{"name":"John","age":30}
jgze [OPTIONS] <FILE>
Option | Short | Description |
---|---|---|
--editor <EDITOR> | -e | Specify the editor to use (default: vim) |
--help | -h | Display help message |
--version | -v | Display version information |
# Edit with default editor (vim)
jgze input.json.gz
# Edit with a specific editor
jgze -e nano input.json.gz
# Show version information
jgze -v
# Show help message
jgze -h
The usage can be verified using the test data in the testdata directory.
cargo install jgze
cargo uninstall jgze
tar xz -C /usr/local/bin < <(curl -L https://github.com/teihenn/jgze/releases/latest/download/jgze-x86_64-unknown-linux-gnu.tar.gz)
tar xz -C /usr/local/bin < <(curl -L https://github.com/teihenn/jgze/releases/latest/download/jgze-x86_64-apple-darwin.tar.gz)
tar xz -C /usr/local/bin < <(curl -L https://github.com/teihenn/jgze/releases/latest/download/jgze-aarch64-apple-darwin.tar.gz)
C:\Program Files\jgze
)ls -l /usr/local/bin/jgze
sudo rm /usr/local/bin/jgze
git clone https://github.com/teihenn/jgze
cd jgze
cargo install --path .
cargo uninstall jgze
.json.gz
file