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 ได้โดยไม่ต้องกำหนดค่าเพิ่มเติม
ขั้นตอนการตั้งค่า
-
เปิดการตั้งค่า admin ของ Claude Code ที่ https://claude.ai/admin-settings/claude-code
-
เริ่มการตั้งค่าแบบ guided คลิก Connect กรอกชื่อที่แสดงและ GHES hostname เช่น
github.example.com -
สร้าง GitHub App คลิก Continue to GitHub Enterprise browser จะ redirect ไปยัง GHES instance พร้อม app manifest ที่กรอกไว้แล้ว ตรวจสอบการกำหนดค่าและคลิก Create GitHub App
-
ติดตั้ง app บน repository จากหน้า GitHub App บน GHES instance ติดตั้ง app บน repository หรือองค์กรที่ต้องการให้ Claude เข้าถึง
-
เปิดใช้ฟีเจอร์ กลับไปที่ 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: ใช้
ghCLI ที่กำหนดค่าสำหรับ 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
ทรัพยากรที่เกี่ยวข้อง
- Claude Code บนเว็บ — รัน Claude Code sessions บน cloud infrastructure
- Code Review — automated PR reviews
- Plugin marketplaces — สร้างและแจกจ่าย plugin catalog
- Analytics — ติดตามการใช้งานและ contribution metrics