DEV Community

Jeff Yaw
Jeff Yaw

Posted on

How to Use AI CLI Tools: Claude Code, Codex, and Gemini CLI

AI CLI tools are changing how developers write code. Instead of switching to a browser or IDE extension, you stay in your terminal and work with an AI that can read your codebase, edit files, and run commands. Here is a practical overview of the major options.

All four tools below can be installed from Yaw's built-in install wizard (Ctrl+Shift+I), which handles dependencies automatically.


Claude Code

Claude Code is Anthropic's AI coding assistant. It runs in your terminal, reads your project files, and can create, edit, and delete files with your approval. It is an agentic tool ΓÇö you give it a task and it works through it step by step.

Install

macOS / Linux: curl -fsSL https://claude.ai/install.sh | bash

Windows: irm https://claude.ai/install.ps1 | iex

Key Features

  • Reads and understands your full codebase
  • Creates, edits, and deletes files (with approval)
  • Runs shell commands
  • CLAUDE.md project context files for persistent instructions (reads AGENTS.md as fallback)
  • Works with git for safe, reviewable changes
  • Hooks system for automating workflows around tool events
  • Subagents for parallelizing complex tasks
  • MCP (Model Context Protocol) support for external tools

Best For

Multi-file changes, refactoring, building new features, and understanding unfamiliar codebases. Claude Code excels at tasks that require reading many files and making coordinated changes. Its CLAUDE.md context system lets you encode project conventions once and have them applied consistently across sessions.


Codex

Codex is OpenAI's CLI agent. Like Claude Code, it operates directly in your terminal and can read, write, and execute within your project. It is built in Rust and uses OS-level sandboxing to isolate command execution.

Install

npm install -g @openai/codex

Key Features

  • OS-level sandboxing ΓÇö read-only, workspace-write, or full-access modes enforced via macOS Seatbelt and Linux Landlock
  • AGENTS.md context files ΓÇö an open standard under the Linux Foundation, also read by Cursor, Copilot, Vibe CLI, and Devin
  • Image input ΓÇö attach screenshots or design specs alongside prompts
  • Subagents for parallelizing complex tasks
  • Built-in web search for up-to-date information
  • Multiple approval modes (suggest, auto-edit, full-auto)
  • MCP support for external tool integration

Best For

Security-conscious workflows where you want OS-enforced boundaries on what the AI can access. The sandbox modes are the most granular of any AI CLI tool ΓÇö you can give Codex full autonomy within your workspace while blocking network access and protecting .git. The AGENTS.md standard also means your project context works across multiple AI tools, not just Codex.


Gemini CLI

Gemini CLI is Google's open-source (Apache 2.0) AI coding agent. It is free to use with a Google account ΓÇö no paid API key required for Gemini Flash models, which include a 1 million token context window.

Install

npm install -g @google/gemini-cli

Key Features

  • Free tier with 1M token context window (Gemini Flash models)
  • Open source (Apache 2.0)
  • Extension ecosystem ΓÇö browse and install community extensions with agent skills
  • GEMINI.md context files with hierarchical discovery across directories
  • Google Search grounding built in
  • MCP support for external tools and services
  • Can be configured to read AGENTS.md for cross-tool compatibility

Best For

Developers who want a free, open-source AI CLI tool with no API costs to get started. The free tier is genuinely usable ΓÇö 250 requests per day with Flash models and a 1M token context window. The extension ecosystem and Google Search grounding also make it strong for tasks that need access to current information or specialized tools.


Vibe CLI (Mistral)

Vibe CLI is Mistral's command-line coding assistant. It takes a different approach from the task-oriented agents above ΓÇö instead of working through multi-step plans autonomously, it focuses on rapid, conversational iteration. You describe what you want, it generates code, and you refine together in tight loops.

Install

macOS / Linux: curl -LsSf https://mistral.ai/vibe/install.sh | bash

Windows: pip install mistral-vibe

Key Features

  • Free to use ΓÇö Mistral's Experiment tier includes all models with no credit card required (note: free tier requests may be used for model training)
  • Powered by Mistral's models (Devstral 2, Codestral)
  • Conversational, iterative workflow rather than autonomous execution
  • File reading, writing, and patching
  • Shell command execution in a stateful terminal
  • Recursive code search with grep (ripgrep support)
  • AGENTS.md support for cross-tool project context
  • MCP support for external tools, databases, and APIs (added in v2.0)
  • Custom subagents and slash-command skills
  • Clarification system ΓÇö asks before acting when intent is ambiguous

Best For

Quick prototyping, creative exploration, and developers who want a back-and-forth conversation with the AI rather than handing off a task. The clarification system makes it more cautious than fully autonomous agents ΓÇö good for situations where you want the AI to check before making changes. Also the only tool here that runs entirely on European infrastructure (Mistral is based in Paris).


Terminal Setup

Regardless of which tool you use, your terminal setup matters:

Split Panes

The most important setup. Run the AI tool in one pane and keep a regular shell in the other. You can check files, run tests, and verify changes while the AI works. Most terminals support this ΓÇö split vertically so the AI gets the wider pane.

Scrollback

AI CLI tools produce a lot of output. Make sure your terminal has enough scrollback to review what the AI generated. At least a few thousand lines.

Project Context

Each tool reads its own context file: Claude Code uses CLAUDE.md (falls back to AGENTS.md), Codex uses AGENTS.md (with configurable fallbacks), Gemini CLI uses GEMINI.md (can be configured to also read AGENTS.md), and Vibe CLI reads AGENTS.md. These files let you encode project conventions, tech stack details, and coding standards so the AI follows them consistently. AGENTS.md is an open standard under the Linux Foundation, adopted by 60,000+ projects ΓÇö if you maintain one, it works across most tools out of the box.

Auto-Detection

Most terminals treat AI CLI tools as ordinary processes ΓÇö they run, but the terminal doesn't know what they are. Yaw handles this automatically ΓÇö it recognizes when you start any of these tools and splits a companion shell in the same working directory. It also has a built-in file editor for reviewing AI-generated changes, inline image rendering for viewing screenshots and diagrams alongside your sessions, and context-menu actions (Explain This, Fix This) that send errors directly to an AI provider for help.


Which Should You Try First?

If you're new to AI CLI tools, start with whichever matches the AI provider you already use. If you have an Anthropic API key, start with Claude Code. OpenAI key, start with Codex. If you want to try one without paying for an API key, Gemini CLI is free with a Google account and Vibe CLI is free with Mistral's Experiment tier. If you're not sure, Claude Code and Codex are the most mature and widely used.

You can use more than one ΓÇö they all install independently and work in any terminal. Try running a real task (not a toy example) to see how each one handles your actual codebase.


Comparison Table

Tool Provider File Editing Command Execution Context Files MCP Open Source Free Tier
Claude Code Anthropic Yes Yes CLAUDE.md, AGENTS.md Yes No No
Codex OpenAI Yes Yes (sandboxed) AGENTS.md Yes Yes No
Gemini CLI Google Yes Yes GEMINI.md Yes Yes Yes
Vibe CLI Mistral Yes Yes AGENTS.md Yes Yes Yes

Originally published at yaw.sh/blog/ai-cli-tools-claude-code-codex-gemini

Top comments (0)