Skip to content

dwt/llm-github-copilot

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyPI Changelog Tests

llm-github-copilot

A plugin for LLM adding support for GitHub Copilot.

Installation

You can install this plugin using the LLM command-line tool:

llm install llm-github-copilot

Authentication

This 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.

Usage

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 100

Options

The 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)

Development

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 .

Testing

To run the tests:

# Install test dependencies
pip install -e ".[test]"

# Run tests
pytest

If 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

About

A GitHub Copilot plugin for the llm CLI tool

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%