Skip to main content

Swarms CLI Overview

The Swarms CLI is a powerful command-line interface that provides comprehensive tools for creating, managing, and executing AI agents and swarms. It offers an intuitive way to interact with the Swarms framework directly from your terminal.

Installation

The Swarms CLI is included with the main Swarms package:
To verify the installation:

Quick Start

Get started with these common commands:

Environment Setup

Check your environment configuration:
For detailed diagnostics:

Interactive Chat Agent

Start a chat session with an AI agent:
With a custom name and initial task:

Create a Custom Agent

Create and run a custom agent (interactive mode by default):

Available Commands

The Swarms CLI provides the following command categories:

Setup & Configuration

  • onboarding - Run environment setup check
  • setup-check - Comprehensive environment diagnostics
  • get-api-key - Retrieve API keys from the platform
  • check-login - Verify authentication status

Agent Operations

  • agent - Create and run custom agents
  • chat - Interactive chat agent with optimized defaults
  • run-agents - Execute agents from YAML configuration
  • load-markdown - Load agents from markdown files

Swarm Operations

  • autoswarm - Generate and execute autonomous swarms
  • heavy-swarm - Run HeavySwarm for complex task analysis
  • llm-council - Run LLM Council with collaborative agents

Utilities

  • help - Display comprehensive command reference
  • features - Show all available features
  • upgrade - Update Swarms to the latest version

Getting Help

For detailed information about any command:
View all available features:
Access the complete command reference:

Environment Variables

The CLI uses several environment variables for configuration:
  • OPENAI_API_KEY - OpenAI API key
  • ANTHROPIC_API_KEY - Anthropic API key
  • GOOGLE_API_KEY - Google API key
  • COHERE_API_KEY - Cohere API key
  • WORKSPACE_DIR - Directory for agent workspaces and outputs
Set these in your .env file or export them directly:

Next Steps

Commands Reference

Explore all available CLI commands in detail

Configuration

Learn how to configure agents using YAML and environment variables

Resources