From 1723a6f5cde4fd452db31e83bebcb00ff17dfaf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20P=C3=A9rex?= Date: Thu, 26 Jun 2025 23:51:12 +0100 Subject: [PATCH] init repo --- .gitignore | 49 +++++++++++++++++++++++++++++ README.md | 92 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 141 insertions(+) create mode 100644 .gitignore create mode 100644 README.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8001cf3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,49 @@ +target +# enviroment to load on bin/build +.env +# OSX trash +.DS_Store + +# Vscode files +.vscode + +# Emacs save files +*~ +\#*\# +.\#* + +# Vim-related files +[._]*.s[a-w][a-z] +[._]s[a-w][a-z] +*.un~ +Session.vim +.netrwhist + +# cscope-related files +cscope.* + +# User cluster configs +.kubeconfig + +.tags* + +# direnv .envrc files +.envrc + +# make-related metadata +/.make/ + +# Just in time generated data in the source, should never be committed +/test/e2e/generated/bindata.go + +# This file used by some vendor repos (e.g. github.com/go-openapi/...) to store secret variables and should not be ignored +!\.drone\.sec + +# Godeps workspace +/Godeps/_workspace + +/bazel-* +*.pyc + +# generated by verify-vendor.sh +vendordiff.patch diff --git a/README.md b/README.md new file mode 100644 index 0000000..c2ffb3a --- /dev/null +++ b/README.md @@ -0,0 +1,92 @@ +# nu_plugin_kcl + +A [Nushell](https://nushell.sh/) plugin to use with [KCL](https://www.kcl-lang.io/) CLI wrapper + +## Installing + +> [!TIP] Require to have [KCL](https://www.kcl-lang.io/) CLI wrapper +> use [KLC installation documentation](https://www.kcl-lang.io/docs/user_docs/getting-started/install) + +Clone this repository + +Build from source + +```nushell +> cargo install --path . +``` + +### Nushell + +In a [Nushell](https://nushell.sh/) + +```nushell +> plugin add ~/.cargo/bin/nu_plugin_kcl +``` + +## Exec KCL files + +Exec [KCL files](https://www.kcl-lang.io/docs/user_docs/getting-started/kcl-quick-start) and return result in [YAML](https://en.wikipedia.org/wiki/YAML) + +```nushell +> kcl-exec (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' +```nushell +> kcl-exec ./src/myfile.k +``` + +## Validate KCL files + +Validate [KCL files](https://www.kcl-lang.io/docs/user_docs/getting-started/kcl-quick-start) + +```nushell +> 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'. + +```nushell +> kcl-validate ./project_dir +✅ All 3 files are valid +✅ ./project_dir/main.k +``` + +## Format KCL files + +Format [KCL files](https://www.kcl-lang.io/docs/user_docs/getting-started/kcl-quick-start) + +```nushell +> 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'. +```nushell +> kcl-format myfile.k +✅ File formatted: myfile.k +```