> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xpander.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Setup and Deployment Guide

> Learn how to set up Xpander CLI, create agents, and deploy them to production

## Install Xpander CLI

```bash theme={"dark"}
npm install -g xpander-cli
```

## Create New Agent

```bash theme={"dark"}
xpander agent new
```

This will create a new folder with these files:

* `xpander_handler.py` - Your agent's task handler
* `requirements.txt` - Python dependencies
* `.env.example` - Environment template
* `.env` - Environment from your agent with the keys
* `Dockerfile` - For containerized deployment

## Set Up Environment

```bash setup.sh theme={"dark"}
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
```

Check the  `.env` file from the example:

```bash theme={"dark"}
XPANDER_API_KEY=your_xpander_key_here
XPANDER_ORGANIZATION_ID=your_org_id_here
XPANDER_AGENT_ID=your_agent_id_here
```

## Deploy Your Agent

```bash theme={"dark"}
xpander deploy
```

Your agent will be deployed to the Xpander platform and ready to receive tasks through the dashboard or API.
