A plugin for LLM adding support for GitHub Copilot.
You can install this plugin using the LLM command-line tool:
llm install llm-github-copilotThis plugin uses GitHub's device code authentication flow. When you first use the plugin, it will prompt you to visit GitHub and enter a code to authenticate.
Free plan includes up to 2,000 completions and 50 chat requests per month.
Once installed, you can use GitHub Copilot models with the llm command:
# Chat with GitHub Copilot
llm -m github-copilot "Write a Python function that calculates the Fibonacci sequence."
# Specify options like length
llm -m github-copilot "Tell me a joke" -o max_tokens 100The GitHub Copilot plugin supports the following options:
max_tokens: Maximum number of tokens to generate (default: 1024)temperature: Controls randomness in the output (default: 0.7)
To develop this plugin:
# Clone the repository
git clone https://github.com/yourusername/llm-github-copilot.git
cd llm-github-copilot
# Install in development mode
llm install -e .To run the tests:
# Install test dependencies
pip install -e ".[test]"
# Run tests
pytestIf you want to record new VCR cassettes for tests, set your API key:
export PYTEST_GITHUB_COPILOT_API_KEY=your_api_key_here
pytest --vcr-record=new_episodes