Skip to main content

Claude Code กับ GitHub Enterprise Server

เชื่อมต่อ Claude Code กับ GitHub Enterprise Server ที่โฮสต์เองสำหรับเซสชันบนเว็บ code review และ plugin marketplace

หมายเหตุ: การรองรับ GitHub Enterprise Server มีให้สำหรับแผน Team และ Enterprise

การรองรับ GitHub Enterprise Server (GHES) ช่วยให้องค์กรของคุณใช้ Claude Code กับ repository ที่โฮสต์บน GitHub instance ที่จัดการเองแทน github.com

ฟีเจอร์ที่รองรับกับ GitHub Enterprise Server

ฟีเจอร์การรองรับ GHESหมายเหตุ
Claude Code บนเว็บ✅ รองรับAdmin เชื่อมต่อ GHES instance ครั้งเดียว นักพัฒนาใช้ claude --remote หรือ claude.ai/code ตามปกติ
Code Review✅ รองรับเหมือน automated PR reviews บน github.com
Claude Security✅ รองรับมีให้ใน public beta สำหรับแผน Enterprise
Teleport sessions✅ รองรับย้ายเซสชันระหว่างเว็บและ terminal ด้วย --teleport
Plugin marketplaces✅ รองรับใช้ git URL เต็มแทน owner/repo shorthand
Contribution metrics✅ รองรับส่งผ่าน webhooks ไปยัง analytics dashboard
GitHub Actions✅ รองรับต้องตั้งค่า workflow ด้วยตนเอง /install-github-app ใช้ได้เฉพาะ github.com
GitHub MCP server❌ ไม่รองรับGitHub MCP server ไม่ทำงานกับ GHES instances

การตั้งค่าโดย Admin

Admin เชื่อมต่อ GHES instance กับ Claude Code ครั้งเดียว หลังจากนั้น นักพัฒนาในองค์กรสามารถใช้ GHES repository ได้โดยไม่ต้องกำหนดค่าเพิ่มเติม

ขั้นตอนการตั้งค่า

  1. เปิดการตั้งค่า admin ของ Claude Code ที่ https://claude.ai/admin-settings/claude-code

  2. เริ่มการตั้งค่าแบบ guided คลิก Connect กรอกชื่อที่แสดงและ GHES hostname เช่น github.example.com

  3. สร้าง GitHub App คลิก Continue to GitHub Enterprise browser จะ redirect ไปยัง GHES instance พร้อม app manifest ที่กรอกไว้แล้ว ตรวจสอบการกำหนดค่าและคลิก Create GitHub App

  4. ติดตั้ง app บน repository จากหน้า GitHub App บน GHES instance ติดตั้ง app บน repository หรือองค์กรที่ต้องการให้ Claude เข้าถึง

  5. เปิดใช้ฟีเจอร์ กลับไปที่ https://claude.ai/admin-settings/claude-code และเปิดใช้ Code Review, Claude Security และ contribution metrics

สิทธิ์ GitHub App

สิทธิ์การเข้าถึงใช้สำหรับ
Contentsอ่านและเขียนClone repository และ push branch
Pull requestsอ่านและเขียนสร้าง PR และโพสต์ review comment
Issuesอ่านและเขียนตอบสนองต่อ issue mention
Checksอ่านและเขียนโพสต์ Code Review check run
Actionsอ่านอ่านสถานะ CI สำหรับ auto-fix
Repository hooksอ่านและเขียนรับ webhook สำหรับ contribution metrics
Metadataอ่านจำเป็นโดย GitHub สำหรับ app ทั้งหมด

Workflow ของนักพัฒนา

เมื่อ admin เชื่อมต่อ GHES instance แล้ว นักพัฒนาไม่จำเป็นต้องกำหนดค่าเพิ่มเติม Claude Code ตรวจจับ GHES hostname อัตโนมัติจาก git remote ใน working directory

git clone [email protected]:platform/api-service.git
cd api-service
claude --remote "Add retry logic to the payment webhook handler"

Teleport เซสชันไปยัง terminal

ดึงเซสชันบนเว็บมายัง terminal ในเครื่องด้วย claude --teleport

Plugin Marketplaces บน GHES

โฮสต์ plugin marketplace บน GHES instance เพื่อแจกจ่าย internal tooling ทั่วทั้งองค์กร

เพิ่ม GHES marketplace

owner/repo shorthand จะ resolve ไปยัง github.com เสมอ สำหรับ GHES-hosted marketplace ใช้ git URL เต็ม:

/plugin marketplace add [email protected]:platform/claude-plugins.git

HTTPS URL ก็ใช้ได้เช่นกัน:

/plugin marketplace add https://github.example.com/platform/claude-plugins.git

อนุญาต GHES marketplace ใน managed settings

{
"strictKnownMarketplaces": [
{
"source": "hostPattern",
"hostPattern": "^github\\.example\\.com$"
}
]
}

ลงทะเบียน marketplace ล่วงหน้าสำหรับนักพัฒนา:

{
"extraKnownMarketplaces": {
"internal-tools": {
"source": {
"source": "git",
"url": "[email protected]:platform/claude-plugins.git"
}
}
}
}

ข้อจำกัด

  • คำสั่ง /install-github-app: ใช้ขั้นตอน admin setup บน claude.ai แทน
  • GitHub MCP server: ใช้ gh CLI ที่กำหนดค่าสำหรับ GHES host แทน รัน gh auth login --hostname github.example.com เพื่อยืนยันตัวตน

การแก้ปัญหา

เซสชันบนเว็บล้มเหลวในการ clone repository: ตรวจสอบว่า admin ตั้งค่า GHES instance เสร็จสมบูรณ์และ GitHub App ติดตั้งบน repository ที่ทำงานอยู่

การเพิ่ม marketplace ล้มเหลวด้วย policy error: ขอให้ admin เพิ่ม hostPattern entry สำหรับ GHES hostname ใน managed settings

GHES instance ไม่สามารถเข้าถึงได้: ตรวจสอบว่า firewall อนุญาต inbound connections จาก Anthropic API IP addresses

ทรัพยากรที่เกี่ยวข้อง