{"id":94,"date":"2026-08-17T20:00:00","date_gmt":"2026-08-17T20:00:00","guid":{"rendered":"https:\/\/telapreta.dev.br\/blog\/?p=94"},"modified":"2026-08-17T16:44:42","modified_gmt":"2026-08-17T19:44:42","slug":"github-copilot-cli-terminal-linux-powershell","status":"publish","type":"post","link":"https:\/\/telapreta.dev.br\/blog\/index.php\/github-copilot-cli-terminal-linux-powershell\/","title":{"rendered":"GitHub Copilot CLI: Como Automatizar o Terminal Linux e PowerShell com IA"},"content":{"rendered":"<div class=\"telapreta-post-body\" style=\"line-height: 1.8;font-size: 1.05rem;color: #e2e8f0\">\n<p><em>Domine a linha de comando! Saiba como utilizar a extens\u00e3o oficial <strong>gh copilot<\/strong> no seu terminal Linux, macOS ou Windows PowerShell para traduzir comandos complexos de linguagem natural. Por <strong>Fabio Silva<\/strong>.<\/em><\/p>\n<hr style=\"border-color: #1e293b;margin: 30px 0\" \/>\n<h2 style=\"color: #10b981;margin-top: 30px\">\ud83d\udcbb O que \u00e9 o GitHub Copilot CLI?<\/h2>\n<p>O GitHub Copilot CLI integra os modelos generativos da OpenAI diretamente ao terminal via extens\u00e3o do <code>gh<\/code> (GitHub CLI). Ele reduz drasticamente a necessidade de buscar sintaxes complexas no Google para ferramentas como <code>ffmpeg<\/code>, <code>tar<\/code>, <code>find<\/code>, <code>awk<\/code> ou <code>kubectl<\/code>.<\/p>\n<h2 style=\"color: #10b981;margin-top: 30px\">\u2699\ufe0f Instala\u00e7\u00e3o e Autentica\u00e7\u00e3o Passo a Passo<\/h2>\n<pre style=\"background: #0f172a;padding: 15px;border-radius: 8px;border: 1px solid #1e293b;color: #10b981;font-family: monospace\">\n# 1. Instalar o GitHub CLI (se ainda n\u00e3o tiver)\nsudo apt install gh   # Ubuntu\/Debian\nwinget install GitHub.cli  # Windows\n\n# 2. Instalar a extens\u00e3o do Copilot CLI\ngh extension install github\/gh-copilot\n\n# 3. Autenticar com sua conta do GitHub\ngh auth login\n<\/pre>\n<h2 style=\"color: #10b981;margin-top: 30px\">\ud83d\ude80 Os 2 Comandos Principais<\/h2>\n<h3 style=\"color: #38bdf8;margin-top: 20px\">1. Explica\u00e7\u00e3o de Comandos (`gh copilot explain`)<\/h3>\n<p>Explica detalhadamente o que um comando faz antes de execut\u00e1-lo:<\/p>\n<pre style=\"background: #0f172a;padding: 10px;border-radius: 6px;border: 1px solid #1e293b;color: #10b981;font-family: monospace\">\ngh copilot explain \"find . -type f -name '*.log' -mtime +30 -exec rm -f {} ;\"\n<\/pre>\n<h3 style=\"color: #38bdf8;margin-top: 20px\">2. Sugest\u00e3o de Comandos (`gh copilot suggest`)<\/h3>\n<p>Gera a linha de comando exata com base na sua descri\u00e7\u00e3o em portugu\u00eas:<\/p>\n<pre style=\"background: #0f172a;padding: 10px;border-radius: 6px;border: 1px solid #1e293b;color: #10b981;font-family: monospace\">\ngh copilot suggest \"Compactar a pasta \/var\/log em um arquivo tar.gz excluindo arquivos ocultos\"\n<\/pre>\n<hr style=\"border-color: #1e293b;margin: 35px 0\" \/>\n<p style=\"color: #94a3b8;font-size: 0.95rem\"><em>S\u00e9rie Especial GitHub Copilot \u2014 Artigo por <strong>Fabio Silva<\/strong> (Arquiteto de Solu\u00e7\u00f5es em Cloud &amp; IA Generativa).<\/em><\/p>\n<\/div>\n<div class=\"vscode-window-mockup\" style=\"background: #1e1e1e;border-radius: 10px;border: 1px solid #3c3c3c;overflow: hidden;margin: 30px 0;font-family: monospace\">\n<div style=\"background: #252526;padding: 8px 15px;display: flex;align-items: center;justify-content: space-between;border-bottom: 1px solid #333\">\n<div style=\"display: flex;gap: 8px\">      <span style=\"width: 12px;height: 12px;border-radius: 50%;background: #ff5f56;display: inline-block\"><\/span>      <span style=\"width: 12px;height: 12px;border-radius: 50%;background: #ffbd2e;display: inline-block\"><\/span>      <span style=\"width: 12px;height: 12px;border-radius: 50%;background: #27c93f;display: inline-block\"><\/span>    <\/div>\n<div style=\"color: #cccccc;font-size: 12px;font-weight: 500\">      <span>\ud83d\udcc4 terminal_script.sh \u2014 Visual Studio Code [Linux x64]<\/span>    <\/div>\n<div style=\"color: #10b981;font-size: 11px;font-weight: bold\">Copilot Enabled \ud83e\udd16<\/div>\n<\/p><\/div>\n<div style=\"background: #2d2d2d;display: flex;border-bottom: 1px solid #1e1e1e;font-size: 13px\">\n<div style=\"background: #1e1e1e;color: #ffffff;padding: 6px 16px;border-right: 1px solid #252526;border-top: 2px solid #10b981;display: flex;align-items: center;gap: 8px\">      <span style=\"color: #10b981\">\u26a1<\/span> terminal_script.sh    <\/div>\n<\/p><\/div>\n<div style=\"padding: 18px;font-size: 13px;line-height: 1.6;color: #d4d4d4;background: #1e1e1e\">\n<pre style=\"margin: 0;background: transparent;padding: 0;border: none;color: inherit;font-family: monospace\"><span style=\"color: #6a9955\">#!\/bin\/bash<\/span>\r\n<span style=\"color: #6a9955\"># GitHub Copilot CLI Auto-Generated Shell Script<\/span>\r\n<span style=\"color: #569cd6\">find<\/span> \/var\/log -type f -size +100M -exec ls -lh {} +<\/pre>\n<\/p><\/div>\n<div style=\"background: #181818;border-top: 1px solid #2b2b2b;padding: 12px 16px;font-size: 12px;color: #cccccc\">\n<div style=\"color: #10b981;font-weight: bold;margin-bottom: 6px;display: flex;align-items: center;gap: 8px\">      <span>\ud83d\udda5\ufe0f TERMINAL (bash)<\/span> <span style=\"color: #666;font-weight: normal\">\u2014 ubuntu@telapreta-server:~<\/span>    <\/div>\n<div style=\"color: #4ec9b0;font-family: monospace\">      <span style=\"color: #10b981\">fabio@ubuntu-linux<\/span>:<span style=\"color: #569cd6\">~\/projects<\/span>$ <span style=\"color: #ce9178\">gh copilot suggest &#039;Buscar todos arquivos .log maiores que 100MB no Linux&#039;<\/span>    <\/div>\n<\/p><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Domine a linha de comando! Saiba como utilizar a extens\u00e3o oficial gh copilot no seu terminal Linux, macOS ou Windows PowerShell para traduzir comandos complexos de linguagem natural. Por Fabio Silva. \ud83d\udcbb O que \u00e9 o GitHub Copilot CLI? O GitHub Copilot CLI integra os modelos generativos da OpenAI diretamente ao terminal via extens\u00e3o do &#8230; <a title=\"GitHub Copilot CLI: Como Automatizar o Terminal Linux e PowerShell com IA\" class=\"read-more\" href=\"https:\/\/telapreta.dev.br\/blog\/index.php\/github-copilot-cli-terminal-linux-powershell\/\" aria-label=\"Read more about GitHub Copilot CLI: Como Automatizar o Terminal Linux e PowerShell com IA\">Ler mais<\/a><\/p>\n","protected":false},"author":1,"featured_media":129,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,3],"tags":[],"class_list":["post-94","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-desenvolvimento","category-ia-agentes"],"_links":{"self":[{"href":"https:\/\/telapreta.dev.br\/blog\/index.php\/wp-json\/wp\/v2\/posts\/94","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/telapreta.dev.br\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/telapreta.dev.br\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/telapreta.dev.br\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/telapreta.dev.br\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=94"}],"version-history":[{"count":4,"href":"https:\/\/telapreta.dev.br\/blog\/index.php\/wp-json\/wp\/v2\/posts\/94\/revisions"}],"predecessor-version":[{"id":217,"href":"https:\/\/telapreta.dev.br\/blog\/index.php\/wp-json\/wp\/v2\/posts\/94\/revisions\/217"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/telapreta.dev.br\/blog\/index.php\/wp-json\/wp\/v2\/media\/129"}],"wp:attachment":[{"href":"https:\/\/telapreta.dev.br\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=94"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/telapreta.dev.br\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=94"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/telapreta.dev.br\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=94"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}