AI Agents in the CLI (Advanced)

⚠️ This section is for advanced users. Working in the CLI gives you powerful control over your computer, but it also means you can run commands that modify files, affect other programs, or change system settings. Anyone can learn to use the CLI, but it is important to understand what you are doing before you start. If you are not comfortable with this level of access, that is completely fine. You can always use Claude Cowork (see the previous topic in this lesson), which offers a more user-friendly way to work with AI agents on your computer without the risks associated with the command line.

⚠️ Disclaimer: The information in this topic is provided for educational purposes only. We are sharing these tools so you can explore them if you choose to, but we are not responsible for any changes, data loss, or issues that may result from using CLI-based tools on your computer. Always work in a dedicated folder, back up important files, and follow the official documentation from each provider.

What Is the CLI?

CLI stands for Command Line Interface. It is a way to communicate with your computer by typing text commands instead of clicking icons, buttons, and menus in a graphical interface. You type a command, press Enter, and the computer responds with text. That is why it is called the “command line.”

Every computer has a CLI built in, but it goes by different names:

  • Mac: Terminal
  • Windows: Command Prompt, PowerShell, or Windows Terminal
  • Linux: Terminal

When you open the CLI, you see something like this on Mac:

luis@MacBook-Pro ~ %

Or this on Windows:

C:\Users\Luis>

This is called the prompt. The computer is simply waiting for you to type a command. No buttons, no menus, just a blinking cursor.

Why the CLI Matters for AI Agents

When AI agents run in the CLI, they have much more control over your computer than they do through a web browser or even through Cowork. With your permission, a CLI-based agent can:

  • Read, create, and modify files across your entire workspace
  • Run commands and execute multi-step workflows autonomously
  • Process dozens or hundreds of files at once (batch processing)
  • Build tools like simple web apps, forms, or interactive materials
  • Work across your full file structure, not just one folder at a time

This is what makes CLI agents so powerful, but it is also why you need to be intentional about what you allow them to do.

CLI Agents from Major Providers

The three major AI companies offer CLI-based agents:

  • Claude Code (Anthropic): The most popular CLI agent. Available with a Claude Pro, Max, Team, or Enterprise plan.
  • Gemini CLI (Google): Integrates with Google Workspace. A free tier is available.
  • OpenAI Codex CLI (OpenAI): Integrates with ChatGPT.

All three follow a similar pattern: you navigate to a folder on your computer, start the agent, and describe what you need in natural language. When used correctly and following each provider’s official documentation, these tools are safe to use in your terminal.

A Note About Security

There are many open-source CLI tools circulating online, and some have gone viral recently. While some of these tools are impressive, we recommend sticking with the tools from established providers listed above (Claude Code, Gemini CLI, or OpenAI Codex CLI). These companies invest heavily in security, safety testing, and privacy protections before releasing their products. Open-source alternatives do not always go through the same rigorous review process, which can introduce vulnerabilities, especially when the tool has full access to files on your computer.

What a First Session Looks Like

Once you have Claude Code installed, here is what a first session looks like:

Step 1: Create a workspace folder and navigate to it in your terminal:

mkdir ~/Desktop/"My Teaching AI Workspace"
cd ~/Desktop/"My Teaching AI Workspace"

Step 2: Start Claude Code:

claude

Step 3: Describe what you need in plain English:

I'm a bilingual education teacher in Texas working with English Learners
in grades 6-8. Set up a workspace for me with folders for my three main
units: Ecosystems, Fractions, and Immigration Narratives. In each unit
folder, create subfolders for lesson-plans, student-materials, and
assessments. Create a CLAUDE.md instruction file with my teaching context.

Step 4: Claude Code creates everything in seconds:

My Teaching AI Workspace/
├── CLAUDE.md
├── standards-reference/
│   └── INSTRUCTIONS.md
├── Unit-Ecosystems/
│   ├── lesson-plans/
│   ├── student-materials/
│   ├── assessments/
│   └── INSTRUCTIONS.md
├── Unit-Fractions/
│   ├── lesson-plans/
│   ├── student-materials/
│   ├── assessments/
│   └── INSTRUCTIONS.md
└── Unit-Immigration-Narratives/
    ├── lesson-plans/
    ├── student-materials/
    ├── assessments/
    └── INSTRUCTIONS.md

What Is CLAUDE.md?

