src/: library implementation (client,session,transport,jsonrpc,types).examples/: runnable samples (e.g.cargo run --example basic_chat).tests/: integration tests:e2e_tests.rs(feature-gated; requires a real Copilot CLI)snapshot_conformance.rs(feature-gated; optional upstream snapshot suite)
.github/workflows/ci.yml: CI for fmt/clippy/test/doc/package.
cargo build: compile the crate.cargo test: run unit + integration tests (feature-gated suites are skipped by default).cargo fmt --all: format code (cargo fmt --all -- --checkin CI).cargo clippy --all-targets --all-features -- -D warnings: lint (treat warnings as errors).cargo doc --no-deps: build docs locally.
Feature-gated tests:
cargo test --features e2e -- --test-threads=1: E2E tests against the installed/authenticated Copilot CLI.cargo test --features snapshots --test snapshot_conformance: snapshot conformance (setCOPILOT_SDK_RUST_SNAPSHOT_DIRorUPSTREAM_SNAPSHOTSif auto-detect fails).
- Rust
1.85.0is pinned inrust-toolchain.toml(Edition 2024). - Format with
rustfmt; lint withclippy. - Keep
unsafeout: the crate uses#![forbid(unsafe_code)]. - Maintain attribution headers at the top of Rust files (
tests/attribution_headers.rsenforces this).
- Commit convention is not established in this repo’s current history; use Conventional Commits (
feat:,fix:,docs:,chore:) and keep commits focused. - PRs should include: what/why, how to test (commands), and docs/example updates for API or behavior changes.
- The SDK interacts with the Copilot CLI runtime; avoid logging secrets, prompts, or tokens.
- Ensure
copilotis onPATH, or setCOPILOT_CLI_PATHto the CLI executable/script.