Maton

GitHub

Access the GitHub REST API with managed OAuth authentication. Manage repositories, issues, pull requests, commits, branches, users, and more.

Reference

Get Authenticated User

GET /github/user
maton github whoami

Get User by Username

GET /github/users/{username}

List Users

GET /github/users?since={user_id}&per_page=30

List User Repositories

GET /github/user/repos?per_page=30&sort=updated
maton github repo list --sort updated

Query parameters: type (all, owner, public, private, member), sort (created, updated, pushed, full_name), direction (asc, desc), per_page, page

List Organization Repositories

GET /github/orgs/{org}/repos?per_page=30
maton github repo list {org}

Get Repository

GET /github/repos/{owner}/{repo}
maton github repo view --repo {owner}/{repo}

Create Repository (User)

POST /github/user/repos
Content-Type: application/json

{
  "name": "my-new-repo",
  "description": "A new repository",
  "private": true,
  "auto_init": true
}
maton github repo create my-new-repo --description "A new repository" --visibility private

Create Repository (Organization)

POST /github/orgs/{org}/repos
Content-Type: application/json

{
  "name": "my-new-repo",
  "description": "A new repository",
  "private": true
}
maton github repo create {org}/my-new-repo --visibility private

Update Repository

PATCH /github/repos/{owner}/{repo}
Content-Type: application/json

{
  "description": "Updated description",
  "has_issues": true,
  "has_wiki": false
}
maton github repo edit --repo {owner}/{repo} --description "Updated description" --enable-issues --enable-wiki=false

List Contents

GET /github/repos/{owner}/{repo}/contents/{path}

Get File Contents

GET /github/repos/{owner}/{repo}/contents/{path}?ref={branch}

Create or Update File

PUT /github/repos/{owner}/{repo}/contents/{path}
Content-Type: application/json

{
  "message": "Create new file",
  "content": "SGVsbG8gV29ybGQh",
  "branch": "main"
}

Note: content must be Base64 encoded.

Delete File

DELETE /github/repos/{owner}/{repo}/contents/{path}
Content-Type: application/json

{
  "message": "Delete file",
  "sha": "{file_sha}",
  "branch": "main"
}

List Branches

GET /github/repos/{owner}/{repo}/branches?per_page=30

Get Branch

GET /github/repos/{owner}/{repo}/branches/{branch}

Rename Branch

POST /github/repos/{owner}/{repo}/branches/{branch}/rename
Content-Type: application/json

{
  "new_name": "new-branch-name"
}

Merge Branches

POST /github/repos/{owner}/{repo}/merges
Content-Type: application/json

{
  "base": "main",
  "head": "feature-branch",
  "commit_message": "Merge feature branch"
}

List Commits

GET /github/repos/{owner}/{repo}/commits?per_page=30

Query parameters: sha (branch name or commit SHA), path (file path), author, committer, since, until, per_page, page

Get Commit

GET /github/repos/{owner}/{repo}/commits/{ref}

Compare Two Commits

GET /github/repos/{owner}/{repo}/compare/{base}...{head}

List Repository Issues

GET /github/repos/{owner}/{repo}/issues?state=open&per_page=30
maton github issue list --repo {owner}/{repo} --state open

Query parameters: state (open, closed, all), labels, assignee, creator, mentioned, sort, direction, since, per_page, page

Get Issue

GET /github/repos/{owner}/{repo}/issues/{issue_number}
maton github issue view {issue_number} --repo {owner}/{repo}

Create Issue

POST /github/repos/{owner}/{repo}/issues
Content-Type: application/json

{
  "title": "Found a bug",
  "body": "Bug description here",
  "labels": ["bug"],
  "assignees": ["username"]
}
maton github issue create --repo {owner}/{repo} --title "Found a bug" --body "Bug description here" --label bug --assignee username

Update Issue

PATCH /github/repos/{owner}/{repo}/issues/{issue_number}
Content-Type: application/json

{
  "state": "closed",
  "state_reason": "completed"
}
maton github issue close {issue_number} --repo {owner}/{repo} --reason completed

Lock Issue

PUT /github/repos/{owner}/{repo}/issues/{issue_number}/lock
Content-Type: application/json

{
  "lock_reason": "resolved"
}
maton github issue lock {issue_number} --repo {owner}/{repo} --reason resolved

Unlock Issue

DELETE /github/repos/{owner}/{repo}/issues/{issue_number}/lock
maton github issue unlock {issue_number} --repo {owner}/{repo}

List Issue Comments

GET /github/repos/{owner}/{repo}/issues/{issue_number}/comments?per_page=30
maton github issue view {issue_number} --repo {owner}/{repo} --comments

Create Issue Comment

POST /github/repos/{owner}/{repo}/issues/{issue_number}/comments
Content-Type: application/json

{
  "body": "This is a comment"
}
maton github issue comment {issue_number} --repo {owner}/{repo} --body "This is a comment"

Update Issue Comment

PATCH /github/repos/{owner}/{repo}/issues/comments/{comment_id}
Content-Type: application/json

