You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
swarms/docs/swarms/cli/cli_quickstart.md

3.6 KiB

CLI Quickstart: Getting Started in 3 Steps

Get up and running with the Swarms CLI in minutes. This guide covers installation, setup verification, and running your first commands.

Step 1: Install Swarms

Install the Swarms package which includes the CLI:

pip install swarms

Verify installation:

swarms --help

You should see the Swarms CLI banner with available commands.


Step 2: Configure Environment

Set up your API keys and workspace:

# Set your OpenAI API key (or other provider)
export OPENAI_API_KEY="your-openai-api-key"

# Optional: Set workspace directory
export WORKSPACE_DIR="./agent_workspace"

Or create a .env file in your project directory:

OPENAI_API_KEY=your-openai-api-key
WORKSPACE_DIR=./agent_workspace

Verify your setup:

swarms setup-check --verbose

Expected output:

🔍 Running Swarms Environment Setup Check

┌─────────────────────────────────────────────────────────────────────────────┐
│ Environment Check Results                                                  │
├─────────┬─────────────────────────┬─────────────────────────────────────────┤
│ Status  │ Check                   │ Details                                │
├─────────┼─────────────────────────┼─────────────────────────────────────────┤
│ ✓       │ Python Version          │ Python 3.11.5                          │
│ ✓       │ Swarms Version          │ Current version: 8.7.0                 │
│ ✓       │ API Keys                │ API keys found: OPENAI_API_KEY         │
│ ✓       │ Dependencies            │ All required dependencies available     │
└─────────┴─────────────────────────┴─────────────────────────────────────────┘

Step 3: Run Your First Command

Try these commands to verify everything works:

View All Features

swarms features

Create a Simple Agent

swarms agent \
    --name "Assistant" \
    --description "A helpful AI assistant" \
    --system-prompt "You are a helpful assistant that provides clear, concise answers." \
    --task "What are the benefits of renewable energy?" \
    --model-name "gpt-4o-mini"

Run LLM Council

swarms llm-council --task "What are the best practices for code review?"

Quick Reference

Command Description
swarms --help Show all available commands
swarms features Display all CLI features
swarms setup-check Verify environment setup
swarms onboarding Interactive setup wizard
swarms agent Create and run a custom agent
swarms llm-council Run collaborative LLM council
swarms heavy-swarm Run comprehensive analysis swarm

Next Steps