Skip to content

Commit b59d153

Browse files
committed
docs(faq): package path env set
Signed-off-by: peefy <[email protected]>
1 parent ddac670 commit b59d153

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

docs/user_docs/support/faq-kcl.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2610,3 +2610,39 @@ app = MyApp {
26102610
args += ["additional", "args"]
26112611
}
26122612
```
2613+
2614+
## 64. Is it possible to configure kcl to generate ".kclvm" and other kcl-related directories on a specific path?
2615+
2616+
Yes, we can change the path through the variable `KCL_CACHE_PATH`.
2617+
2618+
- On macOS and Linux:
2619+
2620+
You can set `KCL_CACHE_PATH` by adding the export command to your `~/.bashrc`, `~/.zshrc`, or similar rc file for your shell, or you can simply run it in the terminal if you want it to be set for the current session only.
2621+
2622+
```shell
2623+
export KCL_CACHE_PATH=/tmp # or change the path you want
2624+
```
2625+
2626+
After setting, you can use this command to make it effective immediately:
2627+
2628+
```shell
2629+
source ~/.bashrc # adjust if using a different shell
2630+
```
2631+
2632+
- On windows
2633+
2634+
You can set `KCL_CACHE_PATH` via Command Prompt or PowerShell as an environment variable so that it affects all the KCL sessions.
2635+
2636+
For Command Prompt, use the setx command which sets the value permanently:
2637+
2638+
```shell
2639+
setx KCL_CACHE_PATH "C:\temp" /M
2640+
```
2641+
2642+
For PowerShell, use the $Env: construct, which sets an environment variable within the scope of the session:
2643+
2644+
```shell
2645+
$Env:KCL_CACHE_PATH = "C:\temp"
2646+
```
2647+
2648+
After you set the `KCL_CACHE_PATH`, when you run any KCL commands, the `.kclvm` and other KCL-related directories will be generated on the new configured path. Make sure to restart the terminal or any applications that need to use this environment variable, so that they pick up the updated configuration.

0 commit comments

Comments
 (0)