Skip to content

rai scm

Local SCM operations. Routes through the configured SCM adapter (GitLab, GitHub, Azure DevOps, Bitbucket) set in .raise/manifest.yaml under branches.scm.

Usage

rai scm COMMAND [OPTIONS]

Commands

Command Description
create-mr Create a merge request through the configured SCM adapter
merge-mr Wait for CI to pass, then merge the merge request
resolve-conflicts Auto-resolve merge conflicts declared in .raise/conflict-resolution.yaml

create-mr

Create a merge request. Appends the <!-- rai: ... --> governance block automatically (RAISE-15009) — there is no flag to suppress it.

Prints the MR URL on stdout so callers can capture it: MR_URL=$(rai scm create-mr ...).

rai scm create-mr --title "fix: something" --source my-branch --target release/3.1.0
Flag Short Description
--title Merge request title (required)
--source Source branch (required)
--target Target branch (required)
--description MR description (markdown)
--description-file Read the description from a file
--harness Agent runtime, recorded in the rai metadata
--session Session id (default: $RAI_SESSION_ID)
--project -p Repository root (default: this checkout)

merge-mr

Wait for CI to pass, then merge. Fail-closed: anything other than success blocks the merge.

rai scm merge-mr --mr-url https://gitlab.com/.../merge_requests/1442
Flag Description
--mr-url MR/PR URL to merge (required)
--delete-source-branch / --no-delete-source-branch Delete source branch after merge (default: delete)
--no-ci-override Skip CI polling entirely (for CI-less repositories)
--poll-interval Seconds between CI status checks
--timeout Maximum seconds to wait for CI

Exit codes: 0 merged, 1 adapter/config error, 3 CI gate refused.

resolve-conflicts

Auto-resolve merge conflicts using patterns declared in .raise/conflict-resolution.yaml.

rai scm resolve-conflicts

See Also

  • /rai-mr-create — governed MR creation skill (runs 5 admission checks before calling rai scm create-mr)