provider repos POST /user/repos
@utdk/github /user/repos
Create a repository for the authenticated user
Creates a new repository for the authenticated user. OAuth app tokens and personal access tokens (classic) need the `public_repo` or `repo` scope to create a public repository, and `repo` scope to create a private repository.

Try it

Authentication
Configure credentials for GitHub v3 REST API
Gateway
The gateway proxies requests and injects credentials server-side. Configure credentials above, then enter your gateway URL.

Saved automatically to browser storage.

repos.createForAuthenticatedUser
POST/user/repos
Creates a new repository for the authenticated user. OAuth app tokens and personal access tokens (classic) need the `public_repo` or `repo` scope to create a public repository, and `repo` scope to create a private repository.

Input

required

The name of the repository.

A short description of the repository.

A URL with more information about the repository.

Whether the repository is private.

Whether issues are enabled.

Whether projects are enabled.

Whether the wiki is enabled.

Whether discussions are enabled.

The id of the team that will be granted access to this repository. This is only valid when creating a repository in an organization.

Whether the repository is initialized with a minimal README.

The desired language or platform to apply to the .gitignore.

The license keyword of the open source license for this repository.

Whether to allow squash merges for pull requests.

Whether to allow merge commits for pull requests.

Whether to allow rebase merges for pull requests.

Whether to allow Auto-merge to be used on pull requests.

Whether to delete head branches when pull requests are merged

Required when using `squash_merge_commit_message`. The default value for a squash merge commit title: - `PR_TITLE` - default to the pull request's title. - `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit).

The default value for a squash merge commit message: - `PR_BODY` - default to the pull request's body. - `COMMIT_MESSAGES` - default to the branch's commit messages. - `BLANK` - default to a blank commit message.

Required when using `merge_commit_message`. The default value for a merge commit title. - `PR_TITLE` - default to the pull request's title. - `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name).

The default value for a merge commit message. - `PR_TITLE` - default to the pull request's title. - `PR_BODY` - default to the pull request's body. - `BLANK` - default to a blank commit message.

Whether downloads are enabled.

Whether this repository acts as a template that can be used to generate new repositories.

Enter a gateway URL above to enable sending.

Code snippet
Updates live as you fill in the form above.

TypeScript

import github from '@utdk/github';

await github.repos.createForAuthenticatedUser({
  "private": false,
  "has_issues": true,
  "has_projects": true,
  "has_wiki": true,
  "has_discussions": false,
  "auto_init": false,
  "allow_squash_merge": true,
  "allow_merge_commit": true,
  "allow_rebase_merge": true,
  "allow_auto_merge": false,
  "delete_branch_on_merge": false,
  "has_downloads": true,
  "is_template": false
})