# Interface IScmProvider

Core SCM provider interface.

All methods return `Result<T, ScmError>` for consistent error handling across GitHub REST API, gh CLI, and future GitLab/Gitea backends.

interface IScmProvider {
platform: ScmPlatform;
repo: string;
getIssue(number: number): Promise<Result<ScmIssue, ScmError>>;
listIssues(
filters?: IssueFilters,
): Promise<Result<readonly ScmIssue[], ScmError>>;
createIssue(
title: string,
body: string,
labels?: readonly string[],
): Promise<Result<ScmIssue, ScmError>>;
addLabels(
issueNumber: number,
labels: readonly string[],
): Promise<Result<void, ScmError>>;
createPR(
options: CreatePROptions,
): Promise<Result<ScmPullRequest, ScmError>>;
mergePR(
prNumber: number,
options?: MergePROptions,
): Promise<Result<void, ScmError>>;
getPRStatus(prNumber: number): Promise<Result<ScmPRStatus, ScmError>>;
addComment(
issueNumber: number,
body: string,
): Promise<Result<void, ScmError>>;
listComments(
issueNumber: number,
): Promise<Result<readonly ScmComment[], ScmError>>;
}

#### Implemented by

- GitHubProvider

- Defined in packages/nexus-agents/src/scm/types.ts:184

##### Index

### Properties

platform
repo

### Methods

getIssue
listIssues
createIssue
addLabels
createPR
mergePR
getPRStatus
addComment
listComments

## Properties

### `Readonly` platform

platform: ScmPlatform

Platform identifier.

- Defined in packages/nexus-agents/src/scm/types.ts:186

### `Readonly` repo

repo: string

Repository in owner/repo format.

- Defined in packages/nexus-agents/src/scm/types.ts:189

## Methods

### getIssue

- getIssue(number: number): Promise<Result<ScmIssue, ScmError>>

  #### Parameters

  - number: number

  #### Returns Promise<Result<ScmIssue, ScmError>>

  - Defined in packages/nexus-agents/src/scm/types.ts:192

### listIssues

- listIssues(
  filters?: IssueFilters,
  ): Promise<Result<readonly ScmIssue[], ScmError>>

  #### Parameters

  - `Optional` filters: IssueFilters

  #### Returns Promise<Result<readonly ScmIssue[], ScmError>>

  - Defined in packages/nexus-agents/src/scm/types.ts:193

### createIssue

- createIssue(
  title: string,
  body: string,
  labels?: readonly string[],
  ): Promise<Result<ScmIssue, ScmError>>

  #### Parameters

  - title: string
  - body: string
  - `Optional` labels: readonly string[]

  #### Returns Promise<Result<ScmIssue, ScmError>>

  - Defined in packages/nexus-agents/src/scm/types.ts:194

### addLabels

- addLabels(
  issueNumber: number,
  labels: readonly string[],
  ): Promise<Result<void, ScmError>>

  #### Parameters

  - issueNumber: number
  - labels: readonly string[]

  #### Returns Promise<Result<void, ScmError>>

  - Defined in packages/nexus-agents/src/scm/types.ts:199

### createPR

- createPR(options: CreatePROptions): Promise<Result<ScmPullRequest, ScmError>>

  #### Parameters

  - options: CreatePROptions

  #### Returns Promise<Result<ScmPullRequest, ScmError>>

  - Defined in packages/nexus-agents/src/scm/types.ts:202

### mergePR

- mergePR(
  prNumber: number,
  options?: MergePROptions,
  ): Promise<Result<void, ScmError>>

  #### Parameters

  - prNumber: number
  - `Optional` options: MergePROptions

  #### Returns Promise<Result<void, ScmError>>

  - Defined in packages/nexus-agents/src/scm/types.ts:203

### getPRStatus

- getPRStatus(prNumber: number): Promise<Result<ScmPRStatus, ScmError>>

  #### Parameters

  - prNumber: number

  #### Returns Promise<Result<ScmPRStatus, ScmError>>

  - Defined in packages/nexus-agents/src/scm/types.ts:204

### addComment

- addComment(issueNumber: number, body: string): Promise<Result<void, ScmError>>

  #### Parameters

  - issueNumber: number
  - body: string

  #### Returns Promise<Result<void, ScmError>>

  - Defined in packages/nexus-agents/src/scm/types.ts:207

### listComments

- listComments(
  issueNumber: number,
  ): Promise<Result<readonly ScmComment[], ScmError>>

  #### Parameters

  - issueNumber: number

  #### Returns Promise<Result<readonly ScmComment[], ScmError>>

  - Defined in packages/nexus-agents/src/scm/types.ts:208