https://github.com/kdab/knut
Knut is an automation tool for code transformation using scripts.
https://github.com/kdab/knut
automation migration qml qt6 scripting
Last synced: 2 months ago
JSON representation
Knut is an automation tool for code transformation using scripts.
- Host: GitHub
- URL: https://github.com/kdab/knut
- Owner: KDAB
- License: other
- Created: 2024-06-05T09:25:50.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-01-28T08:58:06.000Z (3 months ago)
- Last Synced: 2025-01-28T09:29:35.298Z (3 months ago)
- Topics: automation, migration, qml, qt6, scripting
- Language: C++
- Homepage:
- Size: 4.31 MB
- Stars: 6
- Watchers: 23
- Forks: 15
- Open Issues: 20
-
Metadata Files:
- Readme: README.md
- Contributing: docs/contributing/architecture.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Knut
[](https://github.com/KDAB/knut/actions)
[](LICENSES/GPL-3.0-only.txt)
[](https://kdab.github.io/knut/)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](https://tree-sitter.github.io/tree-sitter/)).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](https://kdab.github.io/knut/API/knut/document.html) for details on the supported functions of each class.| | π³ TreeSitter | π£ Code Items | π§βπ» LSP | π₯οΈ File Viewer |
|----------------------------|---------------|---------------|---------|---------------|
| C/C++ | β | β | β | |
| C# | β | β | β | |
| JSON | β | βοΈ | β | |
| [Qt Translate (.ts)][QtTs] | β | βοΈ | β | |
| [Qt Qml][Qml] | β | β | β | β |
| [Qt Ui files][QtUi] | β | β | β | β |
| [Slint][Slint] | β | β | β | β |
| [MFC rc files][MfcRc] | β | βοΈ | β | βοΈ |> β Fully Supported
> βοΈ Partial Support
> β Unsupported[QtTs]: https://doc.qt.io/qt-6/linguist-ts-file-format.html
[QtUi]: https://doc.qt.io/qt-6/designer-ui-file-format.html
[Qml]: https://doc.qt.io/qt-6/qmlreference.html
[Slint]: https://slint.dev/
[MfcRc]: https://learn.microsoft.com/en-us/windows/win32/menurc/about-resource-files## Requirements
Knut is using [Language Server Protocol](https://microsoft.github.io/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](LICENSES/GPL-3.0-only.txt).
Contact KDAB at to inquire about licensing options.
Knut includes different 3rd party software, you can find the list and licenses for them in the [3RDPARTY](3RDPARTY.md) document.
## Building
To build Knut, you will need an up-to-date C++ & Qt toolchain.
This includes:- A recent C++ compiler (GCC 11+, Clang 15+, MSVC 19.40+)
- [CMake](https://cmake.org) 3.15+
- An installation of [Qt 6](https://www.qt.io/download-open-source)
- (optional: [Ninja build system](https://ninja-build.org/))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](#contributing) section of this readme.### Download Knut
To clone the code, simply run:
```bash
git clone https://github.com/KDAB/knut.git && cd knut
```If you are a member of KDAB and have access to our private repositories, you may then simply run:
```bash
git submodule update --init --recursive
```to download all dependencies.
If you are a contributor outside KDAB, you will need to download all submodules in the `3rdparty/` folder, without the private dependencies in the `3rdparty-kdab/` folder.
```bash
git submodule update --init --recursive -- 3rdparty/*
```### Running CMake
After that you can build Knut with CMake via one of the presets.
E.g.:```bash
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.:
```bash
./build-release/bin/knut
```## Documentation
Visit our comprehensive documentation here: [https://kdab.github.io/knut/index.html](https://kdab.github.io/knut/index.html)
## Contributing
For information about contributing to Knut, see the ["Contributing Guide"](https://kdab.github.io/knut/contributing/getting-involved.html) 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](https://www.kdab.com) to meet the people who write code like this
Stay up-to-date with KDAB product announcements:
- [KDAB Newsletter](https://news.kdab.com)
- [KDAB Blogs](https://www.kdab.com/category/blogs)
- [KDAB on Twitter](https://twitter.com/KDABQt)