Using the CLI with AI Agents

View as Markdown

The Brev CLI includes a skill that enables AI coding agents to manage GPU and CPU instances using natural language. After installation, use natural language such as “create an A100 instance for ML training” and your agent runs the appropriate brev commands.

Supported Agents

The skill installs to the following agent platforms:

AgentInstall Path
Claude Code~/.claude/skills/brev-cli/
Codex~/.codex/skills/brev-cli/
Other agents~/.agents/skills/brev-cli/

Installing the Skill

Option 1: Using the CLI

$brev agent-skill install

Or simply run brev agent-skill — it defaults to install.

Option 2: One-Liner (curl)

$curl -fsSL https://raw.githubusercontent.com/brevdev/brev-cli/main/scripts/install-agent-skill.sh | bash

Option 3: Automatic Prompt

When you run brev login and the CLI detects an AI coding agent on your system, it offers to install the skill automatically.

What Gets Installed

The skill installs the following files to each agent directory:

~/.claude/skills/brev-cli/
├── SKILL.md # Skill definition and quick reference
├── prompts/
│ ├── quick-session.md # Quick GPU session workflow
│ ├── ml-training.md # ML training setup workflow
│ └── cleanup.md # Instance cleanup workflow
├── reference/
│ ├── commands.md # Full command reference
│ └── search-filters.md # GPU/CPU search filter details
└── examples/
└── common-patterns.md # Common usage patterns

Agent-Driven Workflows

After installation, restart your agent (or start a new conversation) and use natural language:

"Create an A100 instance for ML training"
"Search for GPUs with 40GB VRAM under $3/hr"
"Stop all my running instances"
"Open my-instance in Cursor"
"What GPUs are available with fast boot times?"

The agent translates these requests into the appropriate brev CLI commands, confirms before destructive operations, and shows costs before creating instances.

Safety Rules

The skill instructs agents to follow these safety rules:

  • Always confirm before deleting or stopping instances
  • Always show cost/type before creating instances
  • Always confirm before creating expensive instances (H100, multi-GPU) or clusters (--count > 1)
  • Always check brev ls before assuming an instance exists

Updating the Skill

Re-run the install command to update to the latest version:

$brev agent-skill install

Testing from a Branch

To test skill changes from a specific branch:

$BREV_SKILL_BRANCH=my-branch brev agent-skill install

Uninstalling the Skill

$brev agent-skill uninstall

Or with curl:

$curl -fsSL https://raw.githubusercontent.com/brevdev/brev-cli/main/scripts/install-agent-skill.sh | bash -s -- --uninstall

This removes the skill from all agent directories. Restart your agent to apply the change.

Troubleshooting

Agent doesn’t recognize Brev commands

  • Verify the skill is installed: check that ~/.claude/skills/brev-cli/SKILL.md exists
  • Restart the agent or start a new conversation
  • Try invoking the skill explicitly with /brev-cli (in Claude Code)

Skill install fails

  • Check your internet connection (files are downloaded from GitHub)
  • Try the curl installer as an alternative
  • Verify you have write permissions to ~/.claude/ and ~/.agents/

Agent runs wrong commands

  • Update to the latest skill: brev agent-skill install
  • Check that you’re running the latest Brev CLI: brev --version