@lean-format/cli
v1.0.0
Published
Command line interface for the LEAN data format
Maintainers
Readme
@lean/cli
Command-line interface for the LEAN (Lightweight Efficient Adaptive Notation) data format.
Installation
npm install -g @lean-format/cliUsage
Parse LEAN to JavaScript/JSON
# From file
lean parse data.lean
# From stdin
cat data.lean | lean parse
# Output to file
lean parse data.lean -o output.jsonFormat JavaScript/JSON to LEAN
# From file
lean format data.json
# From stdin
echo '{"name":"Alice","age":30}' | lean format
# Output to file
lean format data.json -o output.leanConvert between formats
# LEAN to JSON
lean convert data.lean data.json
# JSON to LEAN
lean convert data.json data.leanValidate LEAN files
lean validate data.leanWatch mode (auto-convert on file changes)
lean watch data.leanInitialize a sample LEAN file
lean init sampleOptions
-o, --output <file>- Output file path-p, --pretty- Pretty print JSON output-s, --strict- Enable strict mode validation-q, --quiet- Suppress non-error output
Examples
Parse and pipe to jq
cat config.lean | lean parse | jq '.database.host'Format with custom output
lean format api-response.json -o config.leanWatch and auto-convert
lean watch config.lean
# Every time config.lean changes, it converts to config.jsonFeatures
- ✅ Unix-style stdin/stdout piping
- ✅ Cross-platform file watching with chokidar
- ✅ Row syntax support for tabular data
- ✅ Comprehensive validation
- ✅ Pretty printing options
Learn More
License
MIT © LEAN Format Team
