Install and use AI assistants directly from your terminal command line.
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:
nodejs.org or via your package manager.winget is available (it ships with Windows 11 / recent Windows 10).winget install GitHub.Copilot
# Or for pre-release:
winget install GitHub.Copilot.PrereleaseOn macOS/Linux, install it with npm instead:
npm install -g @github/copilotmkdir TerminalProjects
cd TerminalProjects
copilotThe 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:
npm install -g @google/gemini-climkdir TerminalProjects
cd TerminalProjects
geminiOn 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:
irm https://code.kimi.com/install.ps1 | iexOn macOS/Linux, the equivalent is:
curl -fsSL https://code.kimi.com/install.sh | bashmkdir TerminalProjects
cd TerminalProjects
kimiKimi is known for long-context conversations, strong Chinese-language support, and creative writing — but it handles general coding and research tasks just as well.
Once all three are installed, practise these five tasks — they cover 80% of everyday usage:
practice/ folder for experiments. If a generated script misbehaves, it's confined to practice and can't touch your real projects.# 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 statusEvery 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 itselfFun 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.
The complete core guide: prerequisites, then step-by-step installs and first sessions for Copilot CLI, Gemini CLI, and Kimi CLI.
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.
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"cat bug.log | copilot "find the root cause".Raw prompts work, but context makes them 10x better. Learn your tool's context flags:
--read <file> attaches a file, -c continues an existing session, and you can reference files by typing @file inside the chat.--read-only-tools, -p "prompt" for one-shot, and --extensions to enable bash or web tools.| Tool | Auth | Free Tier | Paid Upgrade |
|---|---|---|---|
| Copilot CLI | GitHub account | Free with Student Pack / Copilot subscription | $10/month individual |
| Gemini CLI | Google account | Free quota with Google login | Google AI Pro plan |
| Kimi CLI | Phone / Moonshot account | Free tier with usage caps | Moonshot subscription |
The quality of AI output tracks the quality of the prompt. Compare:
| Weak prompt | Strong 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." |
Copilot CLI and Gemini CLI can create, edit, and delete files in your current directory. Protect yourself:
pwd before starting — the tools act on whatever folder you're in.git init + commit before letting the AI make changes, so you can git checkout . to undo everything.~/ai-experiments) for anything experimental.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:
~/.config/github-copilot/ — session tokens and settings~/.gemini/ — settings.json, login state, and tool flags~/.kimi/ — account and preferencesIf 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.
# 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 itA realistic flow on a school project:
gemini in your project folder and ask it to scaffold the structure: "create a Flask app with routes for /data and /summary".copilot auth status.pwd first, or you'll ask the AI to edit files in the wrong project.Everything in Basic + interactive vs one-shot modes, context flags, the authentication & pricing table, a real Python project workflow, and the common-mistakes guide.
copilot "explain this file line by line, assuming I'm new to Python" --read main.pygemini -p "write pytest tests for functions in utils.py — include edge
cases for empty input, None, and large values. Save as test_utils.py."cat server.log | kimi -q "find the first root-cause error and give the
exact fix. Ignore warnings."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"copilot "convert data.json into data.csv preserving all fields.
Handle nested objects by flattening keys with underscores.
Write the result to data.csv."kimi -q "read utils.py and write a README.md section explaining
each public function, its parameters, and a one-line usage example."Here's how a KNUST student might combine these tools on a group project:
gemini, attach the repo, and ask it to summarise what changed since yesterday's commit.copilot to write the validation function your teammate assigned you, then run pytest to verify.cat server.log | copilot "find the root cause".kimi to draft the project README in your own tone, then commit everything with clear messages.node --version returns v18 or highercopilot --version workscopilot auth status shows activegemini --version worksgemini -p "hi" replieskimi --version works-p/-q prompt successfully--read/@filewinget install GitHub.Copilot and check "Add to PATH" prompts.npm install -g npm) and retry; some errors are stale-cache issues — npm cache clean --force first.copilot auth status and your GitHub plan.irm ... | iex pattern needs Execution Policy permission: run Set-ExecutionPolicy RemoteSigned -Scope CurrentUser first.gemini -p "..." > result.md.pwd) and use Git (git status) before accepting multi-file changes.--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.--extensions) and make sure your Google login is active; research features require it.ls or a find command before acting; hallucinated paths are rarer but happen.Watch these tutorials to go deeper, and keep these resources handy for the full workflow:
Everything in Basic + Advanced + 4 ready-to-use command recipes, a 10-point setup checklist, and troubleshooting for the 6 most common CLI problems.
Payments are processed securely by Paystack. Your card details never reach our servers.
Lesson access unlocked. Check your email for confirmation.