Skip to main content
:::tip PRO This feature is available in the Professional Edition. ::: The Coding Expert is a powerful AI programming assistant that can connect to mainstream code management platforms (GitHub, GitLab, Gitee, Yunxiao) to automate code review, issue handling, code modification, and PR submission. With the Coding Expert, you can:
  • 📋 Automatically Review Issues: Intelligently analyze and categorize issues, providing solution suggestions
  • 🔧 Automatically Modify Code: Automatically modify code files based on issues or requirements
  • 🚀 Automatically Submit PRs: Create Pull Requests with auto-generated descriptions
  • 🤝 Code Review: Intelligently review PRs and provide improvement suggestions
  • 📝 Generate Documentation: Automatically generate or update project documentation

📦 Supported Platforms

PlatformIntegration MethodDescription
GitHubAPP_INSTALLATIONGitHub App installation mode - platform configures App, users install and authorize
GitLabOAUTH_WEB / PATSupports OAuth authorization or Personal Access Token (PAT)
GiteeOAUTH_WEB / PATSupports OAuth authorization or Personal Access Token (PAT)
Yunxiao CodeupPATOnly supports Personal Access Token (PAT) mode

🔧 Backend Configuration

Before using the Coding Expert, you need to configure the relevant environment variables in the backend.

Callback URL Rules

The backend unified callback route is: /v1/git/connections/callback/:providerId Local development example (backend running on port 3001):
PlatformCallback URL
GitHubhttp://localhost:3001/v1/git/connections/callback/github
GitLabhttp://localhost:3001/v1/git/connections/callback/gitlab
Giteehttp://localhost:3001/v1/git/connections/callback/gitee
:::info Production Environment In production, replace http://localhost:3001 with your public API domain (e.g., https://api.xxx.com). ::: :::note Yunxiao Codeup Yunxiao Codeup does not support third-party OAuth callbacks, use PAT mode for direct connection. :::

Environment Variables Configuration

Configure the following required items in the .env file:
# GitHub App Configuration
GITHUB_APP_SLUG=
GITHUB_APP_ID=
GITHUB_APP_PRIVATE_KEY=

# GitLab OAuth Configuration
GITLAB_CLIENT_ID=
GITLAB_CLIENT_SECRET=
GITLAB_REDIRECT_URI=http://localhost:3001/v1/git/connections/callback/gitlab
GITLAB_SCOPES=api read_user

# Gitee OAuth Configuration
GITEE_CLIENT_ID=
GITEE_CLIENT_SECRET=
GITEE_REDIRECT_URI=http://localhost:3001/v1/git/connections/callback/gitee
GITEE_SCOPES=user_info projects pull_requests

# Credentials Encryption Key (Required, 32 bytes)
GIT_CREDENTIALS_KEY=
:::warning Important Notes
  • GIT_CREDENTIALS_KEY is required and must be a 32-byte string
  • Ensure the API service actually reads this .env file (depending on the actual startup method, the file may be in the root directory or apps/api/.env) :::

🚀 Platform Configuration Steps

GitHub Configuration (App Mode)

GitHub uses App Installation mode, where the platform pre-configures the GitHub App and users only need to install and authorize it in the system.

1. Create GitHub App

  1. Log in to GitHub, go to SettingsDeveloper settingsGitHub Apps
  2. Click New GitHub App button
  3. Fill in the application information:
    FieldDescriptionExample
    GitHub App nameApplication nameXpertAI Coding Expert
    Homepage URLHomepage URLhttps://app.xpertai.cn
    DescriptionApplication descriptionAI coding agent for automated code tasks
    IdentificationURL slugxpertai-coding-agent
  4. Configure Webhook (optional):
    • Active: Uncheck (if Webhook is not needed)
    • Webhook URL: Leave empty
  5. Configure App permissions:
    PermissionAccess LevelDescription
    Repository permissions
    - AdministrationRead & writeRepository management
    - ContentsRead & writeCode content read/write
    - IssuesRead & writeIssue management
    - Pull requestsRead & writePR management
    - MetadataRead-onlyMetadata read
    Organization permissions
    - MembersRead-onlyMember read
  6. Configure Where can this GitHub App be installed?
    • Select: Only on this account or Any account
  7. Click Create GitHub App to create the app

2. Get and Save Credentials

