# Install the Verbiflow SDK

The SDK gives your agent access to the research, data, and outreach tools
behind Mochi. Use it to qualify accounts, build campaigns, manage replies,
and run recurring Plays in your Verbiflow workspace.
Install the SDK and agent skill for Claude Code or Codex.

If you are an AI agent, follow these steps in order. Each step prints what to
check before moving on.

## 1. Install

```sh
curl -fsSL https://verbiflow.com/install.sh | sh
```

This installs, on macOS or Linux:

- the `verbiflow` Python package in an isolated venv at `~/.verbiflow/sdk-venv`
  (your system Python is untouched)
- the `verbiflow` CLI at `~/.verbiflow/sdk-venv/bin/verbiflow`, linked to
  `~/.local/bin/verbiflow`
- the `verbiflow` agent Skill for Claude Code (`~/.claude/skills/verbiflow`)
  and Codex (`~/.codex/skills/verbiflow`)
- `uv` if missing, and an isolated Python 3.14 runtime

The official package and CLI are published at
https://pypi.org/project/verbiflow/. The installer uses that package unless
`VERBIFLOW_SDK_PACKAGE` points at a local development checkout.

The installer selects Python 3.14 through uv. You do not need to replace
your system Python. If you set `PYTHON`, it must point to Python 3.14.

## 2. Verify

```sh
~/.verbiflow/sdk-venv/bin/verbiflow --help
~/.verbiflow/sdk-venv/bin/python -c "import verbiflow as vf; print(vf.__version__)"
```

## 3. Log in

Run SDK scripts with the venv interpreter. First login is a claim flow: the
SDK returns a URL, a human opens it in their browser, and the token lands in
the SDK's local state.

```python
# ~/.verbiflow/sdk-venv/bin/python
import verbiflow as vf

login = vf.auth.login()          # or provider="magic_link", target_email="you@company.com"
print(login["claim_url"])        # show this URL to the user; they open it and sign in
# After the user completes sign-in, poll with the private claim token.
# Keep claim tokens out of chat and logs.
result = vf.auth.claim_status(claim_token=login["claim_token"])
print(result["status"])
```

Then confirm on every later run:

```python
import verbiflow as vf

vf.auth.ensure_logged_in()
print(vf.auth.status(validate=True))
```

Never paste tokens into files or agent memory — auth lives in the SDK's local
state DB.

## 4. Work

- **Claude Code / Codex**: restart the session so the `verbiflow` Skill is
  picked up, then just ask for GTM work — the Skill covers audience discovery,
  research, enrichment, sequence staging, and plays.
- **CLI**: `verbiflow functions describe <name>` documents one exact SDK
  function, its arguments, and examples. Use the function index below to find
  the exact dotted name.

Machine-readable contracts:

- OpenAPI 3.1: https://verbiflow.com/openapi.json
- SDK function index: https://verbiflow.com/sdk/functions.json

## Update

```sh
verbiflow update
```

Upgrades the package and refreshes the installed Skills. Re-running the
installer does the same on a machine that drifted.

## Uninstall

```sh
rm -rf ~/.verbiflow ~/.claude/skills/verbiflow ~/.codex/skills/verbiflow
rm -f ~/.local/bin/verbiflow
```

## Troubleshooting

- `import verbiflow` fails → you are on the wrong interpreter; use
  `~/.verbiflow/sdk-venv/bin/python`.
- Skill not visible in Claude Code / Codex → confirm
  `~/.claude/skills/verbiflow/SKILL.md` (or `~/.codex/skills/verbiflow/SKILL.md`)
  exists, then restart the agent session.
- `verbiflow` not on PATH → add `~/.local/bin` to PATH, or call
  `~/.verbiflow/sdk-venv/bin/verbiflow` directly.
- Anything else → https://verbiflow.com or book time at
  https://cal.com/team/getverbiflow/30-mins.
