https://github.com/kellpossible/json-patch-cli
A CLI command to perform JSON RFC 6902 patching, merging and editing operations
https://github.com/kellpossible/json-patch-cli
Last synced: 4 months ago
JSON representation
A CLI command to perform JSON RFC 6902 patching, merging and editing operations
- Host: GitHub
- URL: https://github.com/kellpossible/json-patch-cli
- Owner: kellpossible
- License: mit
- Created: 2024-10-31T23:44:50.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-06T05:22:08.000Z (over 1 year ago)
- Last Synced: 2025-08-18T20:55:30.651Z (10 months ago)
- Language: Rust
- Size: 41 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# json-patch-cli [](https://crates.io/crates/json-patch-cli)
A CLI command to perform JSON RFC 6902 patching, merging and editing operations.
This project provides a CLI command `json-patch` which uses the brilliant work from the [`json-patch`](https://crates.io/crates/json-patch) crate.
## Installation
```bash
cargo install --locked json-patch-cli
```
## Usage
```txt
Usage: json-patch
Commands:
diff Calculate the difference between two json files to create a JSON (RFC 6902) patch
apply Apply a JSON (RFC 6902) patch
edit Edit a JSON (RFC 6902) patch, by editing a patched version of the input using a text editor
completions Generate command line completions script
help Print this message or the help of the given subcommand(s)
Options:
-h, --help Print help
```
### `diff` Command
```txt
Calculate the difference between two json files to create a JSON (RFC 6902) patch
Usage: json-patch diff
Arguments:
Options:
-h, --help Print help
```
### `apply` Command
```txt
Apply a JSON (RFC 6902) patch
Usage: json-patch apply --patch
Arguments:
Options:
-p, --patch
-h, --help Print help
```
### `edit` Command
```txt
Edit or create a JSON (RFC 6902) patch, by editing a patched version of the input using a text editor
Usage: json-patch edit [OPTIONS] --patch
Arguments:
Options:
-w, --watch
Enable live editing of the patch file
-p, --patch
Path to JSON patch file.
If the patch file does not yet exist, this command will create a new one.
-e, --editor
[default: vim]
-h, --help
Print help (see a summary with '-h')
```