> For the complete documentation index, see [llms.txt](https://docs.fourclover.org/v0.1/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fourclover.org/v0.1/tool-guides/initiating-a-comparison.md).

# Initiating a Comparison

To compare two scan reports, use the `compare` command followed by the paths of the two reports you want to compare:

<pre class="language-bash"><code class="lang-bash">fourclover compare -new <a data-footnote-ref href="#user-content-fn-1">report_2.json</a> -old <a data-footnote-ref href="#user-content-fn-2">report_1.json</a>
</code></pre>

#### **Specifying Output File (Optional):**

If you want to save the comparison report to a file:

<pre class="language-bash"><code class="lang-bash">fourclover compare -new report_1.json -old report_2.json -out <a data-footnote-ref href="#user-content-fn-3">comparison_report.txt</a>
</code></pre>

### **Understanding the Comparison Report**

After executing the comparison command, Four Clover generates a comparison report that highlights the differences between the two scan reports.

#### **Components of the Comparison Report**

The comparison report provides valuable insights into the changes between the two reports. It typically includes the following components:

* **Date:** Date and time when the comparison was performed.
* **Scanned Directories:** Paths of the directories scanned in the old and new reports.
* **Total Number of Changes:** Total count of changes detected.
* **Number of Files Added/Altered/Deleted/Renamed:** Breakdown of different types of changes detected.

For each change detected, the report will list the details of the change, including the type of change (added, altered, deleted, renamed), the affected file's name, and any other relevant information.

#### **Interpreting the Changes**

* **\[ADDED]:** Files that are present in the new report but not in the old report.
* **\[ALTERED]:** Files with modified content between the old and new reports.
* **\[DELETED]:** Files that were present in the old report but are missing in the new report.
* **\[RENAMED]:** Files that have been renamed between the old and new reports.

By comparing scan reports, you can pinpoint changes and assess their impact, whether they indicate legitimate updates or potential security concerns.

Remember to replace `report_1.json` and `report_2.json` with the actual paths to the two scan reports you want to compare.

#### **Example Output of a Comparison Report:**

```typescript
-------------------- CHANGE REPORT --------------------
Date:                2023-04-20T14:30:00+00:00
Scanned directories: Old report: /path/old_directory
                     New report: /path/new_directory
Total number of changes: 4
Number of files added:   1
Number of files altered: 1
Number of files deleted: 1
Number of files renamed: 1
-------------------------------------------------------
[ADDED] new_file.txt
[ALTERED] modified_file.txt
[DELETED] deleted_file.txt
[RENAMED] old_name.txt -> new_name.txt
--------------------- REPORT END ----------------------
```

[^1]: The path of the new snapshot report.

[^2]: The path of the old snapshot report.

[^3]: A desired name of the output file. You can specify a path format as well.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.fourclover.org/v0.1/tool-guides/initiating-a-comparison.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
