***

title: CLI Tools
slug: /reference/python/agents/cli
description: Command-line tools for testing, searching, and scaffolding.
max-toc-depth: 3
---------------------

For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

[swaig-test]: /docs/server-sdks/reference/python/agents/cli/swaig-test

[sw-search]: /docs/server-sdks/reference/python/agents/cli/sw-search

[sw-agent-init]: /docs/server-sdks/reference/python/agents/cli/sw-agent-init

[sw-agent-dokku]: /docs/server-sdks/reference/python/agents/cli/sw-agent-dokku

[mcp-gateway]: /docs/server-sdks/reference/python/agents/cli/mcp-gateway

The SignalWire Agents SDK ships with command-line tools for local development,
testing, knowledge base management, project scaffolding, and deployment. All CLI
tools are installed automatically with the SDK package and available on your PATH
after installation.

```bash
pip install signalwire
```

## Available Tools

| Command                            | Purpose                                               |
| ---------------------------------- | ----------------------------------------------------- |
| [`swaig-test`][swaig-test]         | Test SWAIG functions and generate SWML output locally |
| [`sw-search`][sw-search]           | Build, search, and validate vector search indexes     |
| [`sw-agent-init`][sw-agent-init]   | Scaffold new agent projects with templates            |
| [`sw-agent-dokku`][sw-agent-dokku] | Deploy agents to Dokku hosting                        |
| [`mcp-gateway`][mcp-gateway]       | Bridge MCP servers to SWAIG functions                 |

## Common Patterns

### Local Development Workflow

```bash
# 1. Create a new project
sw-agent-init my-agent

# 2. Inspect the generated SWML
swaig-test agents/main_agent.py --dump-swml

# 3. List available tools
swaig-test agents/main_agent.py --list-tools

# 4. Test a specific function
swaig-test agents/main_agent.py --exec get_info --topic "SignalWire"
```

### Building a Knowledge Base

```bash
# Build a search index from documentation
sw-search ./docs --output knowledge.swsearch

# Verify the index
sw-search validate knowledge.swsearch

# Test search queries
sw-search search knowledge.swsearch "how to create an agent"
```

### Deployment

```bash
# Deploy to Dokku
sw-agent-dokku init my-agent --host dokku.example.com
sw-agent-dokku deploy
```

## Installation Extras

Some CLI tools require optional dependencies:

| Extra              | Install Command                              | Required For                      |
| ------------------ | -------------------------------------------- | --------------------------------- |
| `search`           | `pip install "signalwire[search]"`           | `sw-search` build and query       |
| `search-full`      | `pip install "signalwire[search-full]"`      | PDF and DOCX processing           |
| `search-nlp`       | `pip install "signalwire[search-nlp]"`       | Advanced NLP features (spaCy)     |
| `search-queryonly` | `pip install "signalwire[search-queryonly]"` | Query-only mode (smaller install) |
| `pgvector`         | `pip install "signalwire[pgvector]"`         | PostgreSQL vector storage         |

<CardGroup cols={2}>
  <Card title="swaig-test" href="/docs/server-sdks/reference/python/agents/cli/swaig-test">
    Test SWAIG functions, generate SWML, and simulate serverless environments.
  </Card>

  <Card title="sw-search" href="/docs/server-sdks/reference/python/agents/cli/sw-search">
    Build, search, and validate vector search indexes for agent knowledge bases.
  </Card>

  <Card title="sw-agent-init" href="/docs/server-sdks/reference/python/agents/cli/sw-agent-init">
    Scaffold new agent projects with configurable templates and platform targets.
  </Card>

  <Card title="sw-agent-dokku" href="/docs/server-sdks/reference/python/agents/cli/sw-agent-dokku">
    Deploy and manage agents on Dokku with CI/CD support.
  </Card>

  <Card title="mcp-gateway" href="/docs/server-sdks/reference/python/agents/cli/mcp-gateway">
    Bridge MCP protocol servers to SignalWire SWAIG functions.
  </Card>
</CardGroup>