{"id":151502,"date":"2024-04-10T13:40:51","date_gmt":"2024-04-10T17:40:51","guid":{"rendered":"http:\/\/www.bu.edu\/tech\/?page_id=151502"},"modified":"2024-05-03T14:05:26","modified_gmt":"2024-05-03T18:05:26","slug":"command-line","status":"publish","type":"page","link":"https:\/\/www.bu.edu\/tech\/support\/research\/software-and-programming\/generative-ai\/command-line\/","title":{"rendered":"GenAI from Command Line"},"content":{"rendered":"<p><a name=\"top\"><\/a><\/p>\n<style>\n  p { text-align: justify; }\n  .image-container { float: right; width: 20%; margin-left: 20px; }\n<\/style>\n<div style=\"width:100%;\">\n<div class=\"image-container\">\n    <img loading=\"lazy\" src=\"\/tech\/files\/2024\/04\/terminal-logo-636x636.png\" alt=\"\" width=\"636\" height=\"636\" class=\"alignnone size-medium wp-image-151584\" srcset=\"https:\/\/www.bu.edu\/tech\/files\/2024\/04\/terminal-logo-636x636.png 636w, https:\/\/www.bu.edu\/tech\/files\/2024\/04\/terminal-logo.png 1024w, https:\/\/www.bu.edu\/tech\/files\/2024\/04\/terminal-logo-150x150.png 150w, https:\/\/www.bu.edu\/tech\/files\/2024\/04\/terminal-logo-768x768.png 768w, https:\/\/www.bu.edu\/tech\/files\/2024\/04\/terminal-logo-100x100.png 100w\" sizes=\"(max-width: 636px) 100vw, 636px\" \/>\n  <\/div>\n<p>Your GitHub Copilot subscription can be accessed from the command line. This requires that your Copilot subscription be active and your GitHub account be authenticated. This is done through the official GitHub command line interface called <code><span class=\"command\">gh<\/span><\/code>. You can read the full documentation for deploying from the command line on the <a href=\"https:\/\/docs.github.com\/en\/copilot\/github-copilot-in-the-cli\/setting-up-github-copilot-in-the-cli\">github-copilot-in-the-cli docs<\/a>.\n<\/div>\n<p><strong>Sections<\/strong><\/p>\n<ul>\n<li><a href=\"#2fa\">Connect your GitHub Account to the SCC<\/a><\/li>\n<li><a href=\"#install\">Install GitHub Copilot<\/a><\/li>\n<\/ul>\n<p>    &nbsp;<br \/>\n    <a name=\"2fa\"><\/a><\/p>\n<h2>Connect your GitHub Account to the SCC<\/h2>\n<p>    We recommend setting up your GitHub account with two-factor authentication (2FA). Please follow our directions on <a href=\"https:\/\/www.bu.edu\/tech\/support\/research\/system-usage\/connect-scc\/access-and-security\/using-scc-with-github-2fa\/\">Using the SCC with GitHub 2FA<\/a>.<br \/>\n    &nbsp;<\/p>\n<p>    <a name=\"install\"><\/a><\/p>\n<h2>Install GitHub Copilot<\/h2>\n<ol>\n<li>Load the <code><span class=\"command\">gh<\/span><\/code> module and authenticate with the command <code><span class=\"command\">gh auth login<\/span><\/code>. In the video below, the following options were chosen: GitHub.com, HTTPS, and y.<br \/>\n        <div style=\"width: 1080px;\" class=\"wp-video\"><!--[if lt IE 9]><script>document.createElement('video');<\/script><![endif]-->\n<video class=\"wp-video-shortcode\" id=\"video-151502-1\" width=\"1080\" height=\"1080\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"\/tech\/files\/2024\/04\/gh_cli_1.mp4?_=1\" \/><a href=\"\/tech\/files\/2024\/04\/gh_cli_1.mp4\">\/tech\/files\/2024\/04\/gh_cli_1.mp4<\/a><\/video><\/div><\/li>\n<p>        &nbsp;<\/p>\n<li>Next you will choose to authenticate via a local browser or token. In the video below, we show authenticating with a browser.<br \/>\n        <div style=\"width: 1080px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-151502-2\" width=\"1080\" height=\"1080\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"\/tech\/files\/2024\/04\/gh_cli_2.mp4?_=2\" \/><a href=\"\/tech\/files\/2024\/04\/gh_cli_2.mp4\">\/tech\/files\/2024\/04\/gh_cli_2.mp4<\/a><\/video><\/div><\/li>\n<p>        &nbsp;<\/p>\n<li>After authenticated, install the GitHub Copilot extension with the following command:\n<pre><code class=\"code-block\"><span class=\"prompt\">[rcs@scc1 ~]<\/span> <span class=\"command\">gh extension install github\/gh-copilot<\/span><\/code><\/pre>\n<p>Now your ready to start using GitHub Copilot from the command line!<br \/>\n<div style=\"width: 1080px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-151502-3\" width=\"1080\" height=\"1080\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"\/tech\/files\/2024\/04\/gh_cli_3.mp4?_=3\" \/><a href=\"\/tech\/files\/2024\/04\/gh_cli_3.mp4\">\/tech\/files\/2024\/04\/gh_cli_3.mp4<\/a><\/video><\/div>\n        <\/li>\n<\/ul>\n<p>    &nbsp;<\/p>\n<div style=\"float: right;\">\n<p id=\"last-modified-timestamp\" style=\"margin: 0;\">Last updated: Loading&#8230;<\/p>\n<\/div>\n<p><script>\r\ndocument.addEventListener('DOMContentLoaded', function() {\r\n    \/\/ Get the content of the meta tag\r\n    var lastUpdatedContent = document.querySelector('meta[name=\"last-updated\"]').content;\r\n    \r\n    \/\/ Parse the content into a Date object\r\n    var lastUpdatedDate = new Date(lastUpdatedContent);\r\n    \r\n    \/\/ Format the date\r\n    var formattedDate = lastUpdatedDate.toLocaleDateString(undefined, { year: 'numeric', month: 'long', day: 'numeric' });\r\n    \r\n    \/\/ Update the HTML element with the formatted date\r\n    document.getElementById('last-modified-timestamp').innerHTML = 'Last updated: ' + formattedDate;\r\n});\r\n<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Your GitHub Copilot subscription can be accessed from the command line. This requires that your Copilot subscription be active and your GitHub account be authenticated. This is done through the official GitHub command line interface called gh. You can read the full documentation for deploying from the command line on the github-copilot-in-the-cli docs. Sections Connect&#8230;<\/p>\n","protected":false},"author":1692,"featured_media":0,"parent":151490,"menu_order":6,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/pages\/151502"}],"collection":[{"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/users\/1692"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/comments?post=151502"}],"version-history":[{"count":20,"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/pages\/151502\/revisions"}],"predecessor-version":[{"id":152059,"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/pages\/151502\/revisions\/152059"}],"up":[{"embeddable":true,"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/pages\/151490"}],"wp:attachment":[{"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/media?parent=151502"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}