Skip to main content
Raigal provides commands for local code checks, automatic fixes, agent repair sessions, and CI quality gates.

Command index

Command reference

raigal scan

Evaluates the target directory and outputs the score breakdown.
Options:
  • --changes: scan files changed relative to git HEAD only.
  • --staged: scan staged git files only (useful in pre-commit hooks).
  • --base <ref>: compare diff against a specific git reference (such as origin/main).
  • -d, --verbose: show file-level details for each rule.
  • --json: output full diagnostic tree as JSON.
  • --sarif: output diagnostics in OASIS SARIF 2.1.0 format.
  • --exclude <patterns>: comma-separated or repeatable list of paths to exclude.
  • --include <patterns>: comma-separated or repeatable list of paths to include.
  • --fail-on <level>: exit with code 1 on findings matching none, error, or warning.

raigal ci

Runs quality evaluations in CI runners and exits with code 1 on failure.
  • Exits with code 1 if any error-level finding is detected or if the overall score falls below ci.failBelow (default: 70).
  • --changes: gate files changed relative to --base (or HEAD) only.
  • --staged: gate staged files only.
  • --base <ref>: diff base for --changes (such as origin/main).
  • --human: render formatted terminal summaries instead of JSON in CI logs.
  • --sarif: output SARIF 2.1.0 to stdout for code scanning annotations (e.g. raigal ci --sarif > results.sarif).
  • --format <format>: choose output format: json (default) or sarif.
(Reporting to the Raigal Cloud dashboard happens automatically in CI when authenticated via OIDC or RAIGAL_TOKEN).

raigal fix

Applies automated fixes for formatting, unused imports, and narrative comments.
  • --safe: applies deterministic changes with preserved semantics only (default).
  • -f, --force: runs broader fixes including dependency audits and framework alignment.
  • --dry-run: previews proposed fixes without modifying files.
  • -p, --prompt: formats remaining unfixable issues into a prompt for your coding agent.
  • --changes / --staged: restrict fixes to changed or staged files.
  • --base <ref>: diff base for --changes.

raigal agent

Runs automated repair sessions using local coding tools inside an isolated git worktree.
Flags:
  • --provider <provider>: agent provider to invoke (auto, codex, claude, opencode).
  • --target <n>: score threshold to reach (default: 90).
  • --max-turns <n>: maximum provider turns for one repair attempt (default: 5).
  • --max-cost <usd>: hard dollar ceiling aborting session if token costs exceed limit.
  • --limit <n>: maximum number of findings to pass to the provider (default: 8).
  • --in-place: edit current working tree directly instead of creating an isolated worktree.
  • --apply: apply accepted diff back to the original worktree upon completion.
  • -y, --yes: skip confirmation prompts for --apply.
  • --dry-run: print the selected provider and execution plan without running.
  • --background: start the agent process in the background and return immediately.
  • --no-fix: skip safe automated fixes before handing off to the provider.
  • --commit: commit the verified diff onto a repair branch.
  • --pr: push the branch and open a pull request on GitHub.
  • --branch <name>: branch name for --commit or --pr.
  • --base <branch>: target base branch for --pr.
  • --title <title>: pull request title for --pr.
  • --commit-message <msg>: commit message.
  • --ready: open a ready-for-review pull request instead of a draft.
  • --cleanup: remove the generated worktree even if changes remain.
Subcommands:
  • raigal agent plan [dir]: preview provider, worktree, findings, and publish actions without editing.
  • raigal agent connect [provider]: authenticate with a local coding-agent provider using its CLI credentials.
  • raigal agent providers: list detected local coding-agent providers and status.
  • raigal agent use [provider]: set or display the default provider for this repository.
  • raigal agent sessions [dir]: list active and past repair sessions.
  • raigal agent show <session-id>: inspect diff and metadata from an agent session.
  • raigal agent apply <session-id>: merge changes from a session into your working branch.
  • raigal agent monitor [dir]: watch git changes and run background audits (use --auto-fix to enable edits).

raigal hook

Manages shift-left agent interception hooks across Claude Code, Cursor, Gemini CLI, and other tools.
Subcommands:
  • raigal hook install [agents...]: install interception hooks (e.g. raigal hook install --claude).
  • raigal hook status: inspect registered hooks and SHA-256 sentinel integrity.
  • raigal hook baseline: capture current findings snapshot to .raigal/baseline.json.
  • raigal hook uninstall [agents...]: cleanly remove hooks while preserving user configuration.

raigal report-pr-closed

Reports a pull request closed or merged event to Raigal Cloud to update the remediation board.
  • --pr <number>: pull request number (read automatically from GITHUB_EVENT_PATH in GitHub Actions).
  • --merged: indicates whether the pull request was merged into the base branch.

raigal login and raigal logout

Manage Raigal Cloud credentials and offline lease authentication.

raigal whoami

Displays active user, organization, evaluation trial or license status, and authorized GitHub repositories.

raigal doctor

Verifies local environment, linters, formatters, and coding-agent binaries.

raigal rules

Displays registered rules, severity levels, auto-fix availability, and impact tiers.