Copilot
GitHub Copilot agent for AI-assisted coding
GitHub Copilot is GitHub's AI coding assistant, deeply integrated with the GitHub ecosystem. It excels at understanding repository context and GitHub workflows.
Overview
| Feature | Details |
|---|---|
| Provider | GitHub (Microsoft) |
| CLI Tool | gh copilot |
| Auth Methods | Copilot subscription only |
| Strengths | GitHub integration, repository context |
Authentication
Copilot requires a GitHub Copilot subscription. API keys are not available.
Subscription Setup
-
Ensure you have an active Copilot subscription:
- Individual ($10/mo)
- Business ($19/mo per user)
- Enterprise (contact sales)
-
Create a fine-grained Personal Access Token:
- Go to GitHub PAT Settings
- Name: "Sesame Copilot"
- Expiration: Your preference (90 days recommended)
- Permissions: Select Copilot
-
In Sesame: Avatar → Agent Credentials → Copilot → Paste token
This token is separate from the GitHub PAT used for repository access. The Copilot token specifically needs the "Copilot" permission.
Environment Variables
| Variable | Description |
|---|---|
COPILOT_GITHUB_TOKEN | GitHub token with Copilot permission |
GH_TOKEN | Fallback: General GitHub token |
GITHUB_TOKEN | Fallback: General GitHub token |
The token is checked in the order above.
Capabilities
Copilot can:
- Understand repository structure and history
- Generate code following project patterns
- Create GitHub Actions workflows
- Write documentation and README files
- Fix issues referenced by number
- Create pull request descriptions
Best Practices
Repository Context
Copilot excels when given GitHub-specific context:
"Fix issue #42 by updating the authentication middleware
to handle expired tokens gracefully."GitHub Workflows
Copilot is great for GitHub-specific tasks:
"Create a GitHub Actions workflow that runs tests on
pull requests and deploys to staging on merge to main."Project Conventions
Reference existing code:
"Add a new API endpoint for user preferences, following
the same patterns used in the existing user routes."Troubleshooting
"Copilot access denied"
- Verify your Copilot subscription is active
- Check the token has the "Copilot" permission
- For organization repos, ensure Copilot is enabled for the org
Token not working
- Verify the token at GitHub Token Settings
- Ensure the token hasn't expired
- Create a new token with Copilot permission
- Update in Sesame's Agent Credentials
Organization restrictions
Some organizations restrict Copilot usage:
- Check with your organization admin
- Organization may need to enable Copilot for members
- Some orgs require Business or Enterprise plans
"Rate limited"
- Copilot has usage limits based on your plan
- Individual plan has lower limits than Business/Enterprise
- Wait and retry if rate limited
CLI Reference
Copilot uses the GitHub CLI:
# Ensure GitHub CLI is installed
gh --version
# Copilot commands
gh copilot suggest "your prompt"
gh copilot explain "code to explain"Pricing
| Plan | Cost | Features |
|---|---|---|
| Individual | $10/month | Personal use |
| Business | $19/month per user | Team features, admin controls |
| Enterprise | Contact sales | Advanced security, compliance |
All plans include unlimited suggestions. For details, see GitHub Copilot Pricing.
GitHub Integration
Copilot works seamlessly with GitHub features:
- Issues: Reference issues by number in prompts
- Pull Requests: Generates PR descriptions
- Actions: Creates and debugs workflows
- Discussions: Can reference discussion context
- Code Search: Understands repository code patterns