[[kamelet-main-other]]
= Kamelet Main Component
:docTitle: Kamelet Main
:artifactId: camel-kamelet-main
:description: Main to run Kamelet standalone
:since: 3.11
:supportLevel: Preview

*Since Camel {since}*

A `main` class that is opinionated to boostrap and run Camel standalone with Kameleets for development and demo purposes.

== Initial configuration

The `KameletMain` is pre-configured with the following properties:

[source,properties]
----
camel.component.kamelet.location = classpath:/kamelets,github:apache:camel-kamelets
camel.main.routes-include-pattern = classpath:camel/*
camel.main.lightweight = true
----

These settings can be overridden by configuration in `application.properties`.

== Automatic dependencies downloading

The Kamelet Main can automatic download Kamelet YAML files from a remote location over http/https, and from github as well.

The official Kameleets from the Apache Camel Kamelet Catalog is stored on github and they can be used out of the box as-is.

For example a Camel route can be _coded_ in YAML which uses the Earthquake Kamelet from the catalog, as shown below:

[source,yaml]
----
- route:
    from: "kamelet:earthquake-source"
    steps:
      - unmarshal:
          json: {}
      - log: "Earthquake with magnitude ${body[properties][mag]} at ${body[properties][place]}"
----

In this use-case the earthquake kamelet will be downloaded from github, and as well its required dependencies.

NOTE: The dependencies are downloaded to `~/.groovy/grapes` directory. To force re-download then this directory can be deleted.

You can find an example with this at
https://github.com/apache/camel-examples/tree/main/examples/kamelet-main[kamelet-main].

