UNIT 04~5 hrs

Agents in the Terminal

Install a terminal agent, give it persistent context, and wire it to your data.

Before this:02 · Context Is the Product

A chat window can only be wrong at you; a terminal agent can be wrong at your filesystem. This is the point where the abstraction gets hands: it reads your files, runs your commands, and does real multi-step work, which is exactly why it is the first tool in this track that can also do real damage. The power and the danger are the same feature, so this unit teaches them together.

Learning outcomes

  • Install and authenticate gemini-cli without an API key.
  • Write a context file the CLI reads automatically on every session.
  • Register an MCP server, verify it loaded, and explain what it added.
  • Describe the agent loop — decide, act, observe, decide again — without hand-waving.
  • State your rate limits and what they mean for a long agentic task.

What you already have

gemini-cli — free, open source, running on Gemini 3 models with a 1M token context window. It reads files, runs shell commands, searches the web, and works through multi-step coding tasks without you switching windows.

  • Install: npm install -g @google/gemini-cli, then gemini. Sign in with your Google account on first launch. No API key for the free tier.
  • Free tier limits: 60 requests/minute, 1,000/day. That is a real constraint on agentic workflows, and it is worth knowing before a long task stalls halfway.
  • Web grounding via Google Search pulls current information into any response.
  • VS Code integration — run gemini in the integrated terminal and it auto-detects the IDE, gaining awareness of your open files.

MCP servers extend the CLI with external tools. Install with npx add-mcp; list what is active with /mcp inside the CLI.

MCP server Category What it does
GitHub Source control Review PRs, track issues, analyse repo history
BigQuery Database Query schemas and reason over live data in natural language
Firecrawl Web scraper Scrape any URL into clean text for literature reviews
Hugging Face AI hub Browse models, datasets, and papers from the terminal
Notion Knowledge base Access team specs, roadmaps, and decision docs

Concept

Give an agent a filesystem and a shell and it stops making suggestions and starts making changes, which moves your job from typing to reviewing. MCP is the same bet at the protocol level: learn one way of wiring tools to agents and it carries across every runtime in this unit, instead of one integration per product.

§3.2 (Coding agents: Claude Code, OpenClaude, others) is the landscape. §3.1 (IDEs and editors) covers where these things live, and §3.6 (CrewAI for agents) is where multi-agent orchestration starts.

When you outgrow a single terminal agent, /adapters covers nine frameworks — CrewAI, LangGraph, and LlamaIndex are the three most likely to matter for research work.

Paired instantiation

Portable idea Google (what you have) Internet Menace (the method)
An agent with a filesystem and a shell gemini-cli Claude Code — §3.2
Persistent project context GEMINI.md CLAUDE.md/templates/claude-md
A protocol for adding tools MCP servers via npx add-mcp MCP — the same protocol, either runtime
Orchestrating more than one agent Antigravity's five parallel agents §3.6, /adapters

Lab

  1. Run npm install -g @google/gemini-cli, then gemini. Sign in with your Google account.
  2. In a real project directory, write a GEMINI.md — reuse the one from Unit 02 if it fits.
  3. Ask the agent something that requires reading your files. Confirm it did not ask you to paste anything.
  4. Register the GitHub MCP server with npx add-mcp. Run /mcp and confirm it is listed.
  5. Register the BigQuery MCP server the same way. Verify with /mcp.
  6. Pick one of BigQuery's public datasets and ask a question in natural language. Read the SQL it generated before you trust the answer.
  7. Give the agent a task that takes several steps and watch the loop: what it decided, what it ran, what it observed, what it decided next. Write down where it went wrong first.

Deliverable

A repository containing a working GEMINI.md and at least one registered MCP server, plus a short note on where the agent's loop first went off-track and what you did about it.

Self-check

  • What does /mcp list, and what does it not tell you about what those servers can reach?
  • You are 900 requests into the day on a long refactor. What happens next, and how would you have planned around it?
  • The agent generated SQL against a public dataset and returned a confident number. What do you check before citing it?
  • What is in GEMINI.md that should never be in GEMINI.md?