กลับไปหน้า Tools

GetNotes Tools

github/copilot-sdk

Tool นี้คืออะไร

GitHub Copilot CLI SDKs ช่วยให้นักพัฒนาสามารถฝังเวิร์กโฟลว์แบบ Agent ของ Copilot ลงในแอปพลิเคชันของตนได้ในหลายภาษา เช่น Python, TypeScript, Go, .NET, Java และ Rust โดยไม่ต้องสร้างระบบจัดการเอง ทำให้สามารถใช้ความสามารถของ Copilot ในการวางแผน การเรียกใช้เครื่องมือ และการแก้ไขไฟล์ได้ง่ายขึ้น

ข้อมูลโปรเจกต์

ดาว

9.8K

Forks

1.3K

License

MIT

อัปเดต GitHub ล่าสุด

18 ก.ค. 2569

เพิ่มใน GetNotes

18 ก.ค. 2569

Repository

github/copilot-sdk

รูปแบบ

Library / SDK

เหมาะกับงาน

Automation

เหมาะกับอาชีพ

Ecosystem

Java

แปลและเรียบเรียงโดย AI

เนื้อหาฉบับภาษาไทย

ใช้อ่านเพื่อทำความเข้าใจเบื้องต้น โปรดตรวจสอบรายละเอียดสำคัญกับเอกสารต้นฉบับด้านล่าง

GitHub Copilot CLI SDKs

GitHub Copilot SDK

NPM Downloads PyPI - Downloads NuGet Downloads Go Reference crates.io Maven Central

เอเจนต์สำหรับทุกแอป

ฝังเวิร์กโฟลว์แบบเอเจนต์ของ Copilot ลงในแอปพลิเคชันของคุณด้วย GitHub Copilot SDK สำหรับ Python, TypeScript, Go, .NET, Java และ Rust

GitHub Copilot SDK เปิดเผยเอนจินเดียวกับที่อยู่เบื้องหลัง Copilot CLI ซึ่งเป็นรันไทม์เอเจนต์ที่ผ่านการทดสอบในการใช้งานจริงที่คุณสามารถเรียกใช้ได้ด้วยโปรแกรม ไม่จำเป็นต้องสร้างระบบจัดการของคุณเอง คุณเพียงกำหนดพฤติกรรมของเอเจนต์ ส่วน Copilot จะจัดการการวางแผน การเรียกใช้เครื่องมือ การแก้ไขไฟล์ และอื่นๆ

SDK ที่มีให้ใช้งาน

SDKตำแหน่งCookbookการติดตั้งเอกสาร API
Node.js / TypeScriptnodejs/Cookbooknpm install @github/copilot-sdk
Pythonpython/Cookbookpip install github-copilot-sdk
Gogo/Cookbookgo get github.com/github/copilot-sdk/goAPI docs
.NETdotnet/Cookbookdotnet add package GitHub.Copilot.SDK
Rustrust/cargo add github-copilot-sdkAPI docs
Javajava/Cookbookพิกัด Mavencom.github:copilot-sdk-javaดูคำแนะนำสำหรับ Maven และ GradleAPI docs

ดูไฟล์ README ของแต่ละ SDK สำหรับการติดตั้ง ตัวอย่างการใช้งาน และการอ้างอิง API

เริ่มต้นใช้งาน

สำหรับคำแนะนำแบบละเอียดทั้งหมด โปรดดูที่ คู่มือเริ่มต้นใช้งาน

ขั้นตอนด่วน:

  1. 1(ไม่บังคับ) ติดตั้ง Copilot CLI

สำหรับ SDK ของ Node.js, Python และ .NET นั้น Copilot CLI จะถูกรวมมาให้โดยอัตโนมัติและไม่จำเป็นต้องติดตั้งแยกต่างหาก สำหรับ Go, Java และ Rust ให้ ติดตั้ง CLI ด้วยตนเอง หรือตรวจสอบให้แน่ใจว่า copilot มีอยู่ใน PATH ของคุณ Go และ Rust ยังมีคุณสมบัติการรวม CLI ระดับแอปพลิเคชันอีกด้วย

  1. 1**ติดตั้ง SDK ที่คุณต้องการ** โดยใช้คำสั่งด้านบน
  2. 2**ดูไฟล์ README ของ SDK** สำหรับตัวอย่างการใช้งานและเอกสาร API

สถาปัตยกรรม

SDK ทั้งหมดสื่อสารกับเซิร์ฟเวอร์ Copilot CLI ผ่าน JSON-RPC:

code
Your Application
       ↓
  SDK Client
       ↓ JSON-RPC
  Copilot CLI (server mode)

SDK จะจัดการวงจรชีวิตของกระบวนการ CLI โดยอัตโนมัติ คุณยังสามารถเชื่อมต่อกับเซิร์ฟเวอร์ CLI ภายนอกได้—ดู คู่มือเริ่มต้นใช้งาน สำหรับรายละเอียดเกี่ยวกับการรัน CLI ในโหมดเซิร์ฟเวอร์

คำถามที่พบบ่อย

ฉันจำเป็นต้องสมัครสมาชิก GitHub Copilot เพื่อใช้ SDK หรือไม่?

ใช่ การสมัครสมาชิก GitHub Copilot เป็นสิ่งจำเป็นในการใช้ GitHub Copilot SDK เว้นแต่คุณจะใช้ BYOK (Bring Your Own Key) ด้วย BYOK คุณสามารถใช้ SDK ได้โดยไม่ต้องมีการยืนยันตัวตนของ GitHub โดยการกำหนดค่าคีย์ API ของคุณเองจากผู้ให้บริการ LLM ที่รองรับ สำหรับการใช้งานมาตรฐาน (ไม่ใช่ BYOK) โปรดดูที่ หน้าการกำหนดราคาของ GitHub Copilot ซึ่งรวมถึงระดับฟรีที่มีการใช้งานจำกัด

การเรียกเก็บเงินสำหรับการใช้งาน SDK ทำงานอย่างไร?

การเรียกเก็บเงินสำหรับ GitHub Copilot SDK อิงตามรูปแบบเดียวกับ Copilot CLI โดยแต่ละพรอมต์จะถูกนับรวมในโควตาการใช้งานของคุณ สำหรับข้อมูลเพิ่มเติมเกี่ยวกับการเรียกเก็บเงินการใช้งาน Copilot โปรดดูที่ การใช้งานใน GitHub Copilot

รองรับ BYOK (Bring Your Own Key) หรือไม่?

ใช่ GitHub Copilot SDK รองรับ BYOK (Bring Your Own Key) คุณสามารถกำหนดค่า SDK ให้ใช้คีย์ API ของคุณเองจากผู้ให้บริการ LLM ที่รองรับ (เช่น OpenAI, Azure AI Foundry, Anthropic) เพื่อเข้าถึงโมเดลผ่านผู้ให้บริการเหล่านั้น ดู เอกสาร BYOK สำหรับคำแนะนำในการตั้งค่าและตัวอย่าง

หมายเหตุ: BYOK ใช้การยืนยันตัวตนด้วยคีย์เท่านั้น ไม่รองรับ Microsoft Entra ID (Azure AD), managed identities และผู้ให้บริการยืนยันตัวตนภายนอก

รองรับวิธีการยืนยันตัวตนแบบใดบ้าง?

SDK รองรับวิธีการยืนยันตัวตนหลายวิธี:

  • ผู้ใช้ที่ลงชื่อเข้าใช้ GitHub - ใช้ข้อมูลรับรอง OAuth ที่จัดเก็บไว้จากการเข้าสู่ระบบ copilot CLI
  • แอป GitHub OAuth - ส่งโทเค็นผู้ใช้จากแอป GitHub OAuth ของคุณ
  • ตัวแปรสภาพแวดล้อม - COPILOT_GITHUB_TOKEN, GH_TOKEN, GITHUB_TOKEN
  • BYOK - ใช้คีย์ API ของคุณเอง (ไม่จำเป็นต้องมีการยืนยันตัวตนของ GitHub)

ดู เอกสารการยืนยันตัวตน สำหรับรายละเอียดของแต่ละวิธี

จำเป็นต้องติดตั้ง Copilot CLI แยกต่างหากหรือไม่?

ไม่จำเป็น — สำหรับ SDK ของ Node.js, Python และ .NET นั้น Copilot CLI จะถูกรวมมาให้โดยอัตโนมัติในฐานะ dependency คุณไม่จำเป็นต้องติดตั้งแยกต่างหาก

สำหรับ SDK ของ Go, Java และ Rust นั้น CLI จะไม่ถูกรวมมาให้โดยค่าเริ่มต้น ให้ติดตั้ง CLI ด้วยตนเอง หรือตรวจสอบให้แน่ใจว่า copilot มีอยู่ใน PATH ของคุณ Go และ Rust ยังมีคุณสมบัติการรวม CLI ระดับแอปพลิเคชันอีกด้วย

ขั้นสูง: คุณสามารถแทนที่ไบนารี CLI หรือเชื่อมต่อกับเซิร์ฟเวอร์ภายนอกได้ โปรดดู README ของ SDK แต่ละภาษาสำหรับตัวเลือกเฉพาะภาษา

เครื่องมือใดบ้างที่เปิดใช้งานโดยค่าเริ่มต้น?

โดยค่าเริ่มต้น SDK จะเปิดเผยเครื่องมือบุคคลที่หนึ่งของ Copilot CLI คล้ายกับการรัน CLI ด้วย --allow-all การดำเนินการเครื่องมือยังคงถูกควบคุมโดยตัวจัดการสิทธิ์ของ SDK แต่ละตัว ดังนั้นแอปพลิเคชันสามารถอนุมัติ ปฏิเสธ หรือปรับแต่งการเรียกใช้เครื่องมือได้ คุณสามารถปรับแต่งการใช้งานเครื่องมือได้โดยการกำหนดค่าตัวเลือกไคลเอนต์ SDK เพื่อเปิดใช้งานและปิดใช้งานเครื่องมือเฉพาะ โปรดดูเอกสารประกอบ SDK แต่ละตัวสำหรับรายละเอียดเกี่ยวกับการกำหนดค่าเครื่องมือ และเอกสารประกอบ Copilot CLI สำหรับรายการเครื่องมือที่มีอยู่

สามารถใช้ agents, skills หรือ tools แบบกำหนดเองได้หรือไม่?

ได้ GitHub Copilot SDK อนุญาตให้คุณกำหนด agents, skills และ tools แบบกำหนดเองได้ คุณสามารถขยายฟังก์ชันการทำงานของ agents ได้โดยการใช้ตรรกะของคุณเองและรวมเครื่องมือเพิ่มเติมตามที่ต้องการ โปรดดูเอกสารประกอบ SDK ของภาษาที่คุณต้องการสำหรับรายละเอียดเพิ่มเติม

มีคำแนะนำหรือแนวทาง SDK สำหรับ Copilot เพื่อเร่งการพัฒนาหรือไม่?

มี โปรดดูคำแนะนำแบบกำหนดเองและแนวทางเฉพาะ SDK:

รองรับโมเดลใดบ้าง?

โมเดลทั้งหมดที่มีให้ใช้งานผ่าน Copilot CLI ได้รับการรองรับใน SDK นอกจากนี้ SDK ยังมีเมธอดที่จะส่งคืนโมเดลที่มีอยู่เพื่อให้สามารถเข้าถึงได้ในขณะรันไทม์

SDK พร้อมใช้งานสำหรับการผลิตแล้วหรือยัง?

GitHub Copilot SDK พร้อมใช้งานทั่วไปและเป็นไปตามการกำหนดเวอร์ชันเชิงความหมาย (semantic versioning) โปรดดู CHANGELOG.md สำหรับบันทึกการเผยแพร่

จะรายงานปัญหาหรือขอคุณสมบัติได้อย่างไร?

โปรดใช้หน้า GitHub Issues เพื่อรายงานข้อบกพร่องหรือขอคุณสมบัติใหม่ เรายินดีรับฟังความคิดเห็นของคุณเพื่อช่วยปรับปรุง SDK

ลิงก์ด่วน

  • Documentation – ดัชนีเอกสารประกอบฉบับเต็ม
  • Getting Started – บทช่วยสอนสำหรับการเริ่มต้นใช้งาน
  • Setup Guides – สถาปัตยกรรม, การปรับใช้ และการปรับขนาด
  • Authentication – GitHub OAuth, BYOK และอื่นๆ
  • Features – Hooks, custom agents, MCP, skills และอื่นๆ
  • Troubleshooting – ปัญหาและวิธีแก้ไขทั่วไป
  • Cookbook – สูตรอาหารเชิงปฏิบัติสำหรับงานทั่วไปในทุกภาษา
  • More Resources – ตัวอย่างเพิ่มเติม บทช่วยสอน และแหล่งข้อมูลจากชุมชน

SDK ที่ไม่เป็นทางการ ซึ่งดูแลโดยชุมชน

⚠️ ข้อจำกัดความรับผิดชอบ: SDK เหล่านี้เป็น SDK ที่ไม่เป็นทางการ ขับเคลื่อนโดยชุมชน และไม่ได้รับการสนับสนุนจาก GitHub โปรดใช้งานด้วยความเสี่ยงของคุณเอง

การมีส่วนร่วม

ดู CONTRIBUTING.md สำหรับแนวทางการมีส่วนร่วม

ใบอนุญาต

MIT

เอกสารโปรเจกต์

อ่านเอกสารต้นฉบับ

README วิธีติดตั้ง วิธีใช้งาน และข้อกำหนดจาก repository ต้นฉบับ

ดูไฟล์บน GitHub

GitHub Copilot CLI SDKs

GitHub Copilot SDK

NPM Downloads PyPI - Downloads NuGet Downloads Go Reference crates.io Maven Central

Agents for every app.

Embed Copilot's agentic workflows in your application with the GitHub Copilot SDK for Python, TypeScript, Go, .NET, Java, and Rust.

The GitHub Copilot SDK exposes the same engine behind Copilot CLI: a production-tested agent runtime you can invoke programmatically. No need to build your own orchestration—you define agent behavior, Copilot handles planning, tool invocation, file edits, and more.

Available SDKs

SDKLocationCookbookInstallationAPI docs
Node.js / TypeScriptnodejs/Cookbooknpm install @github/copilot-sdk
Pythonpython/Cookbookpip install github-copilot-sdk
Gogo/Cookbookgo get github.com/github/copilot-sdk/goAPI docs
.NETdotnet/Cookbookdotnet add package GitHub.Copilot.SDK
Rustrust/cargo add github-copilot-sdkAPI docs
Javajava/CookbookMaven coordinatescom.github:copilot-sdk-javaSee instructions for Maven and GradleAPI docs

See the individual SDK READMEs for installation, usage examples, and API reference.

Getting Started

For a complete walkthrough, see the Getting Started Guide.

Quick steps:

  1. 1(Optional) Install the Copilot CLI

For Node.js, Python, and .NET SDKs, the Copilot CLI is bundled automatically and no separate installation is required. For Go, Java, and Rust, install the CLI manually or ensure copilot is available in your PATH. Go and Rust also expose application-level CLI bundling features.

  1. 1**Install your preferred SDK** using the commands above.
  2. 2**See the SDK README** for usage examples and API documentation.

Architecture

All SDKs communicate with the Copilot CLI server via JSON-RPC:

code
Your Application
       ↓
  SDK Client
       ↓ JSON-RPC
  Copilot CLI (server mode)

The SDK manages the CLI process lifecycle automatically. You can also connect to an external CLI server—see the Getting Started Guide for details on running the CLI in server mode.

FAQ

Do I need a GitHub Copilot subscription to use the SDK?

Yes, a GitHub Copilot subscription is required to use the GitHub Copilot SDK, unless you are using BYOK (Bring Your Own Key). With BYOK, you can use the SDK without GitHub authentication by configuring your own API keys from supported LLM providers. For standard usage (non-BYOK), refer to the GitHub Copilot pricing page, which includes a free tier with limited usage.

How does billing work for SDK usage?

Billing for the GitHub Copilot SDK is based on the same model as the Copilot CLI, with each prompt being counted towards your usage allowance. For more information on Copilot usage billing, see Usage in GitHub Copilot.

Does it support BYOK (Bring Your Own Key)?

Yes, the GitHub Copilot SDK supports BYOK (Bring Your Own Key). You can configure the SDK to use your own API keys from supported LLM providers (e.g. OpenAI, Azure AI Foundry, Anthropic) to access models through those providers. See the BYOK documentation for setup instructions and examples.

Note: BYOK uses key-based authentication only. Microsoft Entra ID (Azure AD), managed identities, and third-party identity providers are not supported.

What authentication methods are supported?

The SDK supports multiple authentication methods:

  • GitHub signed-in user - Uses stored OAuth credentials from copilot CLI login
  • OAuth GitHub App - Pass user tokens from your GitHub OAuth app
  • Environment variables - COPILOT_GITHUB_TOKEN, GH_TOKEN, GITHUB_TOKEN
  • BYOK - Use your own API keys (no GitHub auth required)

See the Authentication documentation for details on each method.

Do I need to install the Copilot CLI separately?

No — for Node.js, Python, and .NET SDKs, the Copilot CLI is bundled automatically as a dependency. You do not need to install it separately.

For Go, Java, and Rust SDKs, the CLI is not bundled by default. Install the CLI manually or ensure copilot is available in your PATH. Go and Rust also expose application-level CLI bundling features.

Advanced: You can override the CLI binary or connect to an external server. See the individual SDK README for language-specific options.

What tools are enabled by default?

By default, the SDK exposes the Copilot CLI's first-party tools, similar to running the CLI with --allow-all. Tool execution is still governed by each SDK's permission handler, so applications can approve, deny, or customize tool calls. You can customize tool availability by configuring the SDK client options to enable and disable specific tools. Refer to the individual SDK documentation for details on tool configuration and to the Copilot CLI documentation for the list of available tools.

Can I use custom agents, skills or tools?

Yes, the GitHub Copilot SDK allows you to define custom agents, skills, and tools. You can extend the functionality of the agents by implementing your own logic and integrating additional tools as needed. Refer to the SDK documentation of your preferred language for more details.

Are there instructions or SDK guidance for Copilot to speed up development?

Yes, check out the custom instructions and SDK-specific guidance:

What models are supported?

All models available via Copilot CLI are supported in the SDK. The SDK also exposes a method which will return the models available so they can be accessed at runtime.

Is the SDK production-ready?

The GitHub Copilot SDK is generally available and follows semantic versioning. See CHANGELOG.md for release notes.

How do I report issues or request features?

Please use the GitHub Issues page to report bugs or request new features. We welcome your feedback to help improve the SDK.

Quick Links

Unofficial, Community-maintained SDKs

⚠️ Disclaimer: These are unofficial, community-driven SDKs and they are not supported by GitHub. Use at your own risk.

Contributing

See CONTRIBUTING.md for contribution guidelines.

License

MIT