gate init

Writes a gate.config.ts. It is mostly comments: every option is documented in place, with the default it overrides.

Usage

gate init
gate init --workflow
gate init --json

Gate works with no configuration at all. Run init when you want to change the severity threshold, suppress a finding, or record why something is acceptable.

What it writes

gate.config.ts

import { defineConfig } from '@usegate/core'

export default defineConfig({
  /**
   * Severity at which \`gate scan\` exits non-zero.
   *
   * 'high' means the build fails on high and critical findings. Start here.
   */
  severity: 'high',

  /**
   * Suppressed findings.
   *
   * A reason is required. Six months from now the reason is the only thing
   * that will tell you whether the suppression is still true.
   */
  ignore: [],

  telemetry: true,

  baseline: '.gate/baseline.json',
})

With --workflow it also writes .github/workflows/gate.yml.

Options

  • Name
    --json
    Type
    boolean
    Description

    Write gate.config.json instead of TypeScript. Use this when your CI image runs a Node version older than 22.18, which cannot load a .ts config.

  • Name
    --workflow
    Type
    boolean
    Description

    Also create .github/workflows/gate.yml.

  • Name
    -f, --force
    Type
    boolean
    Description

    Overwrite an existing file. Without it, init refuses rather than clobbering a configuration somebody wrote.

Was this page helpful?