Skip to main content
Version: 0.6

Installation

1. Install KCL

From the Binary Releases

Each release of KCL includes various OSes and architectures. These binary versions can be manually downloaded and installed from Github and add {install-location}/kclvm/bin to the environment PATH.

MacOS & Linux

export PATH=$PATH:{install-location}/kclvm/bin

Windows

$env:PATH += ";{install-location}\kclvm\bin;"

Using script to install the latest release

MacOS

Install or upgrade the latest darwin KCL to /usr/local/kclvm/bin

curl -fsSL https://kcl-lang.io/script/install.sh | /bin/bash

Linux

Install or upgrade the latest linux KCL to /usr/local/kclvm/bin

wget -q https://kcl-lang.io/script/install.sh -O - | /bin/bash

Windows

Install or upgrade the latest windows KCL to $Env:SystemDrive\kclvm\bin and add this directory to User PATH environment variable.

powershell -Command "iwr -useb https://kcl-lang.io/script/install.ps1 | iex"

Homebrew (MacOS)

  • Install
brew install kcl-lang/tap/kcl
  • Upgrade
brew upgrade kcl-lang/tap/kcl
  • Uninstall
brew uninstall kcl-lang/tap/kcl

Scoop (Windows)

Install Scoop first, then add this bucket and install kcl by running:

scoop bucket add kcl-lang https://github.com/kcl-lang/scoop-bucket.git
scoop install kcl-lang/kcl

From Go

Install kcl through the Go command (Go requires 1.18+).

go install kcl-lang.io/kcl-go/cmds/kcl-go@main

Add an alias for the kcl command (optional).

alias kcl='kcl-go run'

Note: kcl-go does not rely on the installation of kcl, but if kcl exists in PATH, it will be used by kcl-go first.

From Docker

  • Command
docker run --rm -it kcllang/kcl
  • Update image
docker pull kcllang/kcl

Note

We can execute the following command to ensure that KCL has been installed correctly.

kcl -V

The output may looks like this:

Version: {kcl version}
Platform: {your platform}
GitCommit: {git commit}

For all the above operating systems and installation methods, if you want to use KCL Python Plugin, you need to ensure that Python 3.7+ is installed and add the python3 command to your PATH environment variable.

If you are unable to successfully install and run KCL, you can refer to here

2. Install KCL IDE Extension

VS Code

The KCL Extension extension provides some coding assistance, e.g., highlight, goto definition, completion, hover, outline, and diagnostics. You can go here for more information about the installation.

Completion

NeoVim

See here to config the KCL language server and enable it.

kcl.nvim

IntelliJ IDEA

Download the distribution from here and in IntelliJ IDEA, click Preference -> plugins -> install Plugin from Disk... -> select kcl-idea-plugin zip -> restart IDE. This plugin requires the IntelliJ IDEA 2020.2+

intellij