AI / AI Tools

AI Tools

Claude CLI / Codex CLI / Agy CLI / Copilot CLI command reference.

Claude CLI (officially Claude Code) is Anthropic's agentic coding tool that runs in your terminal. It can understand your codebase, edit files, run tests, and handle Git workflows.

📦 Installation

Install via npm (requires Node.js ≥18):

# Install globally
npm install -g @anthropic-ai/claude-code

# Or use via npx (no global install)
npx @anthropic-ai/claude-code

# Verify installation
claude --version

Prerequisites: Node.js 18+, and an Anthropic API key or Claude Pro/Max subscription.

🔑 Authentication

# Login interactively (opens browser)
claude auth

# Set API key via environment variable
export ANTHROPIC_API_KEY="sk-ant-..."

# Use a custom API base URL (for proxies)
claude --api-key "sk-..." --model claude-3-5-sonnet-20241022

⚡ Core Commands

CommandDescription
claudeStart an interactive REPL session in the current directory
claude "prompt"Send a one-shot prompt and print the response
claude -p "prompt"Print mode — output response to stdout (good for piping)
claude -cContinue the most recent conversation
claude --model <model>Specify which Claude model to use
claude --max-tokens <N>Set the maximum tokens in the response
claude --temperature <N>Set sampling temperature (0–1)

🖥️ Interactive Mode Commands

Once inside the REPL, use these slash commands:

CommandDescription
/helpShow available commands
/clearClear conversation history
/model <name>Switch model mid-session
/ compactSummarize the conversation to save tokens
/diffShow pending file changes
/undoRevert the last file change
/commitCreate a Git commit with the changes
exit / quitExit the REPL

🔌 Advanced & MCP Integration

# Run with extra context files
claude "review this code" --context src/*.py

# Use MCP (Model Context Protocol) servers
claude mcp add --transport http server-name https://...

# List configured MCP servers
claude mcp list

# Run in "headless" CI mode
claude -p "write tests" --output-format json

Codex CLI (officially codex) is OpenAI's official terminal-based AI coding assistant and agentic orchestration tool. It interacts directly with your local codebase to provide explanation, refactoring, bug fixes, and command line automation.

📦 Installation

Requires Node.js ≥18. Install globally via npm:

# Install globally via npm
npm install -g @openai/codex

# Or install via Homebrew on macOS
brew install --cask codex

# Verify
codex --version

🔑 Authentication

On your first run of the codex command, the terminal will guide you to sign in. You can authenticate via OAuth in your browser using your ChatGPT account (supporting Plus, Pro, Team, or Enterprise), or supply an OpenAI API key in the configuration.

# Start and authenticate
codex

⚡ Core Commands & Flags

Command / FlagDescription
codexStart an interactive Terminal User Interface (TUI) session
codex "prompt"Run a single prompt non-interactively and output to the terminal
-c key=value / --configOverride a configuration key for the current execution (e.g., -c model=gpt-4o)
-a <mode> / --ask-for-approvalSet approval policy (choices: untrusted, on-request, or never)
--add-dir <path>Grant read/write/execute permissions to additional directories
--profile <name>Load a specific profile (e.g., ~/.codex/name.config.toml)
--skip-git-repo-checkSkip Git repository checks during runtime

🔧 Configuration (config.toml)

Codex CLI reads user defaults from ~/.codex/config.toml. You can customize the active model, safety policies, and register MCP servers:

# Sample ~/.codex/config.toml
model = "gpt-4o"
approval_policy = "on-request"

# Configure Model Context Protocol (MCP) servers
[mcp_servers.my_helper]
enabled = true
command = "node"
args = ["/path/to/server.js"]

Project-level configs can be defined in a local .codex/config.toml to override global user configs (trusted projects only).

🤖 Interactive TUI Commands

Within the active codex TUI session, type / to trigger a popup containing the following commands:

ShortcutDescription
/agentSwitch to or inspect a spawned subagent thread
/appsBrowse and attach apps/connectors to the active session
/approvalsAdjust tool execution approval modes (e.g., Auto, Read Only, Full Access)
/clearClear terminal screen and start a fresh chat session
/compactSummarize the conversation history to free up context tokens
/diffShow Git diffs (including untracked files) of changes made
/forkClone the current conversation context into a new thread
/ideImport the active IDE context (open files, selection) into the next prompt
/modelSwitch the active AI model for the session
/permissionsConfigure tool and filesystem auto-approval rules
/pluginsManage, inspect, or install plugin tools
/reviewRequest an AI code review of current local codebase modifications
/sideStart an ephemeral side-thread for alternative code exploration
/statusView connection status, organization billing, and API rate limits
/themePreview and set TUI color themes and syntax highlights
/usageShow detailed token usage graphs and session statistics
/exit / /quitExit the active Codex CLI session

⚠️ Security Warning

Make sure you verify the exact package name before running npm install. Malicious actors have historically published package typos (e.g., codexui-android) attempting to steal authentication tokens from ~/.codex/auth.json. Always verify official package sources.

Agy CLI — Google's Antigravity (Agy) CLI is a lightweight, terminal-based agentic AI development and orchestration tool that brings powerful AI capabilities directly to your command line interface.

📦 Installation

Run the following command in your terminal to install agy:

# macOS & Linux Installation
curl -fsSL https://antigravity.google/cli/install.sh | bash

# Windows (PowerShell) Installation
irm https://antigravity.google/cli/install.ps1 | iex

# Verify installation
agy --version

🔑 Authentication

On your first run, type agy and press Enter. It will guide you through the OAuth flow in your browser to sign in to your Google account, then paste the code back in the terminal.

# Start and login
agy

# Logout
# Run /logout inside the interactive session

⚡ Core Commands

CommandDescription
agyStart an interactive Terminal User Interface (TUI) session
agy -p "prompt" / agy --print "prompt"Run a single prompt non-interactively and print the response
agy -c / agy --continueContinue the most recent conversation session
agy --conversation <ID>Resume a previous conversation by its ID
agy --model <model>Specify the model used for the current CLI session
agy --sandboxRun in a sandbox environment with terminal command restrictions enabled
agy --dangerously-skip-permissionsAuto-approve all tool permission requests without prompting

📁 Subcommands

SubcommandDescription
agy changelogDisplay product changelog and release notes
agy modelsList available AI models
agy plugin / pluginsManage plugins (install, uninstall, list, enable, disable)
agy updateUpdate Agy CLI to the latest version
agy installConfigure environment paths and shell integration settings

🤖 Interactive TUI Commands

Within the interactive agy TUI session, you can run the following shortcut slash commands:

ShortcutDescription
/add-dirAdd a new directory path to the active workspace
/agentsList active subagents and custom agents (such as Fleet)
/artifactOpen the TUI artifact viewer
/btwAsk a quick side-question without starting a full agent run
/changelogDisplay product changelog and release notes
/clear / /newClear terminal screen and conversation context
/config / /settingsOpen TUI configuration panel to customize settings
/contextList files and symbols currently in the agent's context
/copyCopy the last agent response to the system clipboard
/diffDisplay current codebase diff of changes made by the agent
/fork / /branchFork the current conversation into a new thread, preserving history
/helpDisplay the help menu with commands and keyboard shortcuts
/hooksList all registered lifecycle hooks
/keybindingsConfigure and view all active CLI keyboard shortcuts
/logoutLog out of the active Google account session
/mcpList active MCP servers and their exposed tools
/modelChange the active model for the session
/openOpen a file in your preferred local editor (e.g., vim, nano, auto)
/permissionsManage tool execution permissions (allow/deny rules)
/planningOpen the interactive graphical planning and task list editor
/renameRename the active conversation thread
/skillsList all active agent skills
/tasksDisplay the active task list and progress
/usage / /quotaDisplay token usage, session cost, and quota statistics
/exit / /quitExit the active Antigravity CLI session

🔌 Use via Antigravity Python SDK

Or programmatically orchestrate agents using the official Python SDK:

pip install google-antigravity
import asyncio
from google.antigravity import Agent, LocalAgentConfig, CapabilitiesConfig

async def main():
    # Read-only by default. Pass CapabilitiesConfig() to allow write/command execution.
    config = LocalAgentConfig(
        system_instructions="You are an expert codebase assistant.",
        capabilities=CapabilitiesConfig()
    )
    
    async with Agent(config) as agent:
        response = await agent.chat("Write a short Python script to list files")
        # Stream response tokens
        async for token in response:
            print(token, end="", flush=True)

if __name__ == "__main__":
    asyncio.run(main())

GitHub Copilot CLI (officially copilot, package @github/copilot) is GitHub's official terminal-native AI coding assistant and agentic CLI. It allows you to interact with your codebase using natural language, enabling autonomous planning, code generation, debugging, and git workflow integration.

📦 Installation

Requires Node.js ≥22. Install globally via npm:

# Install globally via npm
npm install -g @github/copilot

# Verify
copilot --version

Note: Older packages like @githubnext/github-copilot-cli are deprecated. Please migrate to the new @github/copilot package.

🔑 Authentication

Run the copilot command and use the /login command inside the session to authenticate with your GitHub account:

# Start Copilot CLI
copilot

# Run login inside the session
/login

Requires an active GitHub Copilot subscription.

⚡ Core Modes & Interactive Controls

Shortcut / ControlDescription
Shift + TabToggle into **Plan Mode** to outline and design multi-step tasks before execution
@filenameType @ followed by a filename to add specific files to the agent context
Ctrl + CInterrupt execution or clear the current prompt input
Ctrl + LClear the terminal screen
EscCancel the current action

🤖 Interactive Slash Commands

Within the interactive copilot session, use these slash commands starting with /:

Slash CommandDescription
/loginAuthenticate with your GitHub account
/modelChoose or switch active AI models (e.g. Claude 3.5 Sonnet, GPT-4o)
/helpDisplay command help and documentation guides
/prManage and interact with GitHub Pull Requests directly from the terminal
/fleetEnable multi-subagent collaboration (Fleet) mode to accelerate complex tasks
/experimentalToggle experimental features and options
/exitExit the active Copilot CLI session

🔌 Use via GitHub Copilot SDK

For programmatic agent orchestration, you can use the official Copilot SDK in Node.js / TypeScript projects:

# Install official SDK
npm install @github/copilot-sdk

This SDK communicates via JSON-RPC with the Copilot CLI or its underlying runtime to orchestrate task planning, tool execution, and codebase edits.