# Quick Start<no value>
// <!-- Required for asciidoctor -->
:toc:
// Set toclevels to be at least your hugo [markup.tableOfContents.endLevel] config key
:toclevels: 4


Updatecli is a command-line tool to update your files.
You specify in a manifest how you expect your files to be updated and then you run updatecli to apply the update.

This quickstart requires three components:

. Updatecli binary installed.
. The test data file to update is in this guide.
. The updatecli manifest is also in this guide.

== Installation

Updatecli is a standalone binary available on link:https://github.com/updatecli/updatecli/releases/latest[GitHub] with packages for Windows, Linux, and OSX.

If you don't have a local installation, please follow the installation guide at link:{{< ref "installation/#_packages" >}}[Installation →]

== Scenario

We will update a data file, if an update is needed according to our specified condition.

=== Data file

We need a sample data file that we want to update (if needed).
We are using a YAML file defining the "latest" Jenkins Docker image tag running in our infrastructure.

[source,yaml]
----
# data.yaml
{{<include "assets/code_example/docs/prologue/quickstart/data.yaml">}}
----

=== Updatecli Pipeline

Updatecli needs at least one manifest to know what update pipeline to apply.

In this manifest, we introduce three important concepts of an updatecli manifest.

. A **Source** definition describes where a piece of information is coming from. In the current example, we're looking for the latest Jenkins weekly version.
. A **Target** definition describes what we want to update based on a *source* output. In our example, we want to update the key "$.container.tag" in the file "data.yaml" to the version retrieved from the source, the latest Jenkins weekly version.
. A **Condition** definition defined conditions required to update the target. In this example, we want to test that the docker image "jenkinsci/jenkins:<latest Jenkins weekly version>" exists on DockerHub.

{{< btn-copy text="touch ./updatecli/updatecli.d/jenkins.yaml" >}}

---
image::/images/diagrams/pipeline.png["Updatecli Pipeline"]
---

[source,yaml]
----
# manifest.yaml
{{<include "assets/code_example/docs/prologue/quickstart/updatecli.yaml">}}
----

Source, Condition, and Target behave differently based on the plugin used, which is defined by the key "kind".

=== Updatecli Execution

Now that we have a data file and an updatecli manifest, describing how to update our file, let's see how to use updatecli.

So for doing so, please execute the following commands:

. To see what would change:
+
[source,shell]
----
updatecli diff --config manifest.yaml
----

. To apply the change:
+
[source,shell]
----
updatecli apply --config manifest.yaml
----

. To see that nothing needs to be changed anymore:
+
[source,shell]
----
updatecli apply --config manifest.yaml
----

Alternatively, you can copy all commands at once:

[source,shell]
----
updatecli diff --config manifest.yaml
updatecli apply --config manifest.yaml
updatecli apply --config manifest.yaml
----

== Video

{{<asciinema "CR5DIxyTLnvtt8NllEeYAx83U">}}

INFO: You can improve this video by contributing to link:https://github.com/updatecli/demo-terminal/tree/main/quickstart[updatecli/demo-terminal]


== Conclusion

Using this example, we saw how updatecli works with a simple pipeline. There are many improvements possible for this pipeline, such as automatically publishing updated files to a git repository, using the GitHub pull-request workflow, transforming the source value, not retrieving the latest version, and others.

The real power of updatecli is to combine different plugins to easily implement a customized update pipeline.

== Go Further

=== Core

Understand how the different core concepts work. link:/docs/core/[Core →]

=== Plugins

Understand how to combine the different plugins. link:/plugins/[Plugins →]

=== Continuously Update Everything

Learn how to continuously run updatecli to apply updates. link:/docs/automate/[CI →]

== Contributing

Find out how to contribute to Updatecli. link:/docs/help/contributing/[Contributing →]

== Help

Get some help. link:{{< ref "help" >}}[Help →]
