Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Github connector

OAuth 2.0Developer ToolsCollaboration

GitHub is a cloud-based Git repository hosting service that allows developers to store, manage, and track changes to their code.

Github connector

  1. Terminal window
    npm install @scalekit-sdk/node

    Full SDK reference: Node.js | Python

  2. Add your Scalekit credentials to your .env file. Find values in app.scalekit.com > Developers > API Credentials.

    .env
    SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
    SCALEKIT_CLIENT_ID=<your-client-id>
    SCALEKIT_CLIENT_SECRET=<your-client-secret>
  3. Register your Github credentials with Scalekit so it handles the token lifecycle. You do this once per environment.

    Dashboard setup steps

    Register your Scalekit environment with the GitHub connector so Scalekit handles the authentication flow and token lifecycle for you. The connection name you create will be used to identify and invoke the connection programmatically. Then complete the configuration in your application as follows:

    1. Set up auth redirects

      • In Scalekit dashboard, go to AgentKit > Connections > Create Connection. Find GitHub and click Create.

      • Click Use your own credentials and copy the redirect URI. It looks like https://<SCALEKIT_ENVIRONMENT_URL>/sso/v1/oauth/<CONNECTION_ID>/callback.

        Copy redirect URI from Scalekit dashboard

      • Go to GitHub Developer Settings and open your OAuth app.

      • Under General, paste the copied URI into the Authorization callback URL field and click Save application.

        Add callback URL in GitHub OAuth app settings

    2. Get client credentials

      In GitHub Developer Settings, open your OAuth app:

      • Client ID — listed on the app’s main settings page
      • Client Secret — click Generate a new client secret if you don’t have one
    3. Add credentials in Scalekit

      • In Scalekit dashboard, go to AgentKit > Connections and open the connection you created.

      • Enter your credentials:

        • Client ID (from your GitHub OAuth app)
        • Client Secret (from your GitHub OAuth app)

        Add credentials for GitHub in Scalekit dashboard

      • Click Save.

  4. quickstart.ts
    import { ScalekitClient } from '@scalekit-sdk/node'
    import 'dotenv/config'
    const scalekit = new ScalekitClient(
    process.env.SCALEKIT_ENV_URL,
    process.env.SCALEKIT_CLIENT_ID,
    process.env.SCALEKIT_CLIENT_SECRET,
    )
    const actions = scalekit.actions
    const connector = 'github'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
    console.log('Authorize Github:', link)
    process.stdout.write('Press Enter after authorizing...')
    await new Promise(r => process.stdin.once('data', r))
    // Make your first call
    const result = await actions.executeTool({
    connector,
    identifier,
    toolName: 'github_user_repos_list',
    toolInput: {},
    })
    console.log(result)

Connect this agent connector to let your agent:

  • Read repositories — fetch repo metadata, files, commits, branches, and tags
  • Manage issues — create, update, close, and comment on issues
  • Work with pull requests — open PRs, post reviews, and merge changes
  • Search code — search across repositories by keyword, language, or file path
  • Trigger workflows — dispatch GitHub Actions workflow runs
Proxy API call
const result = await actions.request({
connectionName: 'github',
identifier: 'user_123',
path: '/user',
method: 'GET',
});
console.log(result);
Execute a tool
const result = await actions.executeTool({
connector: 'github',
identifier: 'user_123',
toolName: 'github_branch_create',
toolInput: {},
});
console.log(result);

Use the exact tool names from the Tool list below when you call execute_tool. If you’re not sure which name to use, list the tools available for the current user first.

github_branch_create#Create a new branch in a GitHub repository. Requires the SHA of the commit to branch from (typically the HEAD of main).4 params

Create a new branch in a GitHub repository. Requires the SHA of the commit to branch from (typically the HEAD of main).

NameTypeRequiredDescription
branch_namestringrequiredName of the new branch to create
ownerstringrequiredThe account owner of the repository
repostringrequiredThe name of the repository
shastringrequiredThe SHA of the commit to branch from. Use the HEAD SHA of the base branch (e.g. main).
github_branch_get#Get details of a specific branch in a GitHub repository. Returns the branch name, latest commit SHA, and protection status.3 params

Get details of a specific branch in a GitHub repository. Returns the branch name, latest commit SHA, and protection status.

NameTypeRequiredDescription
branchstringrequiredThe name of the branch to retrieve
ownerstringrequiredThe account owner of the repository
repostringrequiredThe name of the repository
github_branches_list#List all branches in a GitHub repository. Returns branch names, commit SHAs, and protection status. Supports pagination.5 params

List all branches in a GitHub repository. Returns branch names, commit SHAs, and protection status. Supports pagination.

NameTypeRequiredDescription
ownerstringrequiredThe account owner of the repository
repostringrequiredThe name of the repository
pageintegeroptionalPage number of results to return (default 1)
per_pageintegeroptionalNumber of results per page (max 100, default 30)
protectedbooleanoptionalFilter to only protected branches
github_file_contents_get#Get the contents of a file or directory from a GitHub repository. Returns Base64 encoded content for files.4 params

Get the contents of a file or directory from a GitHub repository. Returns Base64 encoded content for files.

NameTypeRequiredDescription
ownerstringrequiredThe account owner of the repository
pathstringrequiredThe content path (file or directory path in the repository)
repostringrequiredThe name of the repository
refstringoptionalThe name of the commit/branch/tag
github_file_create_update#Create a new file or update an existing file in a GitHub repository. Content must be Base64 encoded. Requires SHA when updating existing files.9 params

Create a new file or update an existing file in a GitHub repository. Content must be Base64 encoded. Requires SHA when updating existing files.

NameTypeRequiredDescription
contentstringrequiredThe new file content (Base64 encoded)
messagestringrequiredThe commit message for this change
ownerstringrequiredThe account owner of the repository
pathstringrequiredThe file path in the repository
repostringrequiredThe name of the repository
authorobjectoptionalAuthor information object with name and email
branchstringoptionalThe branch name
committerobjectoptionalCommitter information object with name and email
shastringoptionalThe blob SHA of the file being replaced (required when updating existing files)
github_issue_create#Create a new issue in a repository. Requires push access to set assignees, milestones, and labels.8 params

Create a new issue in a repository. Requires push access to set assignees, milestones, and labels.

NameTypeRequiredDescription
ownerstringrequiredThe account owner of the repository
repostringrequiredThe name of the repository
titlestringrequiredThe title of the issue
assigneesarrayoptionalGitHub usernames to assign to the issue
bodystringoptionalThe contents of the issue
labelsarrayoptionalLabels to associate with the issue
milestonenumberoptionalMilestone number to associate with the issue
typestringoptionalThe name of the issue type
github_issues_list#List issues in a repository. Both issues and pull requests are returned as issues in the GitHub API.12 params

List issues in a repository. Both issues and pull requests are returned as issues in the GitHub API.

NameTypeRequiredDescription
ownerstringrequiredThe account owner of the repository
repostringrequiredThe name of the repository
assigneestringoptionalFilter by assigned user
creatorstringoptionalFilter by issue creator
directionstringoptionalSort order
labelsstringoptionalFilter by comma-separated list of label names
milestonestringoptionalFilter by milestone number or state
pagenumberoptionalPage number of results to fetch
per_pagenumberoptionalNumber of results per page (max 100)
sincestringoptionalShow issues updated after this timestamp (ISO 8601 format)
sortstringoptionalProperty to sort issues by
statestringoptionalFilter by issue state
github_public_repos_list#List public repositories for a specified user. Does not require authentication.6 params

List public repositories for a specified user. Does not require authentication.

NameTypeRequiredDescription
usernamestringrequiredThe GitHub username to list repositories for
directionstringoptionalSort order
pagenumberoptionalPage number of results to fetch
per_pagenumberoptionalNumber of results per page (max 100)
sortstringoptionalProperty to sort repositories by
typestringoptionalFilter repositories by type
github_pull_request_create#Create a new pull request in a repository. Requires write access to the head branch.8 params

Create a new pull request in a repository. Requires write access to the head branch.

NameTypeRequiredDescription
basestringrequiredThe name of the branch you want the changes pulled into
headstringrequiredThe name of the branch where your changes are implemented (format: user:branch)
ownerstringrequiredThe account owner of the repository
repostringrequiredThe name of the repository
bodystringoptionalThe contents of the pull request description
draftbooleanoptionalIndicates whether the pull request is a draft
maintainer_can_modifybooleanoptionalIndicates whether maintainers can modify the pull request
titlestringoptionalThe title of the pull request
github_pull_requests_list#List pull requests in a repository with optional filtering by state, head, and base branches.9 params

List pull requests in a repository with optional filtering by state, head, and base branches.

NameTypeRequiredDescription
ownerstringrequiredThe account owner of the repository
repostringrequiredThe name of the repository
basestringoptionalFilter by base branch name
directionstringoptionalSort order
headstringoptionalFilter by head branch (format: user:ref-name)
pagenumberoptionalPage number of results to fetch
per_pagenumberoptionalNumber of results per page (max 100)
sortstringoptionalProperty to sort pull requests by
statestringoptionalFilter by pull request state
github_repo_get#Get detailed information about a GitHub repository including metadata, settings, and statistics.2 params

Get detailed information about a GitHub repository including metadata, settings, and statistics.

NameTypeRequiredDescription
ownerstringrequiredThe account owner of the repository (case-insensitive)
repostringrequiredThe name of the repository without the .git extension (case-insensitive)
github_user_repos_list#List repositories for the authenticated user. Requires authentication.5 params

List repositories for the authenticated user. Requires authentication.

NameTypeRequiredDescription
directionstringoptionalSort order
pagenumberoptionalPage number of results to fetch
per_pagenumberoptionalNumber of results per page (max 100)
sortstringoptionalProperty to sort repositories by
typestringoptionalFilter repositories by type