Skip to content

[feat] Add CLI onboarding funnel for first-time setup #4

@kyegomez

Description

@kyegomez

Summary

Create an interactive CLI onboarding funnel that guides users through initial setup and configuration.

Description

When users first run ClawSwarm, they should be guided through an interactive setup process that collects necessary configuration and validates their environment.

Requirements

Interactive Prompts

  • Prompt for agent name (default: "ClawSwarm")
  • Prompt for agent description
  • Prompt for model selection with options:
    • gpt-4o
    • gpt-4o-mini (default)
    • claude-3-5-sonnet-20241022
    • claude-3-opus-20240229
    • Other (manual input)
  • Display current environment variable status

Environment Validation

  • Check for required API keys:
    • OPENAI_API_KEY
    • ANTHROPIC_API_KEY (optional)
  • Check for platform tokens:
    • TELEGRAM_BOT_TOKEN (optional)
    • DISCORD_BOT_TOKEN (optional)
    • WHATSAPP_ACCESS_TOKEN (optional)
  • Validate gateway configuration:
    • GATEWAY_HOST
    • GATEWAY_PORT

Configuration Management

  • Save configuration to .env file
  • Offer to create .env from template if missing
  • Display missing environment variables with setup instructions
  • Validate API keys if possible (test connection)

CLI Command

Add new command: clawswarm init or clawswarm onboard

User Flow

$ clawswarm init

Welcome to ClawSwarm! 🦞
Let's get you set up.

Agent Name [ClawSwarm]: MyAgent
Agent Description: My custom AI agent for automation

Select Model:
  1. gpt-4o
  2. gpt-4o-mini (recommended)
  3. claude-3-5-sonnet-20241022
  4. claude-3-opus-20240229
  5. Other
Choice [2]: 2

Checking environment variables...
✓ OPENAI_API_KEY: Set
✗ ANTHROPIC_API_KEY: Not set (optional)
✗ TELEGRAM_BOT_TOKEN: Not set (optional)
✓ GATEWAY_HOST: Set to [::]
✓ GATEWAY_PORT: Set to 50051

Configuration saved to .env

Setup complete! Run 'clawswarm run' to start your agent.

Benefits

  • Improved first-time user experience
  • Reduced setup friction
  • Better validation of environment
  • Clear guidance on missing requirements
  • Saves time and reduces configuration errors

Acceptance Criteria

  • Interactive prompts work correctly
  • Configuration is saved to .env
  • Environment validation is comprehensive
  • Clear error messages for missing requirements
  • Documentation updated with onboarding command
  • Works on Windows, macOS, and Linux

Technical Notes

  • Use Python's input() for prompts
  • Consider using a library like questionary or click for better UX
  • Store config in .env using python-dotenv
  • Provide option to skip onboarding for CI/CD environments

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions