An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

# json-patch-cli [![badge](https://img.shields.io/crates/v/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')
```