{"id":10267,"date":"2024-10-29T11:03:09","date_gmt":"2024-10-29T18:03:09","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/commandline\/?p=10267"},"modified":"2024-10-29T11:03:09","modified_gmt":"2024-10-29T18:03:09","slug":"github-copilot-in-windows-terminal","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/commandline\/github-copilot-in-windows-terminal\/","title":{"rendered":"GitHub Copilot in Windows Terminal"},"content":{"rendered":"<p>GitHub Copilot users can now use the power of GitHub Copilot to get command suggestions and explanations without leaving the terminal with <a href=\"https:\/\/learn.microsoft.com\/windows\/terminal\/terminal-chat\">Terminal Chat<\/a> in <a href=\"https:\/\/github.com\/microsoft\/terminal#installing-windows-terminal-canary\">Windows Terminal Canary<\/a> \ud83d\ude80<\/p>\n<p>This is available for all GitHub Copilot Individual, Business, and Enterprise customers. To get started, <a href=\"https:\/\/aka.ms\/terminal-gh-copilot-trial\">sign up for a GitHub Copilot free trial<\/a> and check out the <a href=\"https:\/\/aka.ms\/terminal-gh-copilot-quickstart\">GitHub Copilot quickstart guide<\/a>.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2024\/10\/github-copilot-in-windows-terminal-blog-header.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2024\/10\/github-copilot-in-windows-terminal-blog-header.png\" alt=\"Header image displaying GitHub Copilot in Windows Terminal\" width=\"2400\" height=\"1260\" class=\"alignnone size-full wp-image-10265\" srcset=\"https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2024\/10\/github-copilot-in-windows-terminal-blog-header.png 2400w, https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2024\/10\/github-copilot-in-windows-terminal-blog-header-300x158.png 300w, https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2024\/10\/github-copilot-in-windows-terminal-blog-header-1024x538.png 1024w, https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2024\/10\/github-copilot-in-windows-terminal-blog-header-768x403.png 768w, https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2024\/10\/github-copilot-in-windows-terminal-blog-header-1536x806.png 1536w, https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2024\/10\/github-copilot-in-windows-terminal-blog-header-2048x1075.png 2048w\" sizes=\"(max-width: 2400px) 100vw, 2400px\" \/><\/a><\/p>\n<h1>What is GitHub Copilot?<\/h1>\n<p><a href=\"https:\/\/aka.ms\/terminal-gh-copilot-features\">GitHub Copilot<\/a> is an AI coding assistant that helps you write code faster and with less effort, allowing you to focus more energy on problem solving and collaboration.<\/p>\n<p>GitHub Copilot has been proven to increase developer productivity and accelerate the pace of software development. For more information, see &#8220;<a href=\"https:\/\/github.blog\/news-insights\/research\/research-quantifying-github-copilots-impact-on-developer-productivity-and-happiness\/\">Research: quantifying GitHub Copilot\u2019s impact on developer productivity and happiness<\/a>&#8221; in the GitHub blog.<\/p>\n<h1>What is Terminal Chat?<\/h1>\n<p><a href=\"https:\/\/learn.microsoft.com\/windows\/terminal\/terminal-chat\">Terminal Chat<\/a> is a feature in <a href=\"https:\/\/github.com\/microsoft\/terminal#installing-windows-terminal-canary\">Windows Terminal Canary<\/a> that allows the user to chat with an AI service (like GitHub Copilot \ud83d\ude09) to get intelligent suggestions in the context of their terminal.<\/p>\n<p>This feature does not ship with its own large-language model and can also be managed by Group Policy. See &#8220;<a href=\"https:\/\/learn.microsoft.com\/en-us\/windows\/terminal\/group-policy#enabled-language-modelsai-providers\">Group Policies for Windows Terminal<\/a>&#8221; for more information.<\/p>\n<h1>Use GitHub Copilot in Terminal Chat<\/h1>\n<p>Connecting GitHub Copilot in Terminal Chat allows you to get command suggestions and explanations without leaving the terminal. This is available for all GitHub Copilot Individual, Business, and Enterprise customers.<\/p>\n<h2>Prerequisites<\/h2>\n<ul>\n<li><strong>Subscription to GitHub Copilot.<\/strong> If you don&#8217;t already have access to GitHub Copilot, you can set up a <a href=\"https:\/\/aka.ms\/terminal-gh-copilot-trial\">free trial or subscription<\/a><\/li>\n<li><strong>Windows Terminal Canary.<\/strong> You can <a href=\"https:\/\/github.com\/microsoft\/terminal#installing-windows-terminal-canary\">download the latest build of Windows Terminal Canary<\/a> from the Windows Terminal GitHub repository <\/li>\n<\/ul>\n<p>If you have access to GitHub Copilot via your organization, you won&#8217;t be able to use GitHub Copilot if your organization owner has disabled GitHub Copilot in the CLI. See &#8220;<a href=\"https:\/\/docs.github.com\/copilot\/managing-copilot\/managing-github-copilot-in-your-organization\/setting-policies-for-copilot-in-your-organization\/managing-policies-for-copilot-in-your-organization\">Managing policies for Copilot in your organization<\/a>.&#8221;<\/p>\n<h2>Setup<\/h2>\n<ol>\n<li>Open the dropdown menu and select <strong>Settings<\/strong><\/li>\n<li>Go to the <strong>Terminal Chat (Experimental)<\/strong> setting<\/li>\n<li>Under <strong>Service Providers<\/strong>, select <strong>GitHub Copilot<\/strong> and <strong>Authenticate via GitHub<\/strong> to sign in to your GitHub account<\/li>\n<li>After successfully authenticating, ensure that <strong>Set as active provider<\/strong> is checked and click <strong>Save<\/strong><\/li>\n<\/ol>\n<p>After this, you will be able to use GitHub Copilot in Terminal Chat!<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2024\/10\/terminal-chat-github-copilot.gif\" alt=\"Animated GIF of a user signing into GitHub Copilot to enable Terminal Chat to chat with GitHub Copilot\" width=\"1167\" height=\"510\" class=\"alignnone size-full wp-image-9885\" \/><\/p>\n<p>In the GIF above, you will see an end-to-end demo of the authorization flow and how to use Terminal Chat. You&#8217;ll also notice that Terminal Chat transformed into a GitHub Copilot branded experience after signing into GitHub!<\/p>\n<p>Clicking on Terminal Chat&#8217;s suggestion will copy it to the input line of your terminal. Terminal Chat will not run the suggestion automatically for you\u2013 This way, you will have time to reason over the command before executing it \ud83d\ude42<\/p>\n<p>Terminal Chat only communicates to GitHub Copilot when the user sends a message. The chat history and name of the user\u2019s active shell is also appended to the message sent to GitHub Copilot. For more information on how to use GitHub Copilot responsibly with Windows Terminal, see <a href=\"https:\/\/docs.github.com\/copilot\/responsible-use-of-github-copilot-features\/responsible-use-of-github-copilot-in-windows-terminal\">Responsible use of GitHub Copilot in Windows Terminal<\/a>.<\/p>\n<h1>Tips &amp; Tricks<\/h1>\n<p>Here are several ways that you can use GitHub Copilot in Terminal Chat!<\/p>\n<ul>\n<li>\n<p><strong>Command suggestions<\/strong>: Ask for a command that you would like to use. Terminal Chat also adds name of the active shell to the prompt that you send to GitHub Copilot. This helps us get answers tailored to the shell that is in use&#8211; This means we don&#8217;t have to specify if we want answers for CMD or PowerShell (Yay! Less typing!)<\/p>\n<\/li>\n<li>\n<p><strong>Translate commands<\/strong>: Terminal Chat can also be used to &#8220;translate&#8221; commands. For example, you can ask &#8220;What&#8217;s touch in PowerShell?&#8221; or &#8220;How do I touch in PowerShell?&#8221; to get the suggestion of <code>New-Item<\/code>, a PowerShell command that is equivalent to the Linux \/ Unix-based <code>touch<\/code> command for creating a new file<\/p>\n<\/li>\n<li>\n<p><strong>Explain an error<\/strong>: If you&#8217;ve received an unfamiliar error response in your command line, you can ask Terminal Chat for an explanation and how to fix it. For example, &#8220;What is Error: getaddrinfo ENOTFOUND and how do I fix it?&#8221;<\/p>\n<\/li>\n<li>\n<p><strong>Send code suggestions to command-line text editors<\/strong>: If you&#8217;re using a command-line text editor in WSL (like <code>nano<\/code> or <code>vi<\/code>), you can ask Terminal Chat to generate code and send the code suggestion to the editor by clicking the &#8220;Copy&#8221; button. See the GIF below for a demo!<\/p>\n<\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2024\/10\/terminal-chat-vi.gif\" width=\"1167\" height=\"510\" class=\"alignnone size-full wp-image-9885\" \/><\/p>\n<h1>Let&#8217;s Build Together<\/h1>\n<p>For now, Terminal Chat is only available in Windows Terminal Canary. We are committed to transparency and listening to user feedback. We strongly believe that the inclusion of the open-source community will help us define the roadmap for our core product, Windows Terminal.<\/p>\n<p>If you are interested in the AI experiences that we are building, then check out the <code>feature\/llm<\/code> branch of the Windows Terminal repository or <a href=\"https:\/\/github.com\/microsoft\/terminal#installing-windows-terminal-canary\">download the latest build of Windows Terminal Canary<\/a>.<\/p>\n<p>If you have a feature request or found a bug, then please <a href=\"https:\/\/github.com\/microsoft\/terminal\/issues\">submit a new Issue<\/a> on our GitHub repository. Send us feedback! Help us grow! And let\u2019s build together!<\/p>\n<p>If you need to set Group Policies for Terminal Chat, see our <a href=\"https:\/\/learn.microsoft.com\/en-us\/windows\/terminal\/group-policy#enabled-language-modelsai-providers\">Group Policy documentation<\/a>.<\/p>\n<p>Lastly, if you want to explore the other features you get with a GitHub Copilot subscription (which includes GitHub Copilot in Visual Studio Code and Visual Studio!) then check out the <a href=\"https:\/\/aka.ms\/terminal-gh-copilot-features\">GitHub Copilot website<\/a> for more info!<\/p>\n<p>Thank you!<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/commandline\/wp-content\/uploads\/sites\/33\/2023\/01\/Jan2023Signatures.png\" alt=\"2023 Signatures\" width=\"1801\" height=\"259\" class=\"alignnone size-full wp-image-8322\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>GitHub Copilot users can now use the power of GitHub Copilot to get command suggestions and explanations without leaving the terminal with Terminal Chat in Windows Terminal Canary \ud83d\ude80 This is available for all GitHub Copilot Individual, Business, and Enterprise customers. To get started, sign up for a GitHub Copilot free trial and check out [&hellip;]<\/p>\n","protected":false},"author":101092,"featured_media":10265,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[10,1,2,1535,1728,6,9,782],"tags":[],"class_list":["post-10267","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cmd","category-commandline","category-command-line","category-open-source","category-windows","category-windows-console","category-bash-on-ubuntu-on-windows","category-windows-terminal"],"acf":[],"blog_post_summary":"<p>GitHub Copilot users can now use the power of GitHub Copilot to get command suggestions and explanations without leaving the terminal with Terminal Chat in Windows Terminal Canary \ud83d\ude80 This is available for all GitHub Copilot Individual, Business, and Enterprise customers. To get started, sign up for a GitHub Copilot free trial and check out [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/commandline\/wp-json\/wp\/v2\/posts\/10267","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/commandline\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/commandline\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/commandline\/wp-json\/wp\/v2\/users\/101092"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/commandline\/wp-json\/wp\/v2\/comments?post=10267"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/commandline\/wp-json\/wp\/v2\/posts\/10267\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/commandline\/wp-json\/wp\/v2\/media\/10265"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/commandline\/wp-json\/wp\/v2\/media?parent=10267"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/commandline\/wp-json\/wp\/v2\/categories?post=10267"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/commandline\/wp-json\/wp\/v2\/tags?post=10267"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}