elsayed85 / laravel-github-copilot-chat
A Laravel package to add a chatbot powered by GitHub Copilot to your Laravel application.
Requires
- php: ^8.1
- guzzlehttp/guzzle: ^7.7
- illuminate/contracts: ^10.0
- laravel/prompts: ^0.1.5
- league/commonmark: ^2.4
- phppkg/cli-markdown: *
- spatie/laravel-package-tools: ^1.14.0
Requires (Dev)
- laravel/pint: ^1.0
- nunomaduro/collision: ^7.8
- nunomaduro/larastan: ^2.0.1
- orchestra/testbench: ^8.8
- pestphp/pest: ^2.0
- pestphp/pest-plugin-arch: ^2.0
- pestphp/pest-plugin-laravel: ^2.0
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
This package is auto-updated.
Last update: 2024-10-09 05:08:01 UTC
README
Chat With Github Copilot inside Command Line using Laravel.
Installation
You can install the package via composer:
composer require elsayed85/laravel-github-copilot-chat
You can publish the config file with:
php artisan vendor:publish --tag="laravel-github-copilot-chat-config"
This is the contents of the published config file:
return [ 'stream' => true, 'intent' => false, 'model' => 'copilot-chat', 'temperature' => 0.1, 'top_p' => 1, 'n' => 1, 'client_id' => '01ab8ac9400c4e429b23', // Don't change this 'user_agent' => 'GithubCopilot/3.99.99', // Don't change this ];
Usage
Github Copilot Chat
Run :
php artisan copilot:chat
for First Time You need to login to your github account and copy the code from the terminal and auth with github
Got To https://github.com/login/device/ and enter the code: B720-C162
then after auth you need to confirm that
┌ Do you entered the code successfully? ───────────────────────┐
Yes / No
└──────────────────────────────────────────────────────────────┘
Github Copilot CLI
NodeJs Package
To use github-copilot-cli
A CLI experience for letting GitHub Copilot help you on the command line.
GitHub Copilot CLI translates natural language into shell commands, with modes for different domains. After installation, you can use the following three command:
use Elsayed85\CopilotChat\CopilotCli; $cli = new CopilotCli(); $q = "install laravel"; $cli = $cli->init(); $cli->setQuestion($q); $a = $cli->shell(); // you can use shell() or git() or gitCli() // call explanation() after shell() or git() or gitCli() to get explanation of the generated cli command $explanation = $cli->explanation(); dd($a , $explanation);
Then We Will Generate Copilot Token and it will be saved locally using cache for (30 min) and when it expired another token will be generated automatically.
and Now You can Chat With Github copilot Have Fun :)
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.