Skip to content

Work with source control and pull requests

Updated

Koder works with the services that host your code, so you can open a pull request from your changes and start a session from someone else's. This article explains how to connect your code host, how to work in a worktree per chat, how to open a pull request and how to pick up a pull request with its review comments.

Connect your code host

Open Settings → Source control, then sign in to each host one of three ways:

  • A token saved in Koder: under Accounts, select Add token, paste an Access token and select Save token. Koder checks it, then keeps it in your system's keychain.
  • An environment variable: Koder reads tokens such as GITHUB_TOKEN, GITLAB_TOKEN, GITEA_TOKEN, BITBUCKET_TOKEN or AZURE_DEVOPS_EXT_PAT.
  • The host's own CLI: if you're signed in with gh auth login, glab auth login, tea login add or az login, Koder uses that sign-in.
HostWhere to create a token
GitHubYour GitHub settings, under Developer settings → Personal access tokens
GitLabYour GitLab user settings, under Access tokens
Forgejo, GiteaYour user settings, under Applications
BitbucketAn Atlassian API token, with your Username or email
Azure DevOpsA personal access token

After you change a token, select Check again.

Connect a server you host

For GitHub Enterprise, GitLab, Forgejo or Gitea on your own servers, go to Your own servers, select Add server, and enter its Server name and, if it differs, its Web address.

Work in a worktree per chat

Turn on New worktree when you start a chat, and Koder works on a new branch in its own folder, named from your request. Chats in separate worktrees don't change each other's files.

You choose how branches are named: a prefix and words from your request, the kind of change chosen by the model, or your own instructions. To clean up, open Finished worktrees and select Remove finished.

Open a pull request

  1. Review and commit your changes in the Review panel.
  2. Select Create pull request. On GitLab, it's a merge request.
  3. Check the Title and Description, which Koder drafts from your changes, and the branch it goes into.
  4. Turn on Draft if it isn't ready for review.
  5. Create it. Koder pushes your commits first.

Koder then watches the pull request and tells the chat when checks pass or fail, when it's merged or closed, and when new comments arrive. In the terminal, use /pr.

Start from a pull request

  1. Choose Start from a pull request.
  2. Enter the Pull request link or number.
  3. Choose In a new worktree or In this checkout, then select Start session.

Koder checks out the branch and begins with the pull request's description, comments and diff. To address feedback, select Add review comments, and the unresolved comments go into your message.

Example requests

  • "Address the review comments on this pull request."
  • "Fix the failing checks and push."
  • "Summarize what this pull request changes and what could break."

Limitations

  • Koder reads checks only on hosts that report them to it.
  • On a public repository, a Scan fix is offered as a patch to copy, not as a pull request.
  • Starting a session from an issue isn't available yet.

Troubleshooting

Koder can't open a pull request

Run koder pr in the project. It says what's missing: a remote, the host's CLI, a supported host or a sign-in.

My token isn't accepted

Check that it hasn't expired and that it can read and write the repository, then select Check again in Settings → Source control.

Frequently asked questions

Where are my tokens stored?

In your system's keychain, when you save them in Koder. Tokens from environment variables or a host's CLI stay where they are.

Can I use Koder with a self-hosted GitLab or Gitea?

Yes. Add it under Your own servers in Settings → Source control.

Get help

  • Review and commit: see Get started with Koder.
  • Report a problem: email care@aixplain.com with your code host and what happened.

Still need help?

Report a bug on GitHub or write to us, and include your version and operating system.