# analyze

**`analyze`** command is used to scan additional repos to detect components and analyze their dependency ***after*** you have gone through the initial setup using `init`.

#### `-i` / `--include`

By default `analyze` will take the current directory as the root and analyze everything. Supplying a glob pattern to `-i` will narrow and specify where to scan for components. You can also pass multiple glob patterns:

{% tabs %}
{% tab title="npm" %}

```sh
npx @omlet/cli analyze -i 'glob/one' -i 'glob/two'
```

{% endtab %}

{% tab title="yarn" %}

```sh
yarn dlx @omlet/cli analyze -i 'glob/one' -i 'glob/two'
```

{% endtab %}

{% tab title="pnpm" %}

```sh
pnpm dlx @omlet/cli analyze -i 'glob/one' -i 'glob/two'
```

{% endtab %}
{% endtabs %}

#### `--ignore`

Pass a glob pattern to any directory, file, or component that you would like Omlet CLI to ignore from scanning. You can pass multiple ignore glob patterns:&#x20;

{% tabs %}
{% tab title="npm" %}

```sh
npx @omlet/cli analyze --ignore 'glob/one' --ignore 'glob/two'
```

{% endtab %}

{% tab title="yarn" %}

```sh
yarn dlx @omlet/cli analyze --ignore 'glob/one' --ignore 'glob/two'
```

{% endtab %}

{% tab title="pnpm" %}

```sh
pnpm dlx @omlet/cli analyze --ignore 'glob/one' --ignore 'glob/two'
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
Glob patterns are applied against the file path relative to the project's root directory, for instance:

* `*` matches zero or more characters (excluding path separators).
* `?` matches any single character (excluding path separators).
* `**` recursively matches directories.

For more details, refer to the [Pattern in glob](https://docs.rs/glob/latest/glob/struct.Pattern.html) documentation.
{% endhint %}

#### `-r` / `--root`

Set where Omlet CLI will run the analysis. This option will come in handy if you are running the CLI from a directory that is different from the directory of the project you are trying to scan.

By default, the project root is the current working directory of the terminal. If that directory doesn't contain a package.json, the CLI will attempt to find the closest package.json up in the directory hierarchy starting from the current directory to determine the project root.

The CLI will also display an output in the terminal which indicates the root where it is running the scan:

```shell-session
Analyzing the project at <PATH>…
```

#### `--log-level`

Specify the log level for the CLI. Possible values you can pass: `error`, `warn`, `info`, `debug`, `trace`

#### `-v` / `--verbose`

By default, it is set as `false`. Adding this option will give you detailed log output in the CLI.

#### `--dry-run`

Scanned results will only be outputted locally to `omlet.out.json`. This will allow users to test results before uploading results to the Omlet web app.

#### `-h` / `--help`

`omlet analyze -h` will provide all the available options you can use to run the analyze command with some explanations.
