IA & Agentes
GitHub Copilot a fundo [4] - Copilot CLI: o agente que mora no seu terminal
GitHub Copilot in depth [4] - Copilot CLI, the agent in your terminal
Fala dataholics, dessa vez a gente tira o Copilot da IDE. Quem trabalha com dados vive no terminal, entre um databricks bundle deploy, um terraform plan e aquele script que roda uma vez por mês e ninguém lembra o parâmetro, então faz todo sentido ter o agente ali dentro. O GitHub Copilot CLI ficou GA em fevereiro de 2026, depois de uns cinco meses de public preview, e ele é bem mais do que um "me explica esse comando".

Instalando e autenticando
A instalação é sem drama e tem caminho pra todo mundo: npm, Homebrew, WinGet, script de shell ou binário standalone. Ele funciona em todos os planos pagos, Pro, Pro+, Business e Enterprise, com um detalhe organizacional: em Business e Enterprise o admin precisa habilitar o CLI, então se você tentar usar com a licença da empresa e ele reclamar, o problema provavelmente está na política e não na sua máquina.
npm install -g @github/copilot
copilotA autenticação usa OAuth por device flow, e se você já tem o gh logado ele reaproveita o token, o que economiza aquele vai e volta no browser. Pra pipeline existe suporte a GITHUB_ASKPASS, ou seja, dá pra rodar em CI sem gambiarra de credencial em variável solta.
Plan mode: ele pensa antes de escrever
O recurso que salva tarefa grande é o plan mode, que você liga com Shift+Tab. Nele o agente analisa o pedido, faz pergunta de esclarecimento e monta um plano estruturado antes de escrever uma linha de código. Parece detalhe, mas muda o resultado de verdade em tarefa que envolve mais de um arquivo, porque você corrige o rumo enquanto é barato, no plano, em vez de descobrir depois de 15 arquivos alterados que ele entendeu o pedido errado.
Eu uso plan mode toda vez que a tarefa passa de "arruma esse teste". Em coisa pequena o plano só atrasa.
Autopilot e delegação pra nuvem
O outro lado da moeda é o autopilot mode, que executa autonomamente sem pedir aprovação a cada passo. Aqui eu vou ser bem direto com você: autopilot em repositório que importa, sem branch separada e sem estar limpo no git, é pedir pra passar raiva. Eu uso em branch descartável, em tarefa mecânica e repetitiva, e nunca com o terminal apontando pra ambiente produtivo.
E tem o recurso que eu não esperava e achei muito prático: prefixando o prompt com & você delega a tarefa pra um cloud agent e o seu terminal fica livre na mesma hora. Ele vai trabalhar lá no GitHub enquanto você continua sua vida, e o /resume serve pra voltar e trocar entre sessões. Na prática você monta uma fila: manda duas ou três tarefas chatas pra nuvem, segue mexendo no que precisa da sua cabeça e depois passa recolhendo o resultado.
# delega pra nuvem e libera o terminal
& atualiza as dependencias e roda os testes
# volta pra uma sessao anterior
/resumeEle herda tudo que a gente configurou na série
Essa parte amarra os posts anteriores. O Copilot CLI já vem com o GitHub MCP Server embutido, aceita servidores MCP customizados, lê agent skills em markdown e ainda tem hooks pra você aplicar política. Ou seja, o AGENTS.md que você escreveu no post 1, as skills do post 2 e o allowlist de MCP do post 3 valem aqui também, porque o allowedMcpServers da enterprise é aplicado no CLI.
O CLI também tem instrução pessoal própria, em ~/.copilot/copilot-instructions.md, e essa é uma superfície onde ela funciona. Bom lugar pra colocar sua preferência de ferramenta, tipo "sempre uv em vez de pip" ou "não crie script solto na raiz", sem empurrar isso pro repositório do time.
Memória de repositório e compactação
Duas coisas que aparecem pouco no anúncio e pesam no uso longo: a conversa compacta automaticamente quando cresce, então ele não morre no meio de uma tarefa comprida, e existe memória por repositório que persiste entre sessões. Você fecha o terminal, volta amanhã naquele projeto e ele não começa do zero perguntando o que é aquele diretório.
Isso é bom e merece um aviso: memória persistente é ótima quando o entendimento dele está certo e é chata quando ele memorizou algo torto. Se ele insiste num caminho errado sessão após sessão, olhe a memória antes de culpar o modelo.
Onde ele encaixa no meu dia
Tarefa de repo com muitos arquivos, com plan mode ligado antes de deixar ele escrever.
Coisa mecânica e repetitiva delegada com & enquanto eu faço outra coisa.
Investigação de erro em CI, porque o MCP embutido lê workflow e log direto do GitHub.
Script chato de infra e de bundle, que é onde ele economiza mais tempo por linha digitada.
Um cuidado que não é técnico e sim de bolso: autopilot e delegação são as duas formas mais rápidas de queimar consumo sem perceber, porque o agente itera sozinho e cada iteração custa. Isso ficou bem mais visível depois da mudança de cobrança que a GitHub fez em junho de 2026, e é exatamente o assunto do último post dessa série.
Referências:
https://github.blog/changelog/2026-02-25-github-copilot-cli-is-now-generally-available/
https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/add-custom-instructions
Comenta aí se você já roda agente no terminal ou se ainda prefere tudo dentro da IDE. Fique bem e até a próxima.
#githubcopilot #copilotcli #copilot #ia #agentes #datainaction
Hey dataholics, this time we take Copilot out of the IDE. Whoever works with data lives in the terminal, between a databricks bundle deploy, a terraform plan and that script that runs once a month and nobody remembers the parameter for, so having the agent right there makes total sense. GitHub Copilot CLI went GA in February 2026, after about five months of public preview, and it is way more than a "explain this command to me".

Installing and authenticating
Installing is drama free and there is a path for everyone: npm, Homebrew, WinGet, a shell script or standalone binaries. It works on every paid plan, Pro, Pro+, Business and Enterprise, with one organizational detail: on Business and Enterprise the admin has to enable the CLI, so if you try it with the company license and it complains, the problem is probably in the policy and not on your machine.
npm install -g @github/copilot
copilotAuthentication uses OAuth device flow, and if you already have gh logged in it reuses the token, which saves that back and forth in the browser. For pipelines there is GITHUB_ASKPASS support, so you can run it in CI without hacking credentials into a loose variable.
Plan mode: it thinks before writing
The feature that saves big tasks is plan mode, which you turn on with Shift+Tab. In it the agent analyzes the request, asks clarifying questions and builds a structured plan before writing a single line of code. Sounds like a detail, but it really changes the outcome on anything touching more than one file, because you correct course while it is cheap, in the plan, instead of finding out after 15 changed files that it misread the request.
I use plan mode every time the task goes beyond "fix this test". On small stuff the plan only slows you down.
Autopilot and delegating to the cloud
The other side of the coin is autopilot mode, which runs autonomously without asking for approval at each step. I will be very direct with you here: autopilot on a repository that matters, without a separate branch and without a clean git status, is asking for trouble. I use it on a throwaway branch, on mechanical repetitive tasks, and never with the terminal pointing at a production environment.
And there is the feature I was not expecting and found very handy: prefixing the prompt with & delegates the task to a cloud agent and frees your terminal right away. It goes off to work over on GitHub while you get on with your life, and /resume brings you back and switches between sessions. In practice you build a queue: send two or three boring tasks to the cloud, keep working on what needs your head, then come back collecting the results.
# delegate to the cloud and free the terminal
& update the dependencies and run the tests
# go back to a previous session
/resumeIt inherits everything we set up in the series
This part ties the previous posts together. Copilot CLI ships with the GitHub MCP Server built in, takes custom MCP servers, reads agent skills in markdown and also has hooks so you can enforce policy. So the AGENTS.md you wrote in post 1, the skills from post 2 and the MCP allowlist from post 3 all apply here too, because the enterprise allowedMcpServers is enforced in the CLI.
The CLI also has its own personal instruction file, at ~/.copilot/copilot-instructions.md, and this is a surface where it works. Good place for your tooling preferences, something like "always uv instead of pip" or "do not create loose scripts in the root", without pushing that into the team repository.
Repository memory and compaction
Two things that barely show up in the announcement and matter a lot in long usage: the conversation auto compacts as it grows, so it does not die in the middle of a long task, and there is per repository memory that persists across sessions. You close the terminal, come back tomorrow to that project and it does not start from zero asking what that directory is.
That is good and it deserves a warning: persistent memory is great when its understanding is right and annoying when it memorized something crooked. If it keeps insisting on a wrong path session after session, check the memory before blaming the model.
Where it fits in my day
Repo tasks touching many files, with plan mode on before letting it write.
Mechanical repetitive work delegated with & while I do something else.
Investigating CI failures, because the built in MCP reads workflows and logs straight from GitHub.
Tedious infra and bundle scripts, which is where it saves the most time per line typed.
One caution that is not technical but financial: autopilot and delegation are the two fastest ways to burn usage without noticing, because the agent iterates on its own and every iteration costs. That became a lot more visible after the billing change GitHub made in June 2026, and that is exactly the subject of the last post in this series.
References:
https://github.blog/changelog/2026-02-25-github-copilot-cli-is-now-generally-available/
https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/add-custom-instructions
Tell me in the comments if you already run an agent in the terminal or if you still prefer everything inside the IDE. Stay well and see you next time.
#githubcopilot #copilotcli #copilot #ai #agents #datainaction
Gostou? Tem mais no YouTube e no LinkedIn.
Enjoyed it? There's more on YouTube and LinkedIn.