Home›Developer Tools›Terminal AI: Copilot CLI, Gemini CLI & Kimi
Developer Tools

Terminal AI: Copilot CLI, Gemini CLI & Kimi

Install and use AI assistants directly from your terminal command line.

⏱️ 25 min
📊 Advanced
💰 from ₵50
Basic
₵50
Core guide — the essential how-to
  • Prerequisites & setup
  • GitHub Copilot CLI
  • Gemini CLI
  • Kimi CLI
  • First tasks cheat sheet
Premium
₵200
Everything in Advanced + the complete bonus pack
  • Prerequisites & setup
  • GitHub Copilot CLI
  • Gemini CLI
  • Kimi CLI
  • First tasks cheat sheet
  • When to use each tool
  • Interactive vs one-shot mode
  • Project context flags
  • Auth & free plans
  • Filesystem safety
  • Python project example
  • 6 command recipes
  • Real day-in-the-terminal workflow
  • Env/config file map
  • Checklist & FAQ
  • Video library & resource hub
Table of Contents
Watch: Copilot in VS Code

What is Terminal AI?

Terminal AI tools let you interact with AI models directly from your command line. No browser, no GUI — just type your request and get AI-powered assistance for coding, file management, and research. They shine for quick tasks while you're already in the terminal, on SSH servers, and in lightweight environments. This lesson covers the three biggest players — GitHub Copilot CLI, Gemini CLI, and Kimi CLI.

This lesson is organized into 3 tiers so you only pay for the depth you need:

⚡ BasicCore guide: install & run
₵50

Before You Start: Prerequisites

  • Node.js (v18+) — needed for Gemini CLI and the npm-based installers. Install from nodejs.org or via your package manager.
  • Windows — use Windows Terminal (better fonts and colours) and check that winget is available (it ships with Windows 11 / recent Windows 10).
  • macOS/Linux — Homebrew or your distro's package manager for prerequisites.
  • A GitHub account (for Copilot CLI) and a Google account (for Gemini CLI).

1. GitHub Copilot CLI

Installation

winget install GitHub.Copilot
# Or for pre-release:
winget install GitHub.Copilot.Prerelease

On macOS/Linux, install it with npm instead:

npm install -g @github/copilot

Usage

mkdir TerminalProjects
cd TerminalProjects
copilot

The first time you run copilot you'll sign in to GitHub (a code appears — open the URL in your browser, paste the code, authorise). Once running, you can ask Copilot to:

  • Generate code from descriptions
  • Explain existing code
  • Debug errors
  • Write tests
  • Create entire files and projects

2. Gemini CLI

Installation

npm install -g @google/gemini-cli

Usage

mkdir TerminalProjects
cd TerminalProjects
gemini

On first run you'll be asked how you want to sign in — choose Google account login for free usage (the same account you use for Gmail). Gemini CLI can:

  • Write and explain code
  • Search through files
  • Generate documentation
  • Help with research by querying the web

3. Kimi CLI

Installation (Windows PowerShell)

irm https://code.kimi.com/install.ps1 | iex

On macOS/Linux, the equivalent is:

curl -fsSL https://code.kimi.com/install.sh | bash

Usage

mkdir TerminalProjects
cd TerminalProjects
kimi

Kimi is known for long-context conversations, strong Chinese-language support, and creative writing — but it handles general coding and research tasks just as well.

💡 Tip: Terminal AI tools are great for quick coding tasks while you're already working in the terminal. For longer, more complex tasks, a GUI editor like Cursor or VS Code is usually better.

Common Tasks to Try First

Once all three are installed, practise these five tasks — they cover 80% of everyday usage:

  • Explain — point a tool at a file you don't understand and ask for a plain-English walkthrough.
  • Generate — ask for a small script (CSV reader, URL checker, file renamer) and run it.
  • Debug — paste a traceback and ask for the root cause and minimal fix.
  • Refactor — ask to simplify a messy function without changing behaviour.
  • Research — use Gemini CLI's web tools to answer a question with sources.
💡 Tip: Keep a practice/ folder for experiments. If a generated script misbehaves, it's confined to practice and can't touch your real projects.

Command Cheat Sheet

# Check versions after installing
copilot --version
gemini --version
kimi --version

# Start an interactive session in the current folder
copilot
gemini
kimi

# One-shot prompts
gemini -p "explain the contents of this repo"
copilot "summarise what main.py does" --read main.py

# Authentication status
copilot auth status

Getting Help When You're Stuck

Every CLI ships its own help system — use it before googling:

copilot --help
gemini --help
kimi --help

# Detailed help for a specific subcommand
gemini -p "how do I use the --read flag" # just ask the AI itself

Fun fact: the fastest help is often asking the tool itself — "what flags do you support for one-shot mode?" works in every interactive session.

And when all else fails, --version plus a quick web search for that exact version usually surfaces the right answer in minutes.

💡 Tip: If a command errors, paste the exact error message into the tool's chat rather than describing it — "command not found: gemini" contains more truth than any paraphrase.

Unlock Basic — ₵50

The complete core guide: prerequisites, then step-by-step installs and first sessions for Copilot CLI, Gemini CLI, and Kimi CLI.

🚀 AdvancedDeep dive: modes, flags & workflows
₵100

When to Use Each Tool

  • Copilot CLI: Best for generating code snippets and quick explanations
  • Gemini CLI: Best for research-heavy tasks and web-connected queries
  • Kimi CLI: Best for Chinese-language support and creative writing
  • OpenCode: Best for multi-file project work in the terminal

Mixing them is a feature, not a fallback. A common winning combo on a real project: use Gemini CLI to research your approach and plan the architecture, Copilot CLI to write the code files, and Kimi for the long-context README and docs. Each tool bills you nothing extra (on free tiers), so picking the best model per task costs you zero cedis.

💡 Tip: Once a task spans more than three files or needs a GUI to preview, switch to a code editor (VS Code with Copilot) — the terminal tools hand off naturally by describing what you've done so far.

Interactive vs One-Shot Mode

All three CLIs support two styles of use. Interactive mode (just run copilot, gemini, or kimi) gives you a chat REPL with memory of the conversation. One-shot mode pipes a prompt directly and exits with the answer — perfect for automation:

# Copilot CLI
copilot "explain what this function does" --read README.md

# Gemini CLI
gemini -p "generate a Python script that reads a CSV and prints summary stats"

# Kimi CLI
kimi -q "refactor this for readability"
💡 Tip: One-shot mode is perfect for scripting — you can pipe your prompt, capture the output, and even chain tools: cat bug.log | copilot "find the root cause".

Giving the AI Project Context

Raw prompts work, but context makes them 10x better. Learn your tool's context flags:

  • Copilot CLI: --read <file> attaches a file, -c continues an existing session, and you can reference files by typing @file inside the chat.
  • Gemini CLI: --read-only-tools, -p "prompt" for one-shot, and --extensions to enable bash or web tools.
  • Kimi CLI: long context window — paste large files or multiple files directly into the conversation.

Authentication & Plans (What's Free)

ToolAuthFree TierPaid Upgrade
Copilot CLIGitHub accountFree with Student Pack / Copilot subscription$10/month individual
Gemini CLIGoogle accountFree quota with Google loginGoogle AI Pro plan
Kimi CLIPhone / Moonshot accountFree tier with usage capsMoonshot subscription
💡 Tip: For KNUST students the cheapest setup is: Gemini CLI with your free Google account for research, and Copilot CLI with your GitHub Student Pack for code. Both at ₵0.

Prompting Guide: Good vs Bad

The quality of AI output tracks the quality of the prompt. Compare:

Weak promptStrong prompt
"Fix this code""The function below returns NaN for empty input. Fix it and add a guard clause with a test."
"Write a script""Write a Python script that reads data.csv, skips rows with missing values, and prints the average per column. Use argparse for the path."
"Explain the project""Explain this repo's architecture in 5 bullet points, naming the key modules and how data flows between them."
💡 Tip: The formula is Goal → Constraints → Format. Say what you want, what it must not do, and how to present the answer (table, code block, 3 bullets).

Filesystem Safety With Agentic Tools

Copilot CLI and Gemini CLI can create, edit, and delete files in your current directory. Protect yourself:

  • Always run pwd before starting — the tools act on whatever folder you're in.
  • Use git init + commit before letting the AI make changes, so you can git checkout . to undo everything.
  • Prefer a dedicated work folder (~/ai-experiments) for anything experimental.
  • Review the proposed diff before accepting multi-file changes.
💡 Tip: Treat the terminal AI like a junior dev: review its work, keep it in a sandbox, and never hand it production credentials or secrets.

Environment & Configuration Files

Each tool stores its config in your home folder. You rarely edit these by hand, but knowing where they live helps when uninstalling or debugging auth:

  • Copilot CLI: ~/.config/github-copilot/ — session tokens and settings
  • Gemini CLI: ~/.gemini/ — settings.json, login state, and tool flags
  • Kimi CLI: ~/.kimi/ — account and preferences

If authentication breaks after an update, delete the relevant folder (you'll re-login) rather than reinstalling from scratch — it's faster and fixes most token issues.

Practical Example: Setting Up a Python Project

# From terminal, ask Copilot:
# "Create a Python script that reads a CSV file and generates summary statistics"

# Or ask Gemini:
# "Help me set up a Flask API for my research data with these endpoints..."

# The AI generates the code, you review and run it

A realistic flow on a school project:

  1. Run gemini in your project folder and ask it to scaffold the structure: "create a Flask app with routes for /data and /summary".
  2. Ask it to write the first file, then review the diff before it applies changes.
  3. Run the app, hit a bug, and paste the traceback: "here's the error — what's wrong and what's the minimal fix?"

Common Mistakes (and How to Avoid Them)

  • Running AI-generated code without review — always review AI-generated code before running it. Terminal AI tools can generate code with errors or security issues. Treat the output as a starting point, not a finished product.
  • No context — asking vague questions gives vague answers. Attach the file or error message every time.
  • Forgetting authentication — Copilot CLI silently degrades without a valid subscription. Verify with copilot auth status.
  • Using it inside the wrong folder — CLIs act on your current directory. Run pwd first, or you'll ask the AI to edit files in the wrong project.
  • Over-relying on one tool — each CLI has strengths; mix them (Gemini for research, Copilot for code) instead of forcing one.
⚠️ Important: Always review AI-generated code before running it. Terminal AI tools can generate code with errors or security issues. Treat the output as a starting point, not a finished product.

Unlock Advanced — ₵100

Everything in Basic + interactive vs one-shot modes, context flags, the authentication & pricing table, a real Python project workflow, and the common-mistakes guide.

👑 PremiumBonus pack: recipes, checklist & troubleshooting
₵200

Ready-to-Use Command Recipes

Recipe 1: Explain a File in Plain English

copilot "explain this file line by line, assuming I'm new to Python" --read main.py

Recipe 2: Write a Pytest Suite

gemini -p "write pytest tests for functions in utils.py — include edge
cases for empty input, None, and large values. Save as test_utils.py."

Recipe 3: Debug From a Log

cat server.log | kimi -q "find the first root-cause error and give the
exact fix. Ignore warnings."

Recipe 4: Scaffold a Project

gemini -p "create a project structure for a Flask REST API with:
- app/ with __init__.py, routes/, models/
- a requirements.txt
- a README with run instructions"

Recipe 5: Convert Between Data Formats

copilot "convert data.json into data.csv preserving all fields.
Handle nested objects by flattening keys with underscores.
Write the result to data.csv."

Recipe 6: Generate Documentation From Code

kimi -q "read utils.py and write a README.md section explaining
each public function, its parameters, and a one-line usage example."

A Real Day in the Terminal (Workflow Story)

Here's how a KNUST student might combine these tools on a group project:

  1. Morning: run gemini, attach the repo, and ask it to summarise what changed since yesterday's commit.
  2. Mid-morning: ask copilot to write the validation function your teammate assigned you, then run pytest to verify.
  3. Afternoon: hit a deployment error — pipe cat server.log | copilot "find the root cause".
  4. Evening: use kimi to draft the project README in your own tone, then commit everything with clear messages.
💡 Tip: Batch your prompts: describe the whole task at once ("do X, then Y, then write a summary") and let the tool plan the steps. You'll use far fewer sessions.

The Complete Setup Checklist

  • Node.js installed — node --version returns v18 or higher
  • Copilot CLI installed — copilot --version works
  • Copilot CLI authenticated — copilot auth status shows active
  • Gemini CLI installed — gemini --version works
  • Gemini CLI signed in — Google login completed, gemini -p "hi" replies
  • Kimi CLI installed — kimi --version works
  • One-shot mode tested — ran a -p/-q prompt successfully
  • Context flags tested — attached a real file with --read/@file
  • Project workflow practised — scaffolded and ran one real script
  • Review habit formed — checked a generated file before running it

Troubleshooting FAQ

  • "copilot: command not found" — the installer didn't add to PATH. Restart your terminal, or on Windows re-run winget install GitHub.Copilot and check "Add to PATH" prompts.
  • Gemini CLI fails with npm errors — update npm (npm install -g npm) and retry; some errors are stale-cache issues — npm cache clean --force first.
  • Copilot says "not authorized" — your subscription expired or the Student Pack lapsed. Check copilot auth status and your GitHub plan.
  • Kimi PowerShell install blocked — the irm ... | iex pattern needs Execution Policy permission: run Set-ExecutionPolicy RemoteSigned -Scope CurrentUser first.
  • Output is cut off — most CLIs truncate long output. Ask for a summary, or write output to a file: gemini -p "..." > result.md.
  • AI edited the wrong file — always check your working directory (pwd) and use Git (git status) before accepting multi-file changes.
  • Copilot ignores my --read file? — Use the interactive mode and reference it with @filename in the chat; one-shot flags can be skipped if the file is too large.
  • Gemini CLI web tools don't work? — Enable the web extension in its config (--extensions) and make sure your Google login is active; research features require it.
  • Output contains made-up file paths? — Ask the tool to verify with ls or a find command before acting; hallucinated paths are rarer but happen.

📺 Video Library & Resources

Watch these tutorials to go deeper, and keep these resources handy for the full workflow:

Watch: Getting started with GitHub Copilot CLI (official)

🔗 Key Resources

Unlock Premium — ₵200

Everything in Basic + Advanced + 4 ready-to-use command recipes, a 10-point setup checklist, and troubleshooting for the 6 most common CLI problems.