GitHub CLI: How to Supercharge Your Terminal with Copilot
The legacy gh-copilot extension is retired and no longer functions. This guide provides the three steps to install and authenticate the new standalone GitHub Copilot CLI, helping developers run multi-step agentic workflows directly from their command line.
The transition from shell suggestions to terminal agents
Two coding tools pointing at the same codebase without coordination will create merge conflicts. The fix is a persistent storage space where outputs are versioned. As developers move from graphical code editors to running agentic workflows directly in their terminals, maintaining this persistent storage becomes a primary constraint. This shift is accelerated by the development of command line tools that do not just suggest commands but actively execute multi-step plans.
The terminal has evolved from a passive command line interface into a live environment where developers run autonomous coding agents. At the center of this change is the github cli, an open-source tool that attracts about 14800 monthly searches from developers looking to simplify their terminal workflows. In recent updates, the utility of the github cli has expanded through integration with GitHub Copilot, allowing developers to generate, explain, and run code directly from the prompt. However, many developers are still running outdated configurations that cause errors during setup. This points to a shift in how these terminal assistants are distributed.
Related guides
- How to Connect Devin AI to GitHubDevin AI's GitHub integration is a full GitHub App install with nine read scopes and eight read-write scopes, not a...
- How to Configure the Base44 GitHub App IntegrationSetting up the Base44 GitHub App integration enables teams to sync visual configurations to a repository. This guide...
- GitHub Desktop vs. GitHub Copilot CLI for Git Commits: GUI vs. Terminal WorkflowComparing GitHub Desktop and GitHub Copilot CLI for Git commits helps developers choose between a graphical, visual...
- How to Connect and Use Google Drive with GitHub CopilotStandard GitHub Copilot configurations lack a native connector for Google Drive, requiring developers to copy context...
- How to Setup and Use GitHub Copilot in IntelliJ IDEAThe official GitHub Copilot plugin integrates AI-powered completions directly into JetBrains IntelliJ IDEA, but most...
- How to Get GitHub Copilot for Free: All Eligible Plans and LimitsOn June 1, 2026, GitHub officially transitioned its Copilot ecosystem to a usage-based billing model, introducing...
More on this subject: GitHub Copilot (130 guides)
The deprecation gap: Legacy extensions vs. standalone CLI
Many developers still attempt to install Copilot using old guides that recommend the retired gh-copilot extension. This extension, which was formerly installed via the command gh extension install github/gh-copilot, was officially deprecated and ceased functioning on October 25, 2025, per the official deprecation announcement. It has been replaced by the new GitHub Copilot CLI, which is a standalone tool designed to run local agentic terminal sessions.
The deprecation of the old extension marks the transition from one-shot suggestions to stateful, multi-step execution. While the legacy extension could only suggest or explain single commands, the new GitHub Copilot CLI can analyze requests, draft execution plans, run tests, and iterate until the task is complete. This architectural change means the tool no longer lives as a simple GitHub CLI extension, but rather as a standalone binary launched with the copilot command. Outdated tutorials still cause confusion, prompting developers to search for solutions when their legacy commands fail to run.
How to Install and Authenticate the GitHub Copilot CLI
Setting up the modern terminal assistant requires three steps to ensure you are running the current agentic version rather than the deprecated extension. The latest versions of the GitHub CLI (v2.49.0 or higher) include a wrapper launcher that manages the installation of the standalone tool automatically.
First, upgrade your local installation of the GitHub CLI to the latest version. On macOS, you can use Homebrew:
brew upgrade gh
Second, authenticate the GitHub CLI with your GitHub account containing an active Copilot subscription. This step requires interactive authentication to configure the necessary permissions:
gh auth login
Third, run the Copilot subcommand. If you are running the command for the first time, the GitHub CLI wrapper launcher will detect that the standalone CLI is missing and will prompt you to install it:
gh copilot explain "lsof -i :8080"
Alternatively, you can install the standalone package directly using the Node package manager:
npm install -g @github/copilot
Once installed, you can start an interactive session by running the copilot binary directly. The new interface allows you to query commands, debug scripts, and execute terminal actions. If your organization uses policy controls, your administrator must enable access to the terminal assistant on the GitHub organization policies page before you can authenticate.
How to configure shell aliases for faster execution
Running full command strings like gh copilot suggest or gh copilot explain every time you need assistance adds unnecessary keystrokes to your development loop. To accelerate your loop, the CLI utility includes a built-in alias generator that configures shortcut commands for your specific shell, whether you use Bash, Zsh, or PowerShell.
You can generate the required configuration code by running the alias generation command in your terminal:
gh copilot alias --bash
For Zsh users, replace the flag with --zsh. The output provides a shell function that you can append to your configuration file, such as ~/.bashrc or ~/.zshrc. Once you source your configuration file, you can access the Copilot suggested experience using two shortcuts:
ghcs: Shortcut for suggestion mode, which provides command recommendations based on your natural language prompt.ghce: Shortcut for explanation mode, which breaks down complex shell commands and flags into plain English.
The ghcs shortcut also allows you to execute the suggested command immediately after it is generated. The CLI prompt displays options to execute the command, copy it to the clipboard, or revise the query. If you select execution, the shell runs the command directly in your active terminal, which eliminates the need for manual copying.
Running agentic workflows in the terminal
The GitHub Copilot CLI reached general availability on February 25, 2026, and provides a full agentic development environment, as documented in the official GitHub Changelog. Unlike static code editors, this terminal assistant can write files, inspect logs, and run local compilers with your permission.
Within an active terminal session, you can run several specialized commands to guide the AI. The /plan command initializes a structured mode where Copilot analyzes your request and drafts an implementation plan before writing any code. This allows you to review proposed changes, inspect tool calls, and approve modifications on a case-by-case basis. You can also use the /model command to switch between different models to find the most efficient one for your task.
Security controls require your explicit approval before the agent runs any destructive command or modifies system files. For example, if Copilot suggests executing a script or editing a configuration file, it prompts you to confirm the action. This interactive human-in-the-loop validation prevents runaway commands from executing without oversight, keeping your local environment stable.
How to manage multi-session agent tasks in the terminal
As development tasks grow more complex, running a single one-shot terminal command is often insufficient. Real-world tasks, such as refactoring a legacy code module or running a suite of unit tests, require stateful agent sessions that span several minutes or hours. In recent updates to the GitHub CLI, developers can initialize and manage these persistent agent sessions directly from the command line.
To start a long-running session, you can initialize a task container. This container tracks the agent's progress, records tool execution logs, and maintains repository context across runs. For instance, if you need to run an automated check on a pull request, you can launch the session in the background:
copilot task start "Run code quality check on pull request 42"
The background agent inspects the file diffs, plans the execution path, runs your local testing scripts, and writes its findings back to the task container. If the task is interrupted, you can resume the session using the specific session ID:
copilot task resume --id "session-9821"
Because these sessions run locally, keeping track of task history across a distributed team is difficult if developers work in isolation. Saving these terminal session logs, configuration files, and build outputs in a shared workspace ensures that the entire team has visibility into the agent's actions.
Coordinate AI outputs across your development team
Deploy a persistent, shared workspace for your terminal agents. Store logs, track version history, and hand off code securely. Start your 14-day free trial.
Coordinating terminal agents with persistent workspaces
When multiple developers run local terminal agents, coordinating their work becomes a challenge. Since local terminal sessions do not share state, two agents running in separate environments can write conflicting code, leading to merge conflicts. To solve this, teams need a persistent, shared workspace where agents and humans can collaborate on the same files.
Fastio provides this shared state layer for agentic development. Instead of letting terminal session logs and script outputs disappear when you close your terminal, you can save them in a secure, persistent Fastio workspace. Fastio offers a remote Model Context Protocol (MCP) server at https://mcp.fast.io/mcp/code that exposes a consolidated MCP toolset. Your local terminal agents can use these tools to write logs, upload build outputs, and sync configuration files directly to the shared workspace.
This persistent workspace enables a structured handoff workflow between agents and humans. Humans can review agent modifications through Collaborative Notes, which support real-time co-editing for both people and agents. All file changes keep a full version history, allowing developers to inspect or restore previous versions at any time. Furthermore, all human and agent actions are recorded in an append-only audit log, creating an immutable record of the project. If the human-in-the-loop review is complete, the developer can initiate an ownership transfer, handing the workspace off to another team member or client.
Fastio includes seats and storage with each plan, while credits meter AI work only. Organizations can test this agent-coordination workflow by starting a 14-day free trial, which requires a credit card. Subscriptions begin with the Fastio Starter plan at $29 per month, which includes 1 TB of storage and 300000 credits, as outlined on the Fastio pricing page. For larger teams, the Business plan is available at $49.99 per month, while the Enterprise plan is priced at $199.99 per month.
Sources
References used to verify factual claims in this guide.
-
The legacy gh-copilot extension stopped functioning on October 25, 2025.
-
GitHub Copilot CLI became generally available for all subscribers on February 25, 2026.
-
The github cli has about 14800 monthly searches (DataForSEO keyword metrics).
Frequently Asked Questions
Why does the command gh extension install github/gh-copilot return an error?
The command fails because the legacy gh-copilot extension stopped functioning on October 25, 2025. It has been replaced by the standalone GitHub Copilot CLI. To use Copilot in your terminal, upgrade your GitHub CLI using brew upgrade gh and run gh copilot explain, which will initialize the installation of the standalone tool.
How do I authenticate the new GitHub Copilot CLI in my terminal?
You can authenticate the tool by running the command gh auth login. This starts an interactive authentication flow in your browser. Ensure your GitHub account has an active Copilot subscription, and ask your organization administrator to enable terminal access on the organization policies page if you are using an enterprise account.
What is the difference between Plan mode and Autopilot mode in the terminal?
Plan mode (initialized via /plan) generates a structured list of proposed file changes and tool executions for your review before writing any code, keeping you in control. Autopilot mode allows the agent to execute commands and iterate on tasks without stopping for approval. Autopilot mode requires explicit enablement and should be used with caution.
Related Resources
Coordinate AI outputs across your development team
Deploy a persistent, shared workspace for your terminal agents. Store logs, track version history, and hand off code securely. Start your 14-day free trial.