# Qt CLI (Command Line Interface) Tool A tool for creating Qt projects or files from the command line. ## Build To build the project, ensure you have Go installed on your system. ### Build the `qtcli` Binary ```bash $ go build . ``` ## Usage Currently `new` command is prepared for creating C++ class as well as C++ source and header files. Below is the command-line output when you run qtcli without any arguments. ```bash $ ./qtcli A CLI for creating Qt project and files Usage: qtcli [flags] qtcli [command] Available Commands: completion Generate the autocompletion script for the specified shell help Help about any command new Create a new project or file(s) Flags: -h, --help help for qtcli -v, --version version for qtcli Use "qtcli [command] --help" for more information about a command. ``` ### How to create C++ class ```bash $ ./qtcli new class MyObject --type cpp --output-dir output $ ls -lrt output total 8 -rw-rw-r-- 1 bencho bencho 258 Nov 12 10:07 MyObject.h -rw-rw-r-- 1 bencho bencho 192 Nov 12 10:07 MyObject.cpp ``` Additional flags can be used, for example: ```bash $ ./qtcli new class MyObject --type cpp --base QObject --include QObject --include QSharedData --include QDataStream --add Q_OBJECT --add QML_ELEMENT --qobject ``` A full list of available flags can be found using the --help option. ### How to create python class ```bash $ ./qtcli new class MyObject --type python --module PySide6 --import QWidget --output-dir output ``` ## License This extension can be licensed under the Qt Commercial License and the LGPL 3.0. See the text of both licenses here.