Chapter 3

Detailed explanation of command-line tools

Learn how to use command-line AI tools, including Claude Code, Codex CLI, Gemini CLI, and others, and understand terminal AI enhancement workflows and automation capabilities.

Claude Code: terminal-integrated AI assistant

Claude Code is a command-line AI tool from Anthropic, deeply integrated with the terminal environment and supporting MCP and GitHub workflow automation.

Terminal integration

  • Seamless integration: Use directly in the terminal without switching apps
  • Context awareness: Understand the current directory and Git status
  • Command execution:AI can execute Shell commands and view the results
  • File operations: read, create, modify files

MCP configuration

Claude Code supports MCP (Model Context Protocol) and can connect to external services:

  • File system MCP: access the local file system
  • GitHub MCP: GitHub API integration, managing repositories and Issues
  • Database MCP: connect to the database and query data
  • Custom MCP: Create your own MCP Server

GitHub workflow automation

  • Issue management: Create, update, and close issues
  • PR actions: Create Pull Request, code review
  • Automation scripts: Batch-process GitHub tasks
  • Workflow integration: work with GitHub Actions

Codex CLI & Gemini CLI: multi-model CLI tools

Master the use of Codex CLI and Gemini CLI to enable multi-model switching and project analysis.

Codex CLI

  • GPT-5.1 Codex: Call the OpenAI Codex model
  • Monorepo analysis: Analyze large Monorepo projects
  • /init command: automatically generate project rules and configurations
  • Code generation: generate code based on project context

Gemini CLI & Droid

  • Batch script execution: Batch processing files and tasks
  • Document automation: Automatically organize and generate documentation
  • Multi-model switching: Seamlessly switch between Claude/Gemini/GPT
  • Droid mode: Android development-only feature

Tips for switching between multiple models

  • Task assignment: choose the model based on task characteristics (Claude reasoning, GPT code, Gemini multimodal)
  • Cost optimization: use lightweight models for simple tasks, powerful models for complex tasks
  • Parallel calls: Call multiple models at the same time and compare the results
  • Fallback mechanism:Automatically switch to a backup model when the primary model fails

Warp & Continue.dev: AI-enhanced terminal

Understand AI-enhanced terminal tools and improve command-line work efficiency.

Warp terminal

  • AI command error correction: Automatically correct command errors
  • Natural language to Shell: Describe in natural language and generate Shell commands
  • Command history search: AI-enhanced command search
  • Smart completion: context-aware command completion

Continue.dev

  • Local model configuration: integrate Ollama and use local models
  • Enterprise private knowledge base: Connect to the internal enterprise knowledge base
  • Multi-model support: Supports multiple AI models
  • Background agent workflow: Execute long-running tasks in the background

Local model configuration (Ollama)

  • Model download: Use Ollama to download local models (Llama, Mistral, etc.)
  • API service: Start the Ollama API service
  • Privacy protection: code is not uploaded to the cloud
  • Cost control: Completely free, no API call fees

Goose: open-source Agent automation

Goose is an open-source AI Agent framework focused on automating script writing and execution.

Core features

  • Open source and free: Fully open source, free to use and modify
  • Agent mode: autonomously execute complex tasks
  • Command-line interface: a simple CLI interface
  • Script generation: Automatically generate and execute scripts

Use cases

  • Batch file processing: Rename, convert, and organize files
  • Code refactoring: automated code refactoring tasks
  • Data migration: database migration, data transformation
  • Deployment automation: Automated deployment process

Tool comparison and workflows

Choose the appropriate command-line tools for the scenario and build an efficient workflow.

Scenario selection

Daily development

Claude Code (terminal integration, MCP support)

Large-scale project analysis

Codex CLI (monorepo analysis, rule generation)

Privacy-sensitive projects

Continue.dev + Ollama (local model, code not uploaded)

Automation scripts

Goose (open-source Agent, script generation)

Workflow recommendations

  • Development phase: Use Claude Code for day-to-day development, connect to GitHub via MCP
  • Project analysis: Codex CLI analyzes large projects and generates project rules
  • Batch processing: Gemini CLI batch processes files and documents
  • Automation: Writing and executing automation scripts with Goose

Learning outcomes

After completing this chapter, you will:

  • 1Learn to use command-line AI tools (Claude Code, Codex CLI, Gemini CLI)
  • 2Able to configure MCP and local models (Ollama), and understand terminal AI-augmented workflows
  • 3Master multi-model switching techniques and choose the appropriate model based on the scenario
  • 4Understand the features and use cases of tools such as Warp, Continue.dev, and Goose