# Set up regular scans

Once you are happy with the results, you can set up Omlet CLI to run as part of your build process or schedule regular CLI runs. This way, you will see changes in usage over time and track the new components being added, removed, or updated.

To run Omlet CLI in an automated environment, you'll need to pass the Omlet access token to an environment variable.

You can generate an access token by running:&#x20;

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

```sh
npx @omlet/cli login --print-token
```

{% endtab %}

{% tab title="yarn" %}

```sh
yarn dlx @omlet/cli login --print-token
```

{% endtab %}

{% tab title="pnpm" %}

```sh
pnpm dlx @omlet/cli login --print-token
```

{% endtab %}
{% endtabs %}

Then, set the access token to an environment variable named `OMLET_TOKEN`. Omlet CLI will use this environment variable to upload scans. Here are the sample `.yaml` snippets for commonly used CI platforms:

{% tabs %}
{% tab title="GitHub Actions" %}

```yaml
name: Omlet CLI scan

on:
  push:
    branches:
      - main

jobs:
  analyze:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout code
        uses: actions/checkout@v2
        with:
          fetch-depth: 0

      - name: Set up Node.js
        uses: actions/setup-node@v2
        with:
          node-version: 20

      - name: Install dependencies
        run: npm ci

      - name: Run analyze
        run: npx @omlet/cli analyze
        env:
          OMLET_TOKEN: ${{ secrets.OMLET_TOKEN }}
```

{% endtab %}

{% tab title="GitLab CI/CD" %}

```yaml
stages:
  - scan

scan:
  stage: scan
  image: node:14
  script:
    - npx @omlet/cli analyze
  only:
    - main
  except:
    - tags

cache:
  paths:
    - node_modules/

variables:
  OMLET_TOKEN: $OMLET_TOKEN
```

{% endtab %}

{% tab title="CircleCI" %}

```yaml
version: 2.1

jobs:
  scan:
    docker:
      - image: circleci/node:14
    environment:
      OMLET_TOKEN: $OMLET_TOKEN
    steps:
      - checkout
      - run:
          name: Run Omlet analysis
          command: npx @omlet/cli analyze

workflows:
  version: 2
  scan:
    jobs:
      - scan:
          filters:
            branches:
              only: main
            tags:
              ignore: /.*/
```

{% endtab %}
{% endtabs %}
