> This page is for Server SDKs.

> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes.

# sw-pydocs

> Print the installed SDK's documentation, topics, and API signatures for people and coding agents.

The `sw-pydocs` command prints the documentation for the installed version of the SDK.
It's written for people and for coding agents: the output is Markdown, with full paths
to the docs, examples, and tutorials installed with the package. `python -m signalwire`
runs the same command.

```bash
sw-pydocs [<topic> [name] | <command> ...]
```

The topics are short and describe concepts and known mistakes, then point to the
installed docs for the rest. The version, commands, built-in skills and their
parameters, REST namespaces, the `SWML_` and `SIGNALWIRE_` environment variables, and
every signature and docstring come from the installed package.

## Commands

| Command                       | Prints                                                                                                                                                                                                        |
| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `sw-pydocs`                   | The index: what the SDK does, where to start, and every topic                                                                                                                                                 |
| `sw-pydocs <topic>`           | One area of the SDK: concepts, files to read, examples, and API names                                                                                                                                         |
| `sw-pydocs skills <name>`     | A built-in skill's parameters                                                                                                                                                                                 |
| `sw-pydocs topics`            | Every topic, one line each                                                                                                                                                                                    |
| `sw-pydocs api <name>`        | The signature, docstring, and members of a name from the installed code, such as `AgentBase`, `FunctionResult.connect`, or `signalwire.relay.Call`                                                            |
| `sw-pydocs examples [filter]` | The installed examples, with descriptions and paths, for a topic or matching a word                                                                                                                           |
| `sw-pydocs grep <regex>`      | Lines of the installed docs and examples that match, ignoring case. `--code` also searches the SDK's source, and `--limit` sets the most lines to print (default `100`)                                       |
| `sw-pydocs show <file>`       | An installed doc, named by path, file name, or a name such as `agent_guide`. `--toc` lists its headings with line numbers, and `--section <heading>` prints the first section whose heading contains the text |
| `sw-pydocs path [file]`       | Where the docs are installed, or one file's full path                                                                                                                                                         |
| `sw-pydocs --version`         | The installed SDK version                                                                                                                                                                                     |

Topics include `agents`, `tools`, `contexts`, `prefabs`, `operations`, `swml`,
`relay`, `rest`, `search`, `deploy`, `testing`, and `cli`.

### init

`sw-pydocs init` adds a section to the project's `AGENTS.md` telling coding agents to
use `sw-pydocs`, and to `CLAUDE.md` if the project has one that doesn't import
`AGENTS.md`. Run it again to update the section.

**`--dir`** `string`

The project directory. Defaults to the current one.

---

**`--skill`** `flag`

Also write an Agent Skills `SKILL.md` under `.agents/skills/` and `.claude/skills/`.

---

**`--print`** `flag`

Print the section without writing anything.

---

[`sw-agent-init`](/docs/server-sdks/reference/python/agents/cli/sw-agent-init) writes
the same `AGENTS.md` into new projects.

## Examples

```bash
sw-pydocs operations               # the operations topic
sw-pydocs api signalwire.ToolRefusal
sw-pydocs skills web_search        # a built-in skill's parameters
sw-pydocs grep "set_functions"     # search the docs and examples
sw-pydocs show agent_guide --toc   # a doc's headings
sw-pydocs init                     # point coding agents in this project at sw-pydocs
```