← back to posts

GitHub Copilot CLI: An AI Agent Living in Your Terminal

AItoolsproductivity

If you’ve been following the AI-assisted development space, you’ve probably heard of GitHub Copilot. Most people associate it with inline code suggestions in VS Code or JetBrains. But there’s another flavor that doesn’t get nearly enough attention — GitHub Copilot CLI, an agentic AI that lives entirely in your terminal.

I’ve been using it for a while now, and I want to share some use cases that go beyond the obvious “write me a function” territory.

It’s Not Autocomplete — It’s an Agent

The key distinction is that Copilot CLI is not a glorified autocomplete. It’s a full-blown agent that can:

  • Read and edit files across your entire project
  • Run shell commands and react to their output
  • Plan multi-step tasks before executing them
  • Use Language Server Protocol (LSP) for code intelligence
  • Interact with GitHub (issues, PRs, commits) through natural language

You launch it with copilot in your terminal, describe what you want, and it figures out the steps. It asks for permission before making changes — nothing happens behind your back.

Use Cases That Surprised Me

1. Codebase Archaeology

You inherited a legacy project. No documentation, cryptic variable names, and a utils.js that’s 3,000 lines long. Instead of spending hours reading through it, you can just ask:

"What does this codebase do? Walk me through the architecture."

Copilot CLI will explore the directory structure, read key files, trace imports, and give you a coherent summary. It uses LSP features like go-to-definition and find-references to follow the code flow, not just grep for strings.

2. Deep Research

Need to understand a new library, API, or concept before writing code? The /research command triggers a deep investigation using GitHub search and web sources. It doesn’t just return links — it synthesizes findings into a structured report.

/research How does Astro content collections handle MDX validation?

I use this instead of context-switching to a browser. It’s faster and the results are already framed in the context of what I’m working on.

3. Code Review on Your Terms

Before pushing, I often run:

/review

This triggers a code review agent that analyzes your staged or unstaged changes. It focuses on actual issues — bugs, security vulnerabilities, logic errors — not style nitpicks. Think of it as a sanity check before your PR.

You can also use /diff to get a quick overview of what changed, which is handy when you’ve been deep in a refactoring session and lost track.

4. GitHub Without Leaving the Terminal

This one is underrated. Copilot CLI ships with GitHub’s MCP (Model Context Protocol) server built-in, which means you can interact with GitHub natively:

"List open issues labeled 'bug' in this repo"
"Create a PR from the current branch with a summary of my changes"
"What's the status of the CI pipeline on my latest push?"

No gh CLI memorization needed. Just describe what you want in plain English.

5. Interactive Debugging

When a build fails or tests break, you can paste the error or just say:

"The build is failing, can you figure out why and fix it?"

Copilot CLI will run the build, read the error output, trace it to the source, and propose a fix. If you approve, it applies the change and re-runs the build to verify. This loop — diagnose, fix, verify — is where the agentic nature really shines.

6. Custom Instructions for Consistent Output

You can teach Copilot CLI your project’s conventions by placing instruction files in your repository:

  • .github/copilot-instructions.md — project-wide rules
  • .github/instructions/**/*.instructions.md — scoped instructions
  • CLAUDE.md, GEMINI.md, AGENTS.md — model-specific guidance

For this blog, I have instructions that enforce conventional commits, require a build check before committing, and describe the project structure. Every task Copilot performs follows these rules automatically.

The Modes

Copilot CLI has different interaction modes you can cycle through with Shift+Tab:

  • Interactive mode — the default, step-by-step collaboration where it asks before acting
  • Plan mode — it creates a detailed implementation plan before writing any code
  • Autopilot mode — the agent keeps working autonomously until the task is complete

Plan mode is great for larger tasks where you want to review the approach before any files are touched. Autopilot mode is for when you trust the agent and just want it to get things done — it minimizes the back-and-forth and powers through until it’s finished.

Things to Keep in Mind

It’s not perfect. Sometimes it over-engineers a solution when a simple one would do. Sometimes it needs a nudge in the right direction. But the feedback loop is fast — you can interrupt, redirect, and iterate in real time.

The /compact command is useful when conversations get long — it summarizes the history to free up context without losing important details.

Getting Started

Installation is straightforward:

# macOS / Linux
brew install copilot-cli

# Windows
winget install GitHub.Copilot

# Or via npm
npm install -g @github/copilot

Launch it with copilot, authenticate with your GitHub account, and you’re ready to go. You need an active Copilot subscription.

Final Thoughts

The terminal is where I spend most of my development time. Having an AI agent that understands my codebase, follows my conventions, and can interact with GitHub — all without leaving the terminal — has genuinely changed how I work. It’s not about replacing thinking. It’s about removing the friction between having an idea and seeing it implemented.

Give it a try. And if you discover the Konami code on this website, you’ll know who helped build it.

ACCESS GRANTED
root@kaya:~# cat /etc/motd
  ██╗  ██╗ █████╗ ██╗   ██╗ █████╗
  ██║ ██╔╝██╔══██╗╚██╗ ██╔╝██╔══██╗
  █████╔╝ ███████║ ╚████╔╝ ███████║
  ██╔═██╗ ██╔══██║  ╚██╔╝  ██╔══██║
  ██║  ██╗██║  ██║   ██║   ██║  ██║
  ╚═╝  ╚═╝╚═╝  ╚═╝   ╚═╝   ╚═╝  ╚═╝
root@kaya:~# echo $WISDOM
root@kaya:~#