Skip to content
/ knut Public

Knut is an automation tool for code transformation using scripts.

License

Notifications You must be signed in to change notification settings

KDAB/knut

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Knut

GitHub branch status License: GPL v3 MkDocs

Knut is an automation tool for code transformation using scripts. The main use case is for migration, but it could be used elsewhere.

The scripts are written either in javascript or QML languages, the latter being able to display a user interface to customize some parts of the application. The script API is available in this documentation, and ranges from normal text transformations (find and replace) to getting contextual information based on the file language (using TreeSitter).

Knut can be used via a command line interface or a user interface.

Supported programming languages

Knut supports multiple programming languages and file types to different degrees.

This table provides a basic overview of the current support. Please refer to the subclasses of Document for details on the supported functions of each class.

🌳 TreeSitter πŸ”£ Code Items πŸ§‘β€πŸ’» LSP πŸ–₯️ File Viewer
C/C++ βœ… βœ… βœ…
C# βœ… ❌ ❌
Rust βœ… ❌ ❌
Dart ❌ ❌ ❌
JSON ❌ βœ”οΈ ❌
Qt Translate (.ts) ❌ βœ”οΈ ❌
Qt Qml βœ… βœ… ❌ βœ…
Qt Ui files ❌ ❌ ❌ βœ…
Slint ❌ ❌ ❌ βœ…
MFC rc files ❌ βœ”οΈ ❌ βœ”οΈ

βœ… Fully Supported βœ”οΈ Partial Support ❌ Unsupported

Requirements

Knut is using Language Server Protocol servers for the GUI. It is not used for the scripts, so if you are using Knut with the command line interface, you don't need it.

For C++, if you are using clangd, note that some tests are disabled for clangd version < 13.

Licensing

Knut is Β© KlarΓ€lvdalens Datakonsult AB (KDAB) and is licensed according to the terms of GPL 3.0.

Contact KDAB at info@kdab.com to inquire about licensing options.

Knut includes different 3rd party software, you can find the list and licenses for them in the 3RDPARTY document.

Building

To build Knut, you will need an up-to-date C++ & Qt toolchain. This includes:

On Windows, you may run into issues when building, especially if using QtCreator. This is a known issue, and the steps to resolve it are detailed in the link to the Contributing Guide in the Contributing section of this readme.

Download Knut

To clone the code and download all dependencies, simply run:

git clone https://github.com/KDAB/knut.git && cd knut

To download all dependencies, simply run:

  • Contributor outside KDAB (download all submodules in 3rdparty/)
git submodule update --init --recursive -- 3rdparty/*
  • Member of KDAB with access to our private repositories (download all submodules in 3rdparty/ and 3rdparty-kdab/)
git submodule update --init --recursive

Running CMake

After that you can build Knut with CMake via one of the presets. E.g.:

cmake --preset=release
cmake --build --preset=release

Take a look at CMakePreset.json for a list of available presets.

Running Knut

After building with CMake, run the knut binary from the bin folder within your build directory.

e.g.:

./build-release/bin/knut

Documentation

Visit our comprehensive documentation here: https://kdab.github.io/knut/index.html

Contributing

For information about contributing to Knut, see the "Contributing Guide" in our documentation.

About KDAB

Knut is written and maintained by KlarΓ€lvdalens Datakonsult AB (KDAB).

The KDAB Group is the global No.1 software consultancy for Qt, C++ and OpenGL applications across desktop, embedded and mobile platforms.

The KDAB Group provides consulting and mentoring for developing Qt applications from scratch and in porting from all popular and legacy frameworks to Qt. We continue to help develop parts of Qt and are one of the major contributors to the Qt Project. We can give advanced or standard training anywhere around the globe on Qt as well as C++, OpenGL, 3D and more.

Please visit https://www.kdab.com to meet the people who write code like this

Stay up-to-date with KDAB product announcements: