Docs › CLI reference

CLI reference

Every command and option, generated from the CLI itself. Run mrsentry <command> --help for the same information in your terminal.

Commands at a glance

CommandWhat it does
mrsentry clearDelete all mrsentry notes and drafts from an MR.
mrsentry config docsPrint (or update in README) the full configuration reference table.
mrsentry config initWrite a starter config file.
mrsentry config showPrint the effective configuration (secrets redacted).
mrsentry config validateValidate configuration files and environment.
mrsentry doctorCheck configuration, credentials, permissions and toolchains.
mrsentry ecr statusShow the effective ECR scan configuration (basic/enhanced, on-push/continuous) and finding freshness.
mrsentry fixFix vulnerable dependencies: open a new MR or push into an existing MR.
mrsentry reviewReview a GitLab merge request with full-repo context and post inline comments + overview.
mrsentry run mrMR pipeline: AI review + ECR scan, overview note, and a generated child pipeline for the fix job.
mrsentry run scheduledScheduled pipeline: scan the latest image and open (or refresh) a fix MR. No code review.
mrsentry scanPull High/Critical ECR findings (scan-mode aware) and map them to code dependencies.
mrsentry versionPrint version.

In GitLab CI, the project and MR are picked up from CI_PROJECT_ID and CI_MERGE_REQUEST_IID, so --project and --mr are only needed outside CI. --mr-url sets the GitLab URL, project and MR in one go.

mrsentry clear

Delete all mrsentry notes and drafts from an MR.

OptionDescription
--config, -cOrg/CI config YAML (env: MRSENTRY_CONFIG).
--mr-urlFull MR URL (sets gitlab url, project and MR).
--project, -pProject id or path (env: CI_PROJECT_ID).
--mr, -mMR IID (env: CI_MERGE_REQUEST_IID).
--gitlab-urlGitLab base URL (env: CI_SERVER_URL).
--dry-run / --no-dry-runDo not write to GitLab or push.
--verbose, -vDebug logging.

mrsentry config docs

Print (or update in README) the full configuration reference table.

OptionDescription
--readmeRewrite the reference block in this README.
--check / --no-checkExit 1 if README is out of date.

mrsentry config init <path>

Write a starter config file.

OptionDescription
--force / --no-forceOverwrite an existing file.

mrsentry config show

Print the effective configuration (secrets redacted).

OptionDescription
--config, -cOrg/CI config YAML (env: MRSENTRY_CONFIG).
--repo-dir
--formatyaml|json default yaml

mrsentry config validate

Validate configuration files and environment.

OptionDescription
--config, -cOrg/CI config YAML (env: MRSENTRY_CONFIG).
--repo-dir

mrsentry doctor

Check configuration, credentials, permissions and toolchains.

OptionDescription
--config, -cOrg/CI config YAML (env: MRSENTRY_CONFIG).
--offline / --no-offlineSkip network checks.
--llm / --no-llmSend a tiny prompt to the LLM. default True
--verbose, -vDebug logging.

mrsentry ecr status

Show the effective ECR scan configuration (basic/enhanced, on-push/continuous) and finding freshness.

OptionDescription
--config, -cOrg/CI config YAML (env: MRSENTRY_CONFIG).
--image, -iECR image: repo[:tag|@digest] or full ECR URI (env: MRSENTRY_ECR__IMAGE). Without tag, ecr.tag_strategy picks one.
--regionAWS region (default chain otherwise).
--verbose, -vDebug logging.

mrsentry fix

Fix vulnerable dependencies: open a new MR or push into an existing MR.

OptionDescription
--config, -cOrg/CI config YAML (env: MRSENTRY_CONFIG).
--image, -iECR image: repo[:tag|@digest] or full ECR URI (env: MRSENTRY_ECR__IMAGE). Without tag, ecr.tag_strategy picks one.
--modenew-mr | existing-mr (default fix.mode).
--mr-urlFull MR URL (sets gitlab url, project and MR).
--project, -pProject id or path (env: CI_PROJECT_ID).
--mr, -mMR IID (env: CI_MERGE_REQUEST_IID).
--gitlab-urlGitLab base URL (env: CI_SERVER_URL).
--target-branch
--regionAWS region (default chain otherwise).
--min-severityLowest vulnerability severity to act on (default high).
--on-stalerescan|local|warn|fail when ECR findings are stale.
--allow-major / --no-allow-major
--llm-repair / --no-llm-repair
--draft / --no-draft
--scan-reportUse a previous mrsentry-report.json instead of querying ECR (used by the generated child fix job).
--repo-pathUse this local checkout instead of cloning.
--dry-run / --no-dry-runDo not write to GitLab or push.
--output-dir, -oArtifacts directory (default mrsentry-out).
--modelOverride llm.profiles.default.model (LiteLLM model string; env: MRSENTRY_MODEL).
--verbose, -vDebug logging.

mrsentry review

Review a GitLab merge request with full-repo context and post inline comments + overview.

OptionDescription
--config, -cOrg/CI config YAML (env: MRSENTRY_CONFIG).
--mr-urlFull MR URL (sets gitlab url, project and MR).
--project, -pProject id or path (env: CI_PROJECT_ID).
--mr, -mMR IID (env: CI_MERGE_REQUEST_IID).
--gitlab-urlGitLab base URL (env: CI_SERVER_URL).
--repo-pathUse this local checkout instead of cloning.
--dry-run / --no-dry-runDo not write to GitLab or push.
--output-dir, -oArtifacts directory (default mrsentry-out).
--fail-onExit 1 if a finding/vuln >= severity (critical|high|medium|low|info).
--modelOverride llm.profiles.default.model (LiteLLM model string; env: MRSENTRY_MODEL).
--fullRe-review every file (ignore incremental cache).
--verbose, -vDebug logging.

mrsentry run mr

MR pipeline: AI review + ECR scan, overview note, and a generated child pipeline for the fix job.

OptionDescription
--config, -cOrg/CI config YAML (env: MRSENTRY_CONFIG).
--image, -iECR image: repo[:tag|@digest] or full ECR URI (env: MRSENTRY_ECR__IMAGE). Without tag, ecr.tag_strategy picks one.
--mr-urlFull MR URL (sets gitlab url, project and MR).
--project, -pProject id or path (env: CI_PROJECT_ID).
--mr, -mMR IID (env: CI_MERGE_REQUEST_IID).
--gitlab-urlGitLab base URL (env: CI_SERVER_URL).
--repo-pathUse this local checkout instead of cloning.
--dry-run / --no-dry-runDo not write to GitLab or push.
--output-dir, -oArtifacts directory (default mrsentry-out).
--fail-onExit 1 if a finding/vuln >= severity (critical|high|medium|low|info).
--modelOverride llm.profiles.default.model (LiteLLM model string; env: MRSENTRY_MODEL).
--fix-whenon_success | manual: how the generated child fix job runs. env MRSENTRY_FIX_WHEN default on_success
--child-imageDocker image for the generated fix job. env MRSENTRY_IMAGE
--verbose, -vDebug logging.

mrsentry run scheduled

Scheduled pipeline: scan the latest image and open (or refresh) a fix MR. No code review.

OptionDescription
--config, -cOrg/CI config YAML (env: MRSENTRY_CONFIG).
--image, -iECR image: repo[:tag|@digest] or full ECR URI (env: MRSENTRY_ECR__IMAGE). Without tag, ecr.tag_strategy picks one.
--project, -pProject id or path (env: CI_PROJECT_ID).
--gitlab-urlGitLab base URL (env: CI_SERVER_URL).
--target-branch
--repo-pathUse this local checkout instead of cloning.
--dry-run / --no-dry-runDo not write to GitLab or push.
--output-dir, -oArtifacts directory (default mrsentry-out).
--modelOverride llm.profiles.default.model (LiteLLM model string; env: MRSENTRY_MODEL).
--verbose, -vDebug logging.

mrsentry scan

Pull High/Critical ECR findings (scan-mode aware) and map them to code dependencies.

OptionDescription
--config, -cOrg/CI config YAML (env: MRSENTRY_CONFIG).
--image, -iECR image: repo[:tag|@digest] or full ECR URI (env: MRSENTRY_ECR__IMAGE). Without tag, ecr.tag_strategy picks one.
--regionAWS region (default chain otherwise).
--min-severityLowest vulnerability severity to act on (default high).
--on-stalerescan|local|warn|fail when ECR findings are stale.
--freshness-max-agee.g. 24h, 3d.
--repo-pathUse this local checkout instead of cloning.
--output-dir, -oArtifacts directory (default mrsentry-out).
--fail-onExit 1 if a finding/vuln >= severity (critical|high|medium|low|info).
--verbose, -vDebug logging.

mrsentry version

Print version.

Common recipes

# review locally without posting
mrsentry review --mr-url https://gitlab.example.com/group/app/-/merge_requests/42 --dry-run

# block the pipeline on high+ findings or vulnerabilities
mrsentry run mr --image orders-service --fail-on high

# what does ECR say about this repository?
mrsentry ecr status --image orders-service

# scan and map without fixing (writes mrsentry-out/)
mrsentry scan --image orders-service:1.14.2 --repo-path .

# remove every mrsentry comment from an MR
mrsentry clear --mr-url https://gitlab.example.com/group/app/-/merge_requests/42

# keep the README parameter table in sync (used by the project's CI)
mrsentry config docs --readme README.md --check