We provide built versions of the IDE plugin as a vsix
file in the kai-vscode-plugin/builds directory. We recommend you download the latest version available.
-
See Kantra Installation Guide or if you can follow how we run from the kai project
-
In kai we have a few scripts to help with installing Kantra and running an analysis.
- Ensure podman is running (for MacOS we need to run a podman VM): samples/macos/restart_podman_machine.sh
- Fetch the Kantra binary, we will download it from a container image: samples/macos/get_latest_kantra_cli.sh
-
You can run the below scripts to run an analysis from the
kai/example
directory:git clone https://github.com/konveyor-ecosystem/kai.git
cd kai/example
- Fetch source code to run analysis against via: ./fetch.sh
- Will clone a git repo of the sample coolstore app
- Will run Kantra to analyze the previously cloned source repo: ./analyze
-
It is important that Kantra is able to run successfully on your machine before you proceed with the IDE extension. It will need to do a similar step of running Kantra from inside of the IDE.
You have a choice of installing the vsix
file from the VSCode GUI or direct from the command line.
- Open Visual Studio Code.
- Navigate to the Extensions view by clicking on the square icon on the sidebar or by pressing
Ctrl+Shift+X
(Windows/Linux) orCmd+Shift+X
(macOS). - Click on the
...
(More Actions) button at the top right corner of the Extensions view and select Install from VSIX... from the dropdown menu. - Locate and select the .vsix file you downloaded and click Install.
- Reload VSCode to activate the extension.
Only follow these steps if you decided to skip installing from the UI side and you want to install from CLI.
- Install
vsce
by runningnpm install -g vsce
in your terminal. - Install the .vsix file with the following command:
code --install-extension path/to/your-extension.vsix
- Restart/reload VSCode.
- Clone the Cool-store application:
git clone https://github.com/konveyor-ecosystem/coolstore.git
- Ensure you have the Kai project setup and cloned, you will need access to the custom_rules for the demo app
- Navigate to File > Open in VSCode and locate the folder we just cloned.
- Input: path to coolstore app
- CLI:
kantra
- Target:
containerization
,jakarta-ee
,jakarta-ee8+
,jakarta-ee9+
,quarkus
(if your target is unavailable, click "Add", type your target, and hit enter) - Rules: Navigate to the path custom_rules
- Click the
Run
button to start the analysis. - Wait for the analysis to complete successfully (expect about 2-3 minutes).
- Ensure your KAI backend is running.
- To fix all incidents or the file, right-click on the file and select
Kai-Fix All
. - To fix a single incident, right-click on the incident and select
Generate Kai-Fix
. - After the fix is generated, proposed changes will appear on the right side of the diff editor, while the original file displays on the left.
- If you find the proposed changes unconvincing, you have the option to revert them by clicking (→).
- Clicking "Accept Changes" will save the proposed changes and replace the original file. Selecting "Reject Changes" will discard the proposed changes and close the editor.