# Function createScmProvider

- createScmProvider(
  config: CreateScmProviderConfig,
  ): Promise<Result<IScmProvider, ScmError>>

  Creates an SCM provider for the specified repository.

  Token resolution is automatic — checks env vars and CLI auth. Currently supports GitHub (gh CLI). GitLab/Gitea planned.

  #### Parameters

  - config: CreateScmProviderConfig

    Provider configuration

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

  SCM provider instance or error

  #### Example

      const result = await createScmProvider({ repo: 'owner/repo' });
      if (!result.ok) { console.error(result.error); return; }
      const issues = await result.value.listIssues();

  - Defined in packages/nexus-agents/src/scm/factory.ts:44