After successful creation, get the following information on the app details page:
FieldEnvironment VariableDescription
App IDGITHUB_APP_IDApplication ID
App SlugGITHUB_APP_SLUGApplication identifier (name shown in URL)
Private KeyGITHUB_APP_PRIVATE_KEYPrivate key file content
:::tip Getting Private Key At the bottom of the app details page, click Generate a private key to download the .pem file, open the file and copy all content to GITHUB_APP_PRIVATE_KEY. :::

3. User Authorization Flow

When users click connect in the system:
  1. System redirects to GitHub App installation page
  2. User selects repositories to authorize (all repositories or specific repositories)
  3. Click Save to complete authorization
  4. After successful authorization, the system can access the user’s authorized repositories

GitLab Configuration

GitLab supports two integration methods: OAuth Mode (recommended) and PAT Mode.
1. Create GitLab Application
  1. Log in to GitLab, go to User SettingsApplications
  2. Fill in the application information:
    FieldDescriptionExample
    NameApplication nameXpertAI Coding Expert
    Redirect URICallback URLhttp://localhost:3001/v1/git/connections/callback/gitlab
  3. Check the following permissions (Scopes):
    PermissionDescription
    apiFull API access
    read_userRead user information
:::warning Permission Matching Principle GITLAB_SCOPES must be exactly the same as the permissions configured in the GitLab application, otherwise the authorization will succeed but the API will return 401/403 errors. :::
  1. Click Save application to create the app
2. Get and Save Credentials
After successful creation, copy the following information to .env:
FieldEnvironment VariableDescription
Application IDGITLAB_CLIENT_IDApplication ID
SecretGITLAB_CLIENT_SECRETApplication secret
3. User Authorization Flow
When users click connect in the system:
  1. System redirects to GitLab authorization page
  2. User clicks Authorize to complete authorization
  3. After successful authorization, the system can access the user’s GitLab repositories

PAT Mode

PAT mode does not require configuring GITLAB_CLIENT_ID and GITLAB_CLIENT_SECRET.
User Configuration Steps
  1. User generates a Personal Access Token in GitLab
  2. Select GitLab on the system connection page
  3. Select PAT mode
  4. Enter the following information:
    • Token: Personal access token
    • Base URL (optional): GitLab instance URL (if using self-hosted GitLab)

Gitee Configuration

Gitee supports two integration methods: OAuth Mode and PAT Mode.

OAuth Mode

1. Create Gitee Third-Party Application
  1. Log in to Gitee, go to SettingsThird-Party ApplicationsCreate Application
  2. Fill in the application information:
    FieldDescriptionExample
    Application NameApplication nameXpertAI Coding Expert
    Application IntroductionApplication descriptionAI coding agent for automated code tasks
    Application HomepageHomepage URLhttps://app.xpertai.cn
    Application Callback URLCallback URLhttp://localhost:3001/v1/git/connections/callback/gitee
  3. Check the following permissions (Scopes):
    PermissionDescription
    user_infoUser information
    projectsProject access
    pull_requestsPR management
:::warning Permission Matching Principle GITEE_SCOPES must be exactly the same as the permissions configured in the Gitee application, otherwise the authorization will succeed but the API will return 401/403 errors. :::
  1. Click Create Application
2. Get and Save Credentials
After successful creation, copy the following information to .env:
FieldEnvironment VariableDescription
Client IDGITEE_CLIENT_IDApplication ID
Client SecretGITEE_CLIENT_SECRETApplication secret
3. User Authorization Flow
When users click connect in the system:
  1. System redirects to Gitee authorization page
  2. User clicks Agree to Authorize to complete authorization
  3. After successful authorization, the system can access the user’s Gitee repositories

PAT Mode

PAT mode does not require configuring GITEE_CLIENT_ID and GITEE_CLIENT_SECRET.
User Configuration Steps
  1. User generates a Personal Access Token in Gitee
  2. Select Gitee on the system connection page
  3. Select PAT mode
  4. Enter the personal access token

Yunxiao Codeup Configuration (PAT Mode)

Yunxiao Codeup only supports PAT Mode and does not support OAuth callbacks.

1. Create Yunxiao PAT

  1. Log in to Yunxiao
  2. Go to Personal SettingsAccess TokensCreate Access Token
  3. Configure token permissions:
    PermissionDescription
    Code RepositoryRead and write code repositories
    BranchRead and create branches
    Merge RequestRead and create merge requests
    IssueRead and manage issues
  4. Click Create and copy the generated token

2. User Configuration Steps

On the system connection page:
  1. Select Yunxiao Codeup
  2. Fill in the following information:
    • Organization ID: Yunxiao organization ID
    • Token: Personal access token
:::tip Getting Organization ID You can view the organization ID in the Yunxiao organization settings page under “Joined Organizations”. It is a string like “6932875abb64aae55975251f”. :::

🚀 Using the Coding Expert

After configuration, you can use the Coding Expert tools in agents or workflows.

Available Tools

Tool NameDescription
list_repositoriesList repositories the user has access to
list_issuesList issues in a repository
get_issueGet detailed issue information
create_issueCreate a new issue
update_issueUpdate issue status or content
list_pull_requestsList pull requests in a repository
get_pull_requestGet detailed PR information
create_pull_requestCreate a new pull request
review_pull_requestReview a pull request
get_file_contentGet file content
update_fileModify or create a file
create_commitCommit code changes
  • Manually review all code changes
  • Check if the agent’s modifications comply with project standards
  • Verify that the functionality works correctly

4. Error Handling

The Coding Expert may encounter errors during execution, it’s recommended to:
  • Configure error notification mechanisms to detect issues in time
  • Log operations for troubleshooting
  • Set up retry mechanisms for handling temporary errors

🔒 Security Considerations

1. Credential Security

  • Do not commit sensitive information like Client Secret, AppSecret, Private Key to code repositories
  • Regularly rotate application secrets and tokens
  • Use environment variables to store sensitive information
  • Ensure GIT_CREDENTIALS_KEY is stored securely

2. Access Control

  • Limit the scope of repositories the Coding Expert can access
  • Configure different application instances for different projects
  • Regularly review the list of authorized applications

3. Audit Logs

  • Enable platform audit logging
  • Regularly check the Coding Expert’s operation records
  • Handle abnormal operations promptly

📚 FAQ

Q1: What to do if authorization fails?

A: Please check the following:
  • Whether the callback URL is correctly configured (including protocol http/https)
  • Whether application permissions are correctly checked
  • Whether environment variables in .env file are correctly configured
  • Whether the API service actually reads the .env file

Q2: Authorization succeeds but API returns 401/403 errors?

A: This is usually caused by permission configuration mismatch:
  • Check if GITLAB_SCOPES or GITEE_SCOPES are exactly the same as the permissions configured in the platform application
  • Confirm that the application permission scope is sufficient
  • Recreate the application and ensure permission configuration is correct

Q3: Coding Expert cannot access private repositories?

A: Please confirm:
  • User has correctly authorized or provided a valid PAT
  • PAT has permission to access the repository
  • Whether the repository’s access settings allow third-party application access

Q4: How to limit the Coding Expert’s operation scope?

A: You can:
  • Select specific repositories when installing GitHub App
  • Clearly define the operation scope in the agent’s prompt
  • Use branch protection rules to restrict operable branches

Q5: What to do if the code modified by the Coding Expert is incorrect?

A: It’s recommended to:
  • Enable branch protection and require manual review
  • Configure CI/CD checks to automatically detect code issues
  • Close problematic PRs promptly and provide feedback to the agent

🎓 Summary

The Coding Expert is a powerful AI programming assistant that can automate various code tasks by connecting to mainstream code management platforms. Configuration Key Points:
  1. ✅ Configure backend environment variables (.env)
  2. ✅ Create applications on each platform (GitHub App / GitLab Application / Gitee Application)
  3. ✅ Configure correct callback URLs and permission scopes
  4. ✅ User completes authorization or provides PAT
  5. ✅ Follow security best practices
Integration Method Comparison:
PlatformRecommended MethodCallback RequiredUser Action
GitHubApp Installation✅ YesInstall and authorize
GitLabOAuth✅ YesClick to authorize
GitLabPAT❌ NoEnter token
GiteeOAuth✅ YesClick to authorize
GiteePAT❌ NoEnter token
YunxiaoPAT❌ NoEnter token
After configuration, you can let the Coding Expert help you automate code tasks and improve development efficiency!