Team Patterns
This page covers configuration deep-dives, troubleshooting, team standardization, and performance optimization. It wraps up the workshop with a summary of everything you've learned.
For autopilot, fleet, and LSP configuration, see Automation Patterns. For foundational configuration and CI/CD, see Advanced Topics.
Exercise 8: Configuration File Deep Dive
Goal: Understand and customize config.json and related configuration files.
Steps:
-
View current configuration:
cat ~/.copilot/config.json -
Example full configuration:
{
"trusted_folders": [
"/home/user/projects",
"/home/user/work"
],
"default_model": "gpt-4.1",
"theme": "dark",
"editor": "code",
"shell": "bash",
"telemetry": true,
"auto_update": true
} -
Add trusted folders:
# Using jq to update config
jq '.trusted_folders += ["/new/path"]' ~/.copilot/config.json > tmp.json
mv tmp.json ~/.copilot/config.json -
Configure URL restrictions:
{
"web_fetch": {
"allowed_urls": [
"https://api.github.com/*",
"https://docs.github.com/*"
],
"denied_urls": [
"https://evil.com/*"
]
}
}
Expected Outcome: Custom configuration for your workflow, including LSP settings from Exercise 7.
Exercise 9: Troubleshooting Guide
Goal: Diagnose and fix common issues.
Steps:
-
Authentication issues:
# Clear credentials and re-authenticate
rm -rf ~/.copilot/auth*
copilot
# Follow OAuth flow -
Tool not working:
# Check if tool is allowed
copilot -p "test" --available-tools
# Verify MCP servers
copilot
/mcp show -
Session issues:
# Clear session data
rm -rf ~/.copilot/sessions/
# Start fresh
copilot
/clear -
Performance issues:
# Check context usage
copilot
/context
# Compact if needed
/compact
# Or start fresh
/clear -
Agent not found:
# Verify agent file exists
ls -la .github/agents/
# Check YAML syntax
cat .github/agents/my-agent.md | head -10
# Ensure frontmatter is valid -
MCP server failing:
# Check if server runs independently
npx @modelcontextprotocol/server-memory
# Check config syntax
cat ~/.copilot/mcp-config.json | jq .
Expected Outcome: You can diagnose and resolve common problems, including LSP timeouts and shell mode access.
Exercise 10: Team Workflow Patterns
Goal: Establish team-wide Copilot practices.
Steps:
-
Standardize repository configuration:
# Create a template repository with:
.github/
├── copilot-instructions.md # Team coding standards
├── agents/
│ ├── reviewer.md # Code review agent
│ └── docs.md # Documentation agent
├── instructions/
│ ├── typescript.instructions.md
│ └── tests.instructions.md
└── hooks/
└── hooks.json # Security guardrails
AGENTS.md # Project-specific agent
llm.txt # Project context for LLMs -
Create onboarding documentation:
# Team Copilot CLI Guide
## Setup
1. Install: `npm install -g @github/copilot`
2. Authenticate: `copilot` and follow OAuth
3. Clone this repo template
## Our Agents
- @reviewer - Code review
- @docs - Documentation
## Commit Convention
All commits must follow Conventional Commits.
## Security Rules
- Never approve `rm -rf` for session
- Never push directly to main
- Always use `--deny-tool 'shell(git push)'` in automation -
Share MCP configurations:
# Create a shared MCP config
cat > shared-mcp-config.json << 'EOF'
{
"servers": {
"team-tools": {
"url": "https://team-mcp.example.com/",
"requestInit": {
"headers": {
"Authorization": "Bearer ${TEAM_MCP_TOKEN}"
}
}
}
}
}
EOF -
Establish review checklist:
## PR Copilot Checklist
- [ ] Run `@reviewer` on changes
- [ ] Generate docs with `@docs`
- [ ] Check context usage stayed reasonable
- [ ] No sensitive data in session exports
Expected Outcome: Team-wide standardization on Copilot usage, including shared LSP and environment configurations.
Exercise 11: Performance Optimization
Goal: Get the best performance from Copilot CLI.
Steps:
-
Optimize startup time:
# Pre-authenticate
copilot --version
# Use --silent for faster scripted operations
copilot -p "quick task" --silent -
Reduce network round-trips:
# Batch operations
copilot -p "Create user.ts, user.test.ts, and user.types.ts with related code" \
--allow-tool 'write'
# Instead of three separate prompts -
Choose appropriate models:
# Fast model for simple tasks
copilot --model gpt-5-mini -p "Format this JSON"
# Full model for complex analysis
copilot --model gpt-4.1 -p "Refactor this complex module" -
Efficient context management:
# Use @explore for overview without context cost
# Use targeted reads instead of reading all files
# Compact proactively, not reactively -
Use Autopilot for repetitive multi-step tasks:
# Instead of manual step-by-step
copilot --autopilot -p "Set up complete testing infrastructure for all services"
# Saves time and reduces back-and-forthSee Exercise 4 for full autopilot details.
-
Use Fleet for parallel work:
# Faster than sequential processing
copilot
/fleet "Migrate all 50 components to the new API format"
# Multiple agents work in parallelSee Exercise 5 for full fleet details.
-
Parallel sessions for independent tasks:
# Terminal 1: Frontend work
cd frontend && copilot
# Terminal 2: Backend work
cd backend && copilot
# Terminal 3: Documentation
cd docs && copilot
Expected Outcome: Maximum performance from Copilot CLI using parallelization, autopilot, and fleet features.
Summary
- ✅ Environment variables customize behavior globally
- ✅ CI/CD integration enables automated workflows
- ✅ Advanced flags give precise control
- ✅ Autopilot mode enables autonomous multi-step task execution (v0.0.411)
- ✅ Fleet command parallelizes complex tasks with orchestrator validation (v0.0.411-v0.0.412)
- ✅ --bash-env sources custom environment for shell sessions (v0.0.412)
- ✅ --experimental enables alt-screen mode by default (v0.0.413)
- ✅ LSP configuration controls language server timeouts; default request timeout is 90s (v0.0.412-v0.0.413)
- ✅ Shell mode access via
!command (v0.0.410) - ✅ config.json and lsp.json persist preferences
- ✅ Team standardization ensures consistency
- ✅ Performance optimization maximizes productivity
Workshop Complete! 🎉
Congratulations on completing the GitHub Copilot CLI Workshop!
What You've Learned
- Installation - Multiple methods to install and authenticate
- Operating Modes - Interactive, programmatic, and delegate
- Sessions - Management, persistence, and control
- Instructions - AGENTS.md, copilot-instructions.md, llm.txt
- Tools - Permissions, allow/deny, YOLO mode
- MCP Servers - Configuration and custom integrations
- Skills - Creating and using specialized capabilities
- Plugins - Ecosystem and custom extensions
- Custom Agents - Building specialized personas
- Hooks - Lifecycle automation and security
- Context - Monitoring and optimization
- Advanced - Autopilot, Fleet, CI/CD, LSP config, environment, and team practices
Next Steps
- Practice daily with real projects
- Create custom agents for your workflow
- Share skills with your team
- Contribute to the Copilot ecosystem
Resources
Thank you for participating in this workshop!