2.3 KiB
nu_plugin_kcl
A Nushell plugin to use with KCL CLI wrapper
Installing
Caution
Require to have KCL CLI wrapper use KLC installation documentation
Clone this repository
Warning
nu_plugin_kcl has dependencies to nushell source via local path in Cargo.toml Nushell and plugins require to be sync with same version
Clone Nushell to plugin to use Tera templates or change dependecies in Cargo.toml
This plugin is also included as submodule in nushell-plugins as part of plugins collection for Provisioning project
Is used in
Build from source
> cd nu_plugin_tcl
> cargo install --path .
Nushell
In a Nushell
> plugin add ~/.cargo/bin/nu_plugin_kcl
Exec KCL files
Exec KCL files and return result in YAML
> kcl-exec <file> (work_dir)
Flags:
- -h, --help: Display the help message for this command
Parameters:
- file : KCL file to execute
- work_dir : Work directory (optional)
Examples:
Execute the KCL file './src/myfile.k'
> kcl-exec ./src/myfile.k
Validate KCL files
Validate KCL files
> kcl-validate (dir)
Flags: -h, --help: Display the help message for this command
Parameters:
- dir : Directory to validate (optional)
Examples
Validate all KCL files in the directory './project_dir'.
> kcl-validate ./project_dir
✅ All 3 files are valid
✅ ./project_dir/main.k
Format KCL files
Format KCL files
> kcl-format (dir)
Flags:
- -h, --help: Display the help message for this command
Parameters:
- file : KCL file to format
Examples
Format the KCL file 'myfile.k'.
> kcl-format myfile.k
✅ File formatted: myfile.k