The CLAUDE.md file is a special instruction file that Claude Code reads automatically every time you start a session in that folder. Think of it as a memo you leave for a teaching assistant. It might look like this:

# My Teaching Workspace
## About Me
I teach bilingual education (English/Spanish) in Texas, grades 6-8.
## Standards
- ELPS documents are in the standards-reference/ folder
- Always align language objectives with ELPS
## Preferences
- Lesson plans should follow the 5E model
- Include Spanish cognates in vocabulary activities
- Format for 50-minute class periods

You do not have to write this yourself. You can ask Claude Code to create it based on what you tell it about your teaching context, and from that point on, every session starts with that context already loaded.

The Power of One Prompt

This is where CLI agents truly shine. Once your workspace is set up and your CLAUDE.md file has your teaching context, you can give the agent a single, detailed instruction and walk away while it works. This is the same kind of end-to-end task you saw in the Cowork topic, now run from the terminal; the difference is what the command line adds on top, like running scripts, batch-processing many files at once, and building your own tools. Here is an example of what one prompt can do:

I need to prepare my entire Ecosystems unit for next week. Here is what
I need you to do:
1. Read the TEKS and ELPS documents in my standards-reference folder.
2. Create a 5-day lesson plan for the food webs and energy transfer
   unit using the 5E model. Save it in Unit-Ecosystems/lesson-plans/.
3. For each day, create a student handout with vocabulary in English
   and Spanish, including cognates. Save these in
   Unit-Ecosystems/student-materials/.
4. Create a formative assessment quiz aligned with the daily objectives.
   Include a mix of multiple choice and short answer. Save it in
   Unit-Ecosystems/assessments/.
5. Create an answer key and a scoring rubric for the quiz.
6. Create a parent letter in English and Spanish explaining what
   students will learn this week and how families can support at home.
7. Finally, create a summary document listing all the files you created
   and which standards each one addresses.

With the proper permissions, Claude Code reads your standards documents, processes everything, and creates all of these files in the correct folders. You come back a few minutes later and your entire week is ready for review. One prompt, multiple files, all organized exactly where you need them.

This is the difference between a chatbot and an agent. A chatbot answers one question at a time. An agent takes a complete task, breaks it into steps, and executes all of them autonomously.

Taking It Further: What the CLI Can Do That Cowork Cannot

If you tried the Cowork topic earlier in this lesson, you may have noticed that Cowork can also handle multi-step tasks like the one above. So why would you use the CLI?

The answer is that the CLI lets you go beyond creating documents. In the CLI, an agent can:

  • Create programs and scripts that you can run again and again. For example, you could ask Claude Code to build a script that automatically converts all your lesson plans into a standardized format every time you run it. That script lives on your computer and works even when the AI is not running.
  • Build web-based tools for your classroom. Need an interactive vocabulary quiz, a parent survey form, or a simple website for your department? A CLI agent can build it, test it, and help you deploy it.
  • Automate recurring tasks that you do every week or every semester. Instead of asking the AI to create something from scratch each time, you can have it build an automation that does the work for you on demand.
  • Run and test code directly on your machine, fix errors, and iterate until the result is exactly right.

Cowork is excellent for working with documents, files, and content creation. The CLI takes it further by giving you access to the full capabilities of your computer.

The best part is that you do not need to know how to do any of this in advance. You can always ask the AI for ideas. Tell it what you are trying to accomplish, and it will suggest what it can build for you. With the proper permissions and knowing where to work on your computer, you can create things that would normally require a developer. This is something you will have to explore on your own, but the potential is real.

Getting Started

If you are interested in exploring CLI agents:

  1. Install Claude Code (recommended): on macOS or Linux, open your terminal and run curl -fsSL https://claude.ai/install.sh | bash. On Windows, download the installer from claude.ai/download. Homebrew users can run brew install --cask claude-code.
  2. Alternative, npm: if you already use Node.js (from nodejs.org), you can still run npm install -g @anthropic-ai/claude-code, though the native installer above is now the preferred method.
  3. Navigate to a dedicated workspace folder (never run CLI agents from your home directory or Documents folder)
  4. Type claude and describe what you need in plain English

For additional support, always refer to the official documentation from each provider:

If you would like personalized guidance on getting started, feel free to reach out to us directly.


Downloadable Companion Guides

The CLI can feel intimidating at first. These guides walk you through installation, your first session, and practical educator workflows step by step.