init repo
This commit is contained in:
commit
1723a6f5cd
49
.gitignore
vendored
Normal file
49
.gitignore
vendored
Normal file
@ -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
|
92
README.md
Normal file
92
README.md
Normal file
@ -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 <file> (work_dir)
|
||||||
|
```
|
||||||
|
|
||||||
|
Flags:
|
||||||
|
- **-h**, **--help**: Display the help message for this command
|
||||||
|
|
||||||
|
Parameters:
|
||||||
|
- file <path>: KCL file to execute
|
||||||
|
- work_dir <directory>: 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>: 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 <path>: KCL file to format
|
||||||
|
|
||||||
|
### Examples
|
||||||
|
|
||||||
|
Format the KCL file 'myfile.k'.
|
||||||
|
```nushell
|
||||||
|
> kcl-format myfile.k
|
||||||
|
✅ File formatted: myfile.k
|
||||||
|
```
|
Loading…
x
Reference in New Issue
Block a user