<commit_before>////
This guide is maintained in the main Quarkus repository
and pull requests should be submitted there:
https://github.com/quarkusio/quarkus/tree/main/docs/src/main/asciidoc
////
= Building Quarkus apps with Quarkus Command Line Interface (CLI)
:extension-status: preview
include::_attributes.adoc[]
:categories: tooling
:summary: Use the Quarkus CLI to create, build, run, and manage extensions for Quarkus projects.

The `quarkus` command lets you create projects, manage extensions and
do essential build and dev commands using the underlying project build tool.

include::{includes}/extension-status.adoc[]

== Installing the CLI

The Quarkus CLI is available in several developer-oriented package managers such as:

* https://sdkman.io[SDKMAN!]
* https://brew.sh[Homebrew]
* https://community.chocolatey.org/packages/quarkus[Chocolatey]
* https://scoop.sh[Scoop]

If you already use (or want to use) one of these tools, it is the simplest way to install the Quarkus CLI and keep it updated.

In addition to these package managers, the Quarkus CLI is also installable via https://www.jbang.dev[JBang].
Choose the alternative that is the most practical for you:

* JBang - for Linux, macOS and Windows
* SDKMAN! - for Linux and macOS
* Homebrew - for Linux and macOS
* Chocolatey - for Windows
* Scoop - for Windows

[role="primary asciidoc-tabs-sync-jbang"]
.JBang
****
The Quarkus CLI is available as a jar installable using https://jbang.dev[JBang]. 

JBang will use your existing Java or install one for you if needed.

On Linux, macOS, and Windows (using WSL or bash compatible shell like Cygwin or MinGW)
[source,bash]
----
curl -Ls https://sh.jbang.dev | bash -s - trust add https://repo1.maven.org/maven2/io/quarkus/quarkus-cli/
curl -Ls https://sh.jbang.dev | bash -s - app install --fresh --force quarkus@quarkusio
----

On Windows using Powershell:
[source,powershell]
----
iex "& { $(iwr https://ps.jbang.dev) } trust add https://repo1.maven.org/maven2/io/quarkus/quarkus-cli/"
iex "& { $(iwr https://ps.jbang.dev) } app install --fresh --force quarkus@quarkusio"
----

If JBang has already been installed, you can directly use it:
[source,bash]
----
# This can also be used to update to the latest version
jbang app install --fresh --force quarkus@quarkusio
----

If you want to use a specific version, you can directly target a version:
[source,bash]
----
# Create an alias in order to use a specific version
jbang app install --name qs2.2.5 io.quarkus:quarkus-cli:2.2.5.Final:runner
----

If you have built Quarkus locally, you can use that version:
[source,bash]
----
# Use the latest (or locally built) snapshot (with qss as an alias)
jbang app install --force --name qss ~/.m2/repository/io/quarkus/quarkus-cli/999-SNAPSHOT/quarkus-cli-999-SNAPSHOT-runner.jar
----

Once installed `quarkus` will be in your `$PATH` and if you run `quarkus --version` it will print the installed version:

[source,shell,subs=attributes+]
----
quarkus --version
{quarkus-version}
----

[CAUTION]
.Use a recent JBang version
====
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 you are installing JBang for the first time, start a new session to update your `PATH`.
====
****

[role="secondary asciidoc-tabs-sync-sdkman"]
.SDKMAN!
****
https://sdkman.io/[SDKMAN!] can be used to manage development environments.
It can manage parallel versions of multiple Software Development Kits on most Unix based systems,
making it a very good alternative to keep multiple JDK versions handy.

With SDKMAN!, you can also install popular Java tools, including the Quarkus CLI.

[NOTE]
====
Make sure you have https://sdkman.io/jdks[a JDK installed] before installing the Quarkus CLI.

To list the available versions of Java, use `sdk list java`.
You can then install the version of OpenJDK you want with `sdk install java x.y.z-open`
(or the JDK of another vendor if it is your preference).
====

To install the Quarkus CLI using SDKMAN!, run the following command:

[source,shell]
----
sdk install quarkus
----

It will install the latest version of the Quarkus CLI.

Once installed `quarkus` will be in your `$PATH` and if you run `quarkus --version` it will print the installed version:

[source,shell,subs=attributes+]
----
quarkus --version
{quarkus-version}
----

SDKMAN! will let you know when new versions are available so updates will be straightforward:

[source,shell]
----
sdk upgrade quarkus
----
****

[role="secondary asciidoc-tabs-sync-homebrew"]
.Homebrew
****
https://brew.sh[Homebrew] is a package manager for macOS (and Linux).

You can use Homebrew to install (and update) the Quarkus CLI.

[NOTE]
====
Make sure you have a JDK installed before installing the Quarkus CLI.
We haven't added an explicit dependency as we wanted to make sure you could use your preferred JDK version.

You can install a JDK with `brew install openjdk` for Java 17 or `brew install openjdk@11` for Java 11.
====

To install the Quarkus CLI using Homebrew, run the following command:

[source,shell]
----
brew install quarkusio/tap/quarkus
----

It will install the latest version of the Quarkus CLI.
This command can also be used to update the Quarkus CLI.

Once installed `quarkus` will be in your `$PATH` and if you run `quarkus --version` it will print the installed version:

[source,shell,subs=attributes+]
----
quarkus --version
{quarkus-version}<commit_msg>update latest brew openjdk package<commit_after>////
This guide is maintained in the main Quarkus repository
and pull requests should be submitted there:
https://github.com/quarkusio/quarkus/tree/main/docs/src/main/asciidoc
////
= Building Quarkus apps with Quarkus Command Line Interface (CLI)
:extension-status: preview
include::_attributes.adoc[]
:categories: tooling
:summary: Use the Quarkus CLI to create, build, run, and manage extensions for Quarkus projects.

The `quarkus` command lets you create projects, manage extensions and
do essential build and dev commands using the underlying project build tool.

include::{includes}/extension-status.adoc[]

== Installing the CLI

The Quarkus CLI is available in several developer-oriented package managers such as:

* https://sdkman.io[SDKMAN!]
* https://brew.sh[Homebrew]
* https://community.chocolatey.org/packages/quarkus[Chocolatey]
* https://scoop.sh[Scoop]

If you already use (or want to use) one of these tools, it is the simplest way to install the Quarkus CLI and keep it updated.

In addition to these package managers, the Quarkus CLI is also installable via https://www.jbang.dev[JBang].
Choose the alternative that is the most practical for you:

* JBang - for Linux, macOS and Windows
* SDKMAN! - for Linux and macOS
* Homebrew - for Linux and macOS
* Chocolatey - for Windows
* Scoop - for Windows

[role="primary asciidoc-tabs-sync-jbang"]
.JBang
****
The Quarkus CLI is available as a jar installable using https://jbang.dev[JBang]. 

JBang will use your existing Java or install one for you if needed.

On Linux, macOS, and Windows (using WSL or bash compatible shell like Cygwin or MinGW)
[source,bash]
----
curl -Ls https://sh.jbang.dev | bash -s - trust add https://repo1.maven.org/maven2/io/quarkus/quarkus-cli/
curl -Ls https://sh.jbang.dev | bash -s - app install --fresh --force quarkus@quarkusio
----

On Windows using Powershell:
[source,powershell]
----
iex "& { $(iwr https://ps.jbang.dev) } trust add https://repo1.maven.org/maven2/io/quarkus/quarkus-cli/"
iex "& { $(iwr https://ps.jbang.dev) } app install --fresh --force quarkus@quarkusio"
----

If JBang has already been installed, you can directly use it:
[source,bash]
----
# This can also be used to update to the latest version
jbang app install --fresh --force quarkus@quarkusio
----

If you want to use a specific version, you can directly target a version:
[source,bash]
----
# Create an alias in order to use a specific version
jbang app install --name qs2.2.5 io.quarkus:quarkus-cli:2.2.5.Final:runner
----

If you have built Quarkus locally, you can use that version:
[source,bash]
----
# Use the latest (or locally built) snapshot (with qss as an alias)
jbang app install --force --name qss ~/.m2/repository/io/quarkus/quarkus-cli/999-SNAPSHOT/quarkus-cli-999-SNAPSHOT-runner.jar
----

Once installed `quarkus` will be in your `$PATH` and if you run `quarkus --version` it will print the installed version:

[source,shell,subs=attributes+]
----
quarkus --version
{quarkus-version}
----

[CAUTION]
.Use a recent JBang version
====
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 you are installing JBang for the first time, start a new session to update your `PATH`.
====
****

[role="secondary asciidoc-tabs-sync-sdkman"]
.SDKMAN!
****
https://sdkman.io/[SDKMAN!] can be used to manage development environments.
It can manage parallel versions of multiple Software Development Kits on most Unix based systems,
making it a very good alternative to keep multiple JDK versions handy.

With SDKMAN!, you can also install popular Java tools, including the Quarkus CLI.

[NOTE]
====
Make sure you have https://sdkman.io/jdks[a JDK installed] before installing the Quarkus CLI.

To list the available versions of Java, use `sdk list java`.
You can then install the version of OpenJDK you want with `sdk install java x.y.z-open`
(or the JDK of another vendor if it is your preference).
====

To install the Quarkus CLI using SDKMAN!, run the following command:

[source,shell]
----
sdk install quarkus
----

It will install the latest version of the Quarkus CLI.

Once installed `quarkus` will be in your `$PATH` and if you run `quarkus --version` it will print the installed version:

[source,shell,subs=attributes+]
----
quarkus --version
{quarkus-version}
----

SDKMAN! will let you know when new versions are available so updates will be straightforward:

[source,shell]
----
sdk upgrade quarkus
----
****

[role="secondary asciidoc-tabs-sync-homebrew"]
.Homebrew
****
https://brew.sh[Homebrew] is a package manager for macOS (and Linux).

You can use Homebrew to install (and update) the Quarkus CLI.

[NOTE]
====
Make sure you have a JDK installed before installing the Quarkus CLI.
We haven't added an explicit dependency as we wanted to make sure you could use your preferred JDK version.

You can install a JDK with `brew install openjdk` for the latest Java version, `brew install openjdk@17` for Java 17, or `brew install openjdk@11` for Java 11.
====

To install the Quarkus CLI using Homebrew, run the following command:

[source,shell]
----
brew install quarkusio/tap/quarkus
----

It will install the latest version of the Quarkus CLI.
This command can also be used to update the Quarkus CLI.

Once installed `quarkus` will be in your `$PATH` and if you run `quarkus --version` it will print the installed version:

[source,shell,subs=attributes+]
----
quarkus --version
{quarkus-version}
{'fraction_non_alphanumeric': 0.1061906913691821, 'fraction_numerical': 0.005061003163126977, 'mean_word_length': 4.000451875282422, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 32, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6256938', 'n_tokens_mistral': 3552, 'n_tokens_neox': 3301, 'n_words': 1435}