JSONEditor-CLI is a command-line tool for Node.js that provides an interactive JSON editing experience using JSONEditor. Whether you need to quickly view or edit JSON files, JSONEditor-CLI makes it simple and efficient.
- JSON Editing that runs on command line: Edit JSON files directly in a web-based interface without needing a text editor.
- Multiple Modes: Supports different editing modes such as
tree
(default),text
, orcode
. - Web Interface Option: Launch a local web interface to edit JSON files in your browser.
- Lightweight & Fast: Built with Node.js for a quick and responsive experience.
Install JSONEditor-CLI globally using npm:
npm install -g jsoneditor-cli
Or add it as a dependency to your project:
npm install jsoneditor-cli --save-dev
To use JSONEditor-CLI, run the command followed by the JSON file you wish to edit:
jsoneditor-cli [options] load <file>
-
-m, --mode <mode>
Set the editor mode. Available modes:tree
(default),text
, orcode
. -
-p, --port <number>
Specify the port for the web interface (default:5053
). -
-e, --engine <engine>
Set the engine. Available engines:jsoneditor
(default),svelte-jsoneditor
. -
-i, --initialExpand <initialExpand>
Set the initial expand. Available options:true
(default),false
. -
-h, --help
Display help and usage information.
Edit a JSON file in tree mode (default):
jsoneditor-cli load data.json
Specify a mode (e.g., code mode):
jsoneditor-cli --mode code load data.json
Launch the web interface on a specific port:
jsoneditor-cli --port 4000 load data.json
Any options provided via the command line will override the configuration file settings.
Contributions are welcome! If you find any issues or have ideas for improvements, please open an issue or submit a pull request on GitHub.
This project is licensed under the MIT License. See the LICENSE file for details.