Omlet Docs
BlogChangelogAsk the CommunityContact Sales
  • Get started
    • What is Omlet?
    • CLI & Dashboard
  • Omlet for VS Code
  • CLI & Dashboard
    • CLI
      • Your first scan
      • Set up your dashbard
      • Future scans
      • Ensure data accuracy
      • Config file
        • Exports configuration
        • Mapping aliases
        • Excluding certain components & files
        • Tutorial: Config file
      • Custom component properties
        • CLI hooks
        • Tutorial 1: Team/code owner usage
        • Tutorial 2: Package version tracking
        • Other example scripts
      • Set up regular scans
      • CLI commands
        • init
        • analyze
        • login
    • Analytics
      • Popular charts
      • Create custom charts
      • Save charts to dashboard
      • Share charts and dashboards with your team
      • Download chart data
    • Components
      • Search and filter components
      • Component tags
      • Dependency Tree
      • Props tracking
    • Workspace & Account
      • Invite team members
      • Renaming projects
      • Update your email address
      • Access your billing details & invoices
  • Security
    • Security in Omlet
    • Data collection
  • Help
    • Pricing
    • FAQs
      • How detection works?
      • Monorepo support
      • How to delete scans?
      • Omlet vs. React Scanner
      • Working with multiple workspaces
    • Troubleshooting
      • Debugging CLI issues
      • Some components aren't detected
      • API failed or timeout
      • Are you behind a proxy?
      • Troubleshooting Git errors
Powered by GitBook
On this page
  1. CLI & Dashboard
  2. CLI

Set up regular scans

Things you'll need to know while setting 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:

npx @omlet/cli login --print-token
yarn dlx @omlet/cli login --print-token
pnpm dlx @omlet/cli login --print-token

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:

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 }}
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
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: /.*/
PreviousOther example scriptsNextCLI commands

Last updated 11 months ago