{
  "body": "Updated comment"
}

Delete Issue Comment

DELETE /github/repos/{owner}/{repo}/issues/comments/{comment_id}

List Labels

GET /github/repos/{owner}/{repo}/labels?per_page=30
maton github label list --repo {owner}/{repo}

Create Label

POST /github/repos/{owner}/{repo}/labels
Content-Type: application/json

{
  "name": "priority:high",
  "color": "ff0000",
  "description": "High priority issues"
}
maton github label create "priority:high" --repo {owner}/{repo} --color ff0000 --description "High priority issues"

List Milestones

GET /github/repos/{owner}/{repo}/milestones?state=open&per_page=30

Create Milestone

POST /github/repos/{owner}/{repo}/milestones
Content-Type: application/json

{
  "title": "v1.0",
  "state": "open",
  "description": "First release",
  "due_on": "2026-03-01T00:00:00Z"
}

List Pull Requests

GET /github/repos/{owner}/{repo}/pulls?state=open&per_page=30
maton github pr list --repo {owner}/{repo} --state open

Query parameters: state (open, closed, all), head, base, sort, direction, per_page, page

Get Pull Request

GET /github/repos/{owner}/{repo}/pulls/{pull_number}
maton github pr view {pull_number} --repo {owner}/{repo}

Create Pull Request

POST /github/repos/{owner}/{repo}/pulls
Content-Type: application/json

{
  "title": "New feature",
  "body": "Description of changes",
  "head": "feature-branch",
  "base": "main",
  "draft": false
}
maton github pr create --repo {owner}/{repo} --base main --head feature-branch --title "New feature" --body "Description of changes"

Update Pull Request

PATCH /github/repos/{owner}/{repo}/pulls/{pull_number}
Content-Type: application/json

{
  "title": "Updated title",
  "state": "closed"
}
maton github pr edit {pull_number} --repo {owner}/{repo} --title "Updated title"

List Pull Request Commits

GET /github/repos/{owner}/{repo}/pulls/{pull_number}/commits?per_page=30

List Pull Request Files

GET /github/repos/{owner}/{repo}/pulls/{pull_number}/files?per_page=30
maton github pr diff {pull_number} --repo {owner}/{repo}

Check If Merged

GET /github/repos/{owner}/{repo}/pulls/{pull_number}/merge

Merge Pull Request

PUT /github/repos/{owner}/{repo}/pulls/{pull_number}/merge
Content-Type: application/json

{
  "commit_title": "Merge pull request",
  "merge_method": "squash"
}
maton github pr merge {pull_number} --repo {owner}/{repo} --squash --delete-branch

Merge methods: merge, squash, rebase

List Reviews

GET /github/repos/{owner}/{repo}/pulls/{pull_number}/reviews?per_page=30

Create Review

POST /github/repos/{owner}/{repo}/pulls/{pull_number}/reviews
Content-Type: application/json

{
  "body": "Looks good!",
  "event": "APPROVE"
}
maton github pr review {pull_number} --repo {owner}/{repo} --approve --body "Looks good!"

Events: APPROVE, REQUEST_CHANGES, COMMENT

Note: GitHub does not allow approving your own pull requests; --approve returns 422 Can not approve your own pull request in that case. Use --comment or --request-changes instead.

Search Repositories

GET /github/search/repositories?q={query}&per_page=30
maton github repo search tetris --language python

Example queries:

  • tetris+language:python - Repositories with "tetris" in Python
  • react+stars:>10000 - Repositories with "react" and 10k+ stars

Search Issues

GET /github/search/issues?q={query}&per_page=30
maton github issue search "bug" --state open

Example queries:

  • bug+is:open+is:issue - Open issues containing "bug"
  • author:username+is:pr - Pull requests by author

Search Code

GET /github/search/code?q={query}&per_page=30

Example queries:

  • addClass+repo:facebook/react - Search for "addClass" in a specific repo
  • function+extension:js - JavaScript functions

Note: Code search may timeout on broad queries.

Search Users

GET /github/search/users?q={query}&per_page=30

List User Organizations

GET /github/user/orgs?per_page=30

Note: Requires read:org scope.

Get Organization

GET /github/orgs/{org}

List Organization Members

GET /github/orgs/{org}/members?per_page=30

Get Rate Limit

GET /github/rate_limit

Maton Events

pull_request.opened

Parameters

  • repository_full_name (string, required): The repository to match, in owner/repo form (e.g. acme/app).

pull_request.merged

Parameters

  • repository_full_name (string, required): The repository to match, in owner/repo form (e.g. acme/app).

issue.opened

Parameters

  • repository_full_name (string, required): The repository to match, in owner/repo form (e.g. acme/app).

branch.pushed

Parameters

  • repository_full_name (string, required): The repository to match, in owner/repo form (e.g. acme/app).
  • branch (string, required): Exact branch name to match for pushes (e.g. main, release/v2).

release.published

Parameters

  • repository_full_name (string, required): The repository to match, in owner/repo form (e.g. acme/app).

Resources

On this page