Skip to content

Latest commit

 

History

History
190 lines (141 loc) · 3.88 KB

File metadata and controls

190 lines (141 loc) · 3.88 KB

Copilot SDK Project Templates

Quick-start templates for building agentic applications with the GitHub Copilot SDK.

Available Templates

🟦 TypeScript Quickstart

Path: typescript-quickstart/

Full-featured TypeScript template with:

  • Interactive CLI interface
  • Example custom tools (calculator, time)
  • Streaming responses
  • Hot reload support
  • ESLint & Prettier configuration

Get Started:

cd typescript-quickstart
npm install
npm start

View TypeScript Template →


🐍 Python Quickstart

Path: python-quickstart/

Python template with async/await support:

  • Interactive CLI interface
  • Example custom tools (calculator, time)
  • Streaming responses
  • Type hints
  • Virtual environment ready

Get Started:

cd python-quickstart
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python src/main.py

View Python Template →


Using a Template

1. Copy the Template

# Copy TypeScript template
cp -r templates/typescript-quickstart my-agentic-app
cd my-agentic-app

# Or Python template
cp -r templates/python-quickstart my-agentic-app
cd my-agentic-app

2. Set Up Environment

Copy the environment template:

cp ../templates/.env.example .env

Edit .env and configure your settings.

3. Install Dependencies

TypeScript:

npm install

Python:

python -m venv venv
source venv/bin/activate
pip install -r requirements.txt

4. Run

TypeScript:

npm start

Python:

python src/main.py

Template Features

All templates include:

  • Pre-configured SDK setup - Ready to use
  • Example custom tools - Learn by example
  • Interactive CLI - Test your agents
  • Streaming support - Real-time responses
  • Environment variables - Easy configuration
  • Documentation - Get started quickly

Environment Configuration

All templates use the same .env.example file located in templates/.env.example.

Key settings:

COPILOT_MODEL=gpt-4.1           # AI model to use
COPILOT_STREAMING=true          # Enable streaming
LOG_LEVEL=info                  # Logging verbosity

See .env.example for all options.

Creating Custom Tools

TypeScript Example

import { defineTool } from "@github/copilot-sdk";

const myTool = defineTool("my_tool", {
    description: "What your tool does",
    parameters: {
        type: "object",
        properties: {
            input: { type: "string", description: "Input parameter" },
        },
        required: ["input"],
    },
    handler: async (args) => {
        // Your logic here
        return { result: args.input.toUpperCase() };
    },
});

Python Example

from copilot.tools import define_tool

@define_tool(description="What your tool does")
async def my_tool(params: dict) -> dict:
    """Tool documentation"""
    # Your logic here
    return {"result": params["input"].upper()}

Next Steps

After using a template:

  1. Customize the tools - Add your own business logic
  2. Connect to MCP servers - Integrate external services
  3. Add error handling - Make it production-ready
  4. Deploy - Share your agentic app

Resources

Need Help?

Contributing

Have an idea for a new template? Open a PR or issue!

Requirements for new templates:

  • Clear README with setup instructions
  • Example custom tools
  • Environment variable support
  • Proper error handling
  • .gitignore file