🤖 GitHub Copilot

AI pair programming in the terminal — for Linux SysAdmins

aider curl fabric fzf gh Copilot jq ollama ripgrep sgpt tmux

What Is GitHub Copilot?

GitHub Copilot is an AI-powered coding assistant developed by GitHub and OpenAI. It was trained on billions of lines of public code and can suggest complete functions, scripts, and command sequences as you type. Think of it as autocomplete that actually understands what you're trying to accomplish.

For a Linux SysAdmin, Copilot is most immediately useful in two places: inside your editor when writing bash scripts, Python automation, or configuration files — and at the command line via GitHub Copilot in the CLI, which lets you ask natural-language questions and get shell commands back.

"You don't have to remember every flag. You describe what you want, and Copilot gives you a starting point. Your 40 years of Unix judgment tells you whether it's right."

💰 Pricing & Access

Copilot is a subscription service from GitHub (owned by Microsoft). As of early 2026:

Note for BU staff: Check with IT Procurement before subscribing individually. Enterprise licensing may be available or pending through GitHub Education agreements.

🔧 Installation

Copilot CLI

The command-line interface component is what matters most for SysAdmins who live in the terminal. It requires the GitHub CLI (gh) as a base.

Step 1 — Install the GitHub CLI:

# RHEL/CentOS/Rocky (dnf) sudo dnf install gh # Debian/Ubuntu (apt) sudo apt install gh # Or install from GitHub releases if not in your distro repos: # https://github.com/cli/cli/releases

Step 2 — Authenticate with GitHub:

gh auth login

Follow the prompts — browser or token-based auth both work. Token auth is better for headless servers.

Step 3 — Install the Copilot CLI extension:

gh extension install github/gh-copilot

Step 4 — Verify:

gh copilot --help

Editor Plugins

If you use VS Code, Neovim, or JetBrains IDEs, Copilot plugins are available from their respective marketplaces. For pure terminal work, the CLI is sufficient.

Tip: On RHEL-family systems, gh may not be in the default repos. Add the GitHub CLI repo first:

sudo dnf config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo

💻 Basic Usage — CLI

Copilot CLI has two main subcommands: suggest and explain.

gh copilot suggest

Describe what you want in plain English. Copilot returns a shell command.

gh copilot suggest "find all files larger than 500MB modified in the last 7 days"

Copilot will ask whether you want a shell command, gh command, or git command, then return something like:

find / -type f -size +500M -mtime -7 2>/dev/null

You can then copy it, run it, or ask Copilot to revise it.

gh copilot explain

Paste a command you found (or one Copilot gave you) and get a plain-English explanation:

gh copilot explain "awk -F: '$3 >= 1000 {print $1}' /etc/passwd"

Copilot will walk through each part of the command. Useful for onboarding junior staff or verifying what a script is actually doing before you run it as root.

Aliases for speed

These get long fast. Add aliases to your .bashrc or .bash_profile:

alias ghcs='gh copilot suggest' alias ghce='gh copilot explain'

Then just:

ghcs "show disk usage by directory under /var, sorted largest first"

📝 Bash Script Generation

Beyond one-liners, Copilot shines when writing bash scripts in an editor. In VS Code with the Copilot plugin active, you write a comment describing what the function should do — Copilot suggests the implementation.

Example workflow in a script:

#!/bin/bash # Function: check if a port is open on a remote host, retry up to 5 times # with a 10-second delay between attempts, exit 0 on success, exit 1 on failure # -- Copilot will suggest the function body here as you pause --

This works especially well for:

Always review generated code before running it with elevated privileges. Copilot is confident even when wrong. Your SysAdmin judgment is the last line of defense — treat Copilot output the way you'd treat code from a capable junior admin: review it, don't just trust it.

✅ Where Copilot Helps SysAdmins

Strong Use Cases

  • Bash script generation and debugging
  • One-liner construction (find, awk, sed, grep)
  • Explaining inherited or legacy scripts
  • Cron job and systemd unit file templates
  • Python automation scripts
  • Ansible playbook stubs
  • Regular expression construction
  • Log parsing and analysis scripts

Weaker Use Cases

  • Site-specific configurations (it doesn't know your environment)
  • Cutting-edge tools released after its training cutoff
  • Security-sensitive decisions (always verify independently)
  • Anything requiring institutional context
  • Complex multi-system orchestration without guidance

🔒 Privacy & Security Considerations

When you use Copilot, your code and prompts are sent to GitHub's servers. For institutional use, this matters:

Binghamton University context: Any tool that processes or transmits university data is subject to BU's acceptable use and data classification policies. When in doubt, use Copilot with synthetic or anonymized data during development.

📊 Craig's Take — After 40 Years at the CLI

The honest assessment from someone who has been writing shell scripts since 1986:

Copilot CLI (gh copilot suggest) is genuinely useful for commands you don't run often enough to have memorized — obscure find predicates, rsync flag combinations, openssl one-liners. It's faster than a man page for "I know what I want, I just need the syntax."

For script generation, it's a competent first draft. Expect to edit it. The generated code tends to be correct in structure but generic — it won't know your shop's conventions, your logging format, or your error handling preferences. That's fine. A good first draft is still valuable.

The explain subcommand is underrated. Pasting a complex pipeline and getting a clear explanation is useful even for experienced admins — and invaluable for documentation and knowledge transfer.

"The efficiency gain is real. The judgment still has to come from you."

🔗 Resources