copilot-sdk / rust
AGENTS.md11k starsChanged 3 months agoMITView on GitHub
This directory contains the independent github-copilot-sdk crate. In standalone SDK workflows, paths and Cargo commands below are relative to this directory, and this crate's own lockfile and toolchain apply. When nested at src/sdk/rust, the runtime CLI consumes the same checked-out sources through the Bazel integration described under Development. The runtime's N-API architecture does not otherwise govern this crate. - Use the existing Error and ErrorKind in src/errors.rs. Extend that public error contract instead of adding parallel per-module error types or…
Trending
Steady talk.about the whole repository
Who's talking about github/copilot-sdk
- @kaylacinnamon.bsky.social“I built a web app with the GitHub Copilot SDK to make analyzing log files easier. It'll summarize them, …”Bluesky · Jan 22, 2026 · 66 likes
- @cassidoo.co“The @github.com Copilot SDK is live and it's really awesome! Learn more about it and try it out: …”Bluesky · Jan 22, 2026 · 63 likes
- @github.com“The GitHub Copilot SDK is here 🙌 You can take the same Copilot agentic core that powers GitHub Copilot CLI …”Bluesky · Jan 22, 2026 · 30 likes
- openclaw/openclaw“[Feature]: Copilot-sdk instead of proxy”GitHub · Jan 24, 2026 · 13 reactions
- KeygraphHQ/shannon“[FEATURE]: Add GitHub Copilot SDK as an AI provider option”GitHub · Mar 4, 2026 · 8 reactions
The biggest 5 of 25 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 25
Talked about on GitHub, Bluesky and Hacker News (25 times).
On GitHub · 13
- Jan 24, 2026[Feature]: Copilot-sdk instead of proxy — openclaw/openclaw13 reactions · 4 comments
- Mar 4, 2026[FEATURE]: Add GitHub Copilot SDK as an AI provider option — KeygraphHQ/shannon8 reactions · 1 comment
- Aug 20, 2026Allow Canvas extensions to open or focus an existing local session — github/app3 reactions
- Mar 10, 2026Make RequestIdSTJsonConverter public for AOT/trimming compatibility — microsoft/vs-streamjsonrpc3 reactions
- Jan 22, 2026.NET: Add AIAgent implementation for Github Copilot SDK — microsoft/agent-framework3 reactions · 3 comments
8 more on GitHub
- Aug 1, 2026BYOK Responses streaming drops apply_patch input before execution — github/copilot-cli2 reactions · 1 comment
- Jan 21, 2026Bump github-copilot-sdk from 0.1.13 to 0.1.14 in the uv-all group — Ven0m0/gemini-web-wrapper2 reactions · 1 comment
- Oct 1, 2026Add support for gpt-6.1-sol — github/gh-aw1 reaction
- Sep 24, 2026build(deps): bump github.com/github/copilot-sdk/go from 0.1.25 to 1.0.14 — orka-agents/orka1 reaction · 1 comment
- May 27, 2026Rust SDK? — openai/codex1 reaction · 3 comments
- May 5, 2026Provider Request: GitHub SDK / with github.com + company.ghe.com support — vectorize-io/hindsight1 reaction · 1 comment
- Feb 11, 2026CI Failure DoctorBuild failure after copilot-sdk upgrade to v0.1.21 — devantler-tech/ksail1 reaction · 2 comments
- Jan 27, 20260xsarawut.base.eth — base/docs1 reaction
On Bluesky · 11
- Jan 22, 2026I built a web app with the GitHub Copilot SDK to make analyzing log files easier. It'll summarize them, provide a root cause analysis, and… — @kaylacinnamon.bsky.social66 likes and reposts · 3 replies
- Jan 22, 2026The @github.com Copilot SDK is live and it's really awesome! Learn more about it and try it out: github.com/github/copil... — @cassidoo.co63 likes and reposts · 5 replies
- Jan 22, 2026The GitHub Copilot SDK is here 🙌 You can take the same Copilot agentic core that powers GitHub Copilot CLI and embed it in any… — @github.com30 likes and reposts · 4 replies
- Jan 28, 2026Now you can integrate #Microsoft #Copilot #CodingAgent via SDK into your app. Java, .NET/C#, Python, TypeScript, Go bindings MIT license… — @qdrddr.bsky.social3 likes and reposts
- Jan 27, 2026GitHub ha soltado hace unos días una bomba para devs 🚀 Con el GitHub Copilot SDK ahora puedes meter un agente de IA real (planifica,… — @mouredev.com3 likes and reposts
6 more on Bluesky
- Apr 4, 2026📦 github / copilot-sdk ⭐ 8,195 (+40) 🗒 TypeScript Multi-platform SDK for integrating GitHub Copilot Agent into apps and services — @github-trending-js.bsky.social2 likes and reposts
- Feb 9, 2026Have you used the GitHub Copilot SDK yet? If not… you probably should 👀 Repo 👉 github.com/github/copil... Tonight I had a bit of fun… — @thomast1906.bsky.social1 likes and repost
- Jan 26, 2026@github.com announced Copilot SDK, bringing the power of Copilot CLI to your apps. I built Flight School, an app that gives learning… — @chrisreddington.com1 likes and repost
- Jan 20, 2026GitHub Copilot CLI SDKs (github/copilot-sdk): Multi-platform SDK for integrating GitHub Copilot Agent into apps and services… — @aaronw.dev1 likes and repost
- Jan 29, 2026But ‘til then, check out some of the Copilot SDK projects we’re loving right now. If you haven’t given it a go, sharing some inspo in the… — @kdaigle.xmirror.bot0 likes and reposts · 1 reply
- Jan 23, 2026𝗚𝗶𝘁𝗛𝘂𝗯 𝗼𝗽𝗲𝗻𝘀 𝗶𝘁𝘀 𝗖𝗼𝗽𝗶𝗹𝗼𝘁 𝗖𝗟𝗜 𝗮𝘀 𝗮 𝗽𝗿𝗼𝗴𝗿𝗮𝗺𝗺𝗮𝗯𝗹𝗲 𝗦𝗗𝗞 💯 🚀 Now in technical preview, the GitHub… — @inakibes.bsky.social0 likes and reposts · 1 reply
On Hacker News · 1
- Jan 22, 2026GitHub Copilot CLI SDKs3 points
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository6 other files it gives its agents.
- AGENTS.mdAGENTS.md
- docs/AGENTS.mdAGENTS.md
- dotnet/test/E2E/AGENTS.mdAGENTS.md
- java/AGENTS.mdAGENTS.md
- agentic-workflowsSkill
- sdk-java-e2e-testSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
13 rules. About 0 are common, 3 are distinctive, and 10 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
10
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 14
Use the existing Error and ErrorKind in src/errors.rs.
- Distinctive: line 17
Treat exported types, builders, and trait signatures as a consumer-facing contract.
- Distinctive: line 20
Document public APIs with rustdoc.
- Very specific: line 26
Use the per-request traits in src/handler.rs, such as PermissionHandler with SessionConfig::with_permission_handler, and retain their …
- Very specific: line 30
Prefer its per-hook methods.
- Very specific: line 47
Do not edit src/generated/ by hand.
- Very specific: line 56
Keep handwritten consumer-facing types in src/types.rs when the wire types cannot express the public API, rather than patching generated …
- Very specific: line 73
Use this crate's rust-toolchain.toml, Cargo.toml, and rustfmt configuration, not the runtime workspace's.
- Very specific: line 93
Do not restore a repository-wide COPILOT_SKIP_CLI_DOWNLOAD.
- Very specific: line 100
Run it with COPILOT_SKIP_CLI_DOWNLOAD unset.
- Very specific: line 103
Keep unit tests in external test-only modules: foo.rs declares #[cfg(test)] mod tests;, and its tests live in foo/tests.rs.
- Very specific: line 107
Keep integration tests in tests/.
- Distinctive: line 111
Default features bundle the CLI.
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
<!-- Copyright (c) Microsoft Corporation. All rights reserved. -->Rust SDK
This directory contains the independent github-copilot-sdk crate. In
standalone SDK workflows, paths and Cargo commands below are relative to this
directory, and this crate's own lockfile and toolchain apply. When nested at
src/sdk/rust, the runtime CLI consumes the same checked-out sources through
the Bazel integration described under Development. The runtime's N-API
architecture does not otherwise govern this crate.
Public API and errors
- Use the existing
ErrorandErrorKindin src/errors.rs. Extend that public error contract instead of adding parallel per-module error types or returninganyhow::Errorfrom library APIs. - Treat exported types, builders, and trait signatures as a consumer-facing contract. Adding a required field to a public struct can break callers' struct literals; preserve compatibility with existing construction patterns.
- Document public APIs with rustdoc. Keep cross-language parity notes in README.md, rather than repeating comparisons to other SDKs on individual symbols.
Extension points and session lifetime
- Use the per-request traits in src/handler.rs, such as
PermissionHandlerwithSessionConfig::with_permission_handler, and retain their declaredSend + Sync + 'staticcontracts. - Implement
SessionHooksin src/hooks.rs for lifecycle hooks. Prefer its per-hook methods;with_hooksenables hooks on the session. - Implement
SystemMessageTransformin src/transforms.rs withsection_idsandtransform_section, and register it throughwith_system_message_transform. - Attach a
ToolHandlerto aToolwithwith_handler, then register tools withwith_tools. Thederivefeature exposesdefine_toolandschema_forfor typed tool parameters. Use the current examples in src/tool.rs, not hand-built JSON wire payloads. EventSubscriptionandLifecycleSubscriptionare streams; dropping a subscription unsubscribes.Session::cancellation_tokenreturns a child token, so cancelling it must not cancel the parent session. Preserve these ownership and cancellation semantics when changing event dispatch.ApproveAllHandleris suitable for tests that do not exercise permission or managed-settings behavior. It is not an override for managed approval.
Generated types
Do not edit src/generated/ by hand. The generator is
../scripts/codegen/rust.ts. From <SDK_ROOT>, regenerate with the SDK facade
so the runtime layout selects checked-out schemas and the standalone layout
selects its pinned release schemas:
npm run generate:rustKeep handwritten consumer-facing types in src/types.rs when the wire types
cannot express the public API, rather than patching generated output. Changes
to release-derived CLI pins and schema inputs belong to the release process,
not incidental SDK implementation work.
Development
In the runtime repository, prefer npm --prefix <SDK_ROOT> run test:rust; it
refreshes the selected schemas and Rust projection and requests a current host
CLI before running the tests. Direct Cargo commands bypass those prerequisites
and the facade's environment applies only to its child process; it does not
persist for later shell commands. The CLI consumes this crate through the
same-checkout //src/sdk/rust:github-copilot-sdk-local-runtime Bazel target,
with default features disabled. That local-runtime mode enables in-process
transport without SDK-managed acquisition because the CLI supplies the adjacent
runtime.node; bundled-cli takes precedence in all-feature builds.
Use this crate's rust-toolchain.toml, Cargo.toml, and rustfmt configuration,
not the runtime workspace's. See README.md#development
for Node and replay-harness prerequisites. Cargo restores Rust dependencies.
The following direct Cargo commands are standalone SDK repository commands and
use its published/bundled acquisition semantics:
cargo check --all-features
cargo test --features test-support
cargo clippy --all-targets --all-features -- -D warnings
cargo +nightly-2026-04-14 fmt --all -- --config-path .rustfmt.nightly.toml --checkFor changes to the CLI's SDK consumer path, run the repository's Bazel tests from the runtime root:
pnpm bazel test //src/native/cli-runtime:cli-native-runtime_test //src/native/cli-runtime:runtime_sibling_resolution //src/native/cli-runtime:typed_sdk_callDo not restore a repository-wide COPILOT_SKIP_CLI_DOWNLOAD. For focused
same-checkout compilation from this directory, use:
cargo check --no-default-features --features local-runtimeRun it with COPILOT_SKIP_CLI_DOWNLOAD unset. Tests that start the runtime must
also set COPILOT_CLI_PATH to the prepared same-checkout wrapper.
Keep unit tests in external test-only modules: foo.rs declares
#[cfg(test)] mod tests;, and its tests live in foo/tests.rs. Crate roots
such as lib.rs use a sibling tests.rs; descriptive module names keep their
corresponding file names. Start each test-only file with #![cfg(test)].
Keep integration tests in tests/. Integration tests needing SDK test helpers
use the test-support feature because the library is compiled without
cfg(test).
Default features bundle the CLI; disabling them changes what must be provided externally. For transport-specific E2E settings, bundled-runtime checks, and the full platform matrix, follow the Rust SDK workflow. A local unit test run does not replace those checks.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

