https://github.com/wooos/je
Command line editor for json
https://github.com/wooos/je
golang jsoneditor
Last synced: about 1 month ago
JSON representation
Command line editor for json
- Host: GitHub
- URL: https://github.com/wooos/je
- Owner: wooos
- License: apache-2.0
- Created: 2020-11-11T01:57:53.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-06-08T09:30:18.000Z (over 4 years ago)
- Last Synced: 2024-06-21T02:49:43.125Z (over 1 year ago)
- Topics: golang, jsoneditor
- Language: Go
- Homepage:
- Size: 41 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# je
[](https://circleci.com/gh/woos/je)
Command line editor for json.
## Usage
```
Command line editor for json.
Usage
je [command]
Available Commands:
completion Generate auto completions script for goe for the specified shell (bash)
delete Delete the keys of json
help Help about any command
update update a json file
version print current version information
Flags:
-h, --help help for je
Use "je [command] --help" for more information about a command.
```
## Example
The below is content of `source.json`.
```json
{
"name": "je",
"version": "v1.0",
"detail": {
"n": "je",
"v": "v1.0"
},
"users": [
"a",
"b"
]
}
```
1. modify `name` value `je` to `jee`
```
$ je update --set name=jee source.json
```
2. modify `detail.n` value `je` to `jee`
```
$ je update --set detail.n=jee source.json
```
3. modify `users` values `a` to `aa`
```
$ je update --set users[0]=aa source.json
```
4. modify `name` value `je` to `jee` and modify `n` value `je` to `jee`
```
$ je update --set name=jee,detail.n=jee source.json
```
5. delete key `name`
```
$ je delete --keys name source.json
```
6. delete key `detail.n`
```
$ je delete --keys detail.n source.json
```