> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.getdial.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.getdial.ai/_mcp/server.

# Pi

> Use Dial from Pi by dropping the Dial skill into your Pi config.

Drop the Dial skill into your Pi config so the terminal agent learns how to drive the `dial` CLI on demand. Once installed, Pi can send messages, place calls, and wait for events without you re-explaining the surface.

## Install

First, get the `dial` CLI on your PATH:

```bash title="Shell install"
curl -fsSL https://getdial.ai/install | bash
```

```text title="Agent prompt"
Follow https://getdial.ai/skills.md to install and onboard the dial CLI.
```

Then drop the Pi-specific Dial skill into your config:

```bash
dial auth verify-otp --code <code> --agent pi
```

`auth verify-otp` verifies your code first, then copies the Dial skill into Pi's standard config directory. Re-run the command anytime (after a CLI upgrade, for example) to overwrite the skill in place — the verification step is a no-op once you're signed in.

## What gets installed

A single markdown skill describing the `dial` CLI — its commands, flags, and conventions, mirroring the [CLI reference](/documentation/cli/commands). Pi loads the skill when a Dial-related task comes up; nothing else is touched.

## Use it

Once installed, just ask in plain language:

> Send an SMS to +14155550123 with the body "running late, ETA 10 min".

Pi picks up the skill, picks the right `dial` command, and runs it. See [Using Dial from an agent](/documentation/get-started/using-dial-from-an-agent) for more examples.

## Inbound event handling (Suggestion)

You can also wake Pi automatically when a Dial event arrives by wiring a [CLI command target](/integrations/methods/cli-command-target): for each inbound event, the listen daemon spawns a handler that delivers a fresh prompt to Pi's print mode.

First install the listen daemon:

```bash
dial listen install
```

### 1. Write a handler

```bash
#!/usr/bin/env bash
# /usr/local/bin/handle-dial-event-pi
event="$1"

type=$(jq -r '.type'        <<<"$event")
from=$(jq -r '.from // ""'  <<<"$event")
body=$(jq -r '.body // ""'  <<<"$event")

prompt=$(cat <<EOF
A Dial event just arrived. Decide what to do and act on it.

  type: $type
  from: $from
  body: $body

raw event JSON:
$event
EOF
)

# Detach a fresh Pi run and return right away.
nohup pi -p "$prompt" </dev/null >>~/.dial/pi.log 2>&1 &
disown
exit 0
```

`pi -p` is Pi's print mode — answer a single prompt and exit. For embedded use cases, Pi also exposes an RPC mode over stdin/stdout; see the Pi docs for the JSON protocol.

### 2. Register

```bash
chmod +x /usr/local/bin/handle-dial-event-pi
dial local-target add cmd /usr/local/bin/handle-dial-event-pi
```

The `nohup … & disown` pattern keeps Pi running after the handler exits, so a multi-minute agent run never collides with the daemon's per-attempt `--timeout`. See [CLI command target](/integrations/methods/cli-command-target) for the full reference, delivery semantics, and the once-retry behavior.