The Quarkus CLI is named qs
as in shorthand for Quarkus. qs
lets you create projects, manage extensions and
do essential build and dev commands using the underlying projects build tool.
This technology is considered experimental. In experimental mode, early feedback is requested to mature the idea. There is no guarantee of stability nor long term presence in the platform until the solution matures. Feedback is welcome on our mailing list or as issues in our GitHub issue tracker. For a full list of possible extension statuses, check our FAQ entry. |
Installing the CLI
The Quarkus CLI is currently available as a jar installable using jbang.
On Linux, macOS, and Windows (using WSL or bash compatible shell like cygwin or mingw)
curl -Ls https://sh.jbang.dev | bash -s - app install --force qs@quarkusio
On Windows using Powershell:
iex "& { $(iwr https://ps.jbang.dev) } app install --force qs@quarkusio"
Note: if you get an error about app
not being readable then you probably
have a jbang
version older than v0.56.0 installed. Please remove or upgrade it to a recent version.
If this is the first time you install, start a new session to get your PATH
updated.
Once installed qs
will be in your PATH and if you run qs --version
it will print the installed version:
qs --version
{quarkus-version}
Using the CLI
Now you can run the Quarkus CLI:
$ qs
Usage: quarkus [-ehV] [--verbose] [COMMAND]
-e, --errors Produce execution error messages.
-h, --help Show this help message and exit.
-V, --version Print version information and exit.
--verbose Verbose mode.
Commands:
build Build your quarkus project
clean Clean current project
create Create a new quarkus project.
create-jbang Create a new quarkus jbang project.
list List installed (default) or installable extensions.
platforms List imported (default) or all available Quarkus platforms.
add Add extension(s) to current project.
remove, rm Remove an extension from this project.
dev Execute project in live coding dev mode
create-extension Creates the base of a Quarkus extension in different layout depending of the options and environment.
This will display the help information with all the available commands.
Creating a new project
To create a new project we use the create-project command:
$ qs create -a myapp
This will create a folder called 'myapp' in your current working directory using default
groupId, artifactId and version values (groupId='org.acme', artifactId='myapp' and version='1.0.0-SNAPSHOT').
To specify the groupId, artifactId and version values, use the '--group-id', '--artifact-id' and '--version' options:
$ qs create --group-id com.foo --artifact-id bar --version 1.0
`-g`,`-a`,`-v` are short hand options for the full name counter parts: `--group-id`,`--artifact-id` and `--version`. We use both short and full names in this guide interchangeably.
Use the help option to display all the possible options:
$ qs create --help
Dealing with extensions
The Quarkus CLI can obtain a list of the extensions in the project:
$ qs list
To get a list of available extensions to install use --installable
or -i
You can combine that with a search (--search
or -s
) and get a concise list including description with --concise
$ qs list -i --concise -s jdbc
JDBC Driver - DB2 quarkus-jdbc-db2
JDBC Driver - PostgreSQL quarkus-jdbc-postgresql
JDBC Driver - H2 quarkus-jdbc-h2
JDBC Driver - MariaDB quarkus-jdbc-mariadb
JDBC Driver - Microsoft SQL Server quarkus-jdbc-mssql
JDBC Driver - MySQL quarkus-jdbc-mysql
JDBC Driver - Derby quarkus-jdbc-derby
Elytron Security JDBC quarkus-elytron-security-jdbc
Agroal - Database connection pool quarkus-agroal
Adding extension(s)
The Quarkus CLI can add Quarkus one or more extensions to your project with the 'add' command:
$ qs add kubernetes health
[SUCCESS] ✅ Extension io.quarkus:quarkus-kubernetes has been installed
[SUCCESS] ✅ Extension io.quarkus:quarkus-smallrye-health has been installed
Development mode
To start dev mode from the Quarkus CLI do:
$ quarkus dev
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------------------< org.acme:myapp >---------------------------
[INFO] Building myapp 1.0.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- quarkus-maven-plugin:1.13.0.Final:dev (default-cli) @ myapp ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO] Nothing to compile - all classes are up to date
Listening for transport dt_socket at address: 5005
[INFO] Checking for existing resources in: /Users/max/demo/myapp/src/main/kubernetes.
__ ____ __ _____ ___ __ ____ ______
--/ __ \/ / / / _ | / _ \/ //_/ / / / __/
-/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \
--\___\_\____/_/ |_/_/|_/_/|_|\____/___/
2021-03-26 11:17:36,270 INFO [io.quarkus] (Quarkus Main Thread) myapp 1.0.0-SNAPSHOT on JVM (powered by Quarkus 1.13.0.Final) started in 2.562s. Listening on: http://localhost:8080
2021-03-26 11:17:36,275 INFO [io.quarkus] (Quarkus Main Thread) Profile dev activated. Live Coding activated.
2021-03-26 11:17:36,275 INFO [io.quarkus] (Quarkus Main Thread) Installed features: [cdi, kubernetes, resteasy, smallrye-health]
Quarkus cli will use the right maven or gradle command dependent on your projects setup. Above is showing a maven project, but you can
just as easily use gradle with qs dev