Configuration

Customize Oculum's behavior with configuration files, profiles, and ignore patterns.


Config Files

Oculum looks for configuration in this order (first found wins):

  1. oculum.config.json
  2. .oculumrc.json
  3. .oculumrc

Place the config file in your project root.


Config Options

{
  "depth": "cheap",
  "failOn": "none",
  "format": "terminal",
  "output": null,
  "quiet": false,
  "verbose": false,
  "ignore": [],
  "include": [],
  "profiles": {},
  "watch": {}
}

Option Reference

OptionTypeDefaultDescription
depthstring"cheap"Default scan depth: cheap, validated, deep
failOnstring"none"Exit 1 on severity: critical, high, medium, low, none
formatstring"terminal"Output format: terminal, json, sarif, markdown
outputstringnullWrite output to this file path
quietbooleanfalseMinimal output
verbosebooleanfalseDebug output
ignorestring[][]Glob patterns to ignore
includestring[][]Only scan files matching these patterns
profilesobject{}Named configuration profiles
watchobject{}Watch mode settings

Profiles

Profiles let you save different configurations for different use cases.

Defining Profiles

{
  "depth": "cheap",
  "profiles": {
    "ci": {
      "depth": "validated",
      "format": "sarif",
      "output": "results.sarif",
      "quiet": true,
      "failOn": "high"
    },
    "audit": {
      "depth": "deep",
      "format": "json",
      "output": "audit-report.json"
    },
    "quick": {
      "depth": "cheap",
      "ignore": ["**/*.test.ts", "**/*.spec.ts"]
    }
  }
}

Using Profiles

# Use the CI profile
oculum scan -p ci

# Use the audit profile
oculum scan -p audit

# Profile + CLI flag (CLI wins)
oculum scan -p ci --verbose

Priority Order

When options conflict, this order determines the winner:

  1. CLI flags (highest priority)
  2. Profile settings
  3. Project config file
  4. Built-in defaults (lowest priority)

Watch Options

Configure watch mode defaults:

{
  "watch": {
    "debounce": 500,
    "cooldown": 10,
    "clear": false
  }
}
OptionTypeDefaultDescription
debouncenumber500Milliseconds to wait after last change
cooldownnumber10Minimum seconds between scans
clearbooleanfalseClear console before each scan

.oculumignore

Create a .oculumignore file for gitignore-style patterns. One pattern per line.

Example

# Comments start with #

# Ignore test files
**/*.test.ts
**/*.spec.ts
__tests__/

# Ignore fixtures and mocks
fixtures/
**/*.mock.ts
**/*.fixture.ts

# Ignore legacy code
legacy/
deprecated/

# Ignore minified files
*.min.js
*.bundle.js

# Ignore generated code
generated/
.next/
dist/

Pattern Syntax

PatternMatches
*.test.tsFiles ending in .test.ts in current directory
**/*.test.tsFiles ending in .test.ts anywhere
tests/Directory named tests and all contents
src/legacy/*Files directly in src/legacy/
src/legacy/**All files under src/legacy/ recursively

Default Ignore Patterns

These patterns are always ignored (you don't need to add them):

Directories

  • node_modules/
  • dist/, build/, out/
  • .git/, .svn/
  • coverage/
  • .next/, .nuxt/, .turbo/
  • vendor/, venv/, .venv/

Files

  • package-lock.json, yarn.lock, pnpm-lock.yaml
  • *.min.js, *.bundle.js
  • Binary files (images, fonts, etc.)

Include Patterns

Use include to scan only specific files/directories:

{
  "include": [
    "src/**",
    "lib/**"
  ]
}

When include is set, only files matching these patterns are scanned.

Combining Include and Ignore

{
  "include": ["src/**"],
  "ignore": ["src/**/*.test.ts"]
}

This scans everything in src/ except test files.


Environment Variables

VariableDescription
OCULUM_API_KEYAPI key for authentication (alternative to oculum login)

CI/CD Example

# GitHub Actions
env:
  OCULUM_API_KEY: ${{ secrets.OCULUM_API_KEY }}

steps:
  - run: oculum scan --depth validated

Example Configurations

Basic Project

{
  "ignore": [
    "**/*.test.ts",
    "**/*.spec.ts"
  ]
}

Monorepo

{
  "include": [
    "packages/api/src/**",
    "packages/web/src/**"
  ],
  "ignore": [
    "**/__tests__/**",
    "**/fixtures/**"
  ],
  "profiles": {
    "api": {
      "include": ["packages/api/src/**"]
    },
    "web": {
      "include": ["packages/web/src/**"]
    }
  }
}

Full CI Setup

{
  "depth": "cheap",
  "profiles": {
    "ci": {
      "depth": "validated",
      "format": "sarif",
      "output": "results.sarif",
      "failOn": "high",
      "quiet": true
    },
    "pr": {
      "depth": "cheap",
      "failOn": "critical"
    }
  },
  "ignore": [
    "**/*.test.ts",
    "**/*.spec.ts",
    "**/__mocks__/**"
  ]
}

Use with:

# On PRs - quick feedback
oculum scan -p pr --incremental

# On main - thorough scan
oculum scan -p ci

Related