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

# Quickstart

> Install pflow and set it up for your AI agent

Your AI agent (Claude Code, Cursor, Windsurf) uses pflow to build and run workflows. You install it, configure an API key, and your agent handles the rest.

<Info>
  **Prerequisites:** Python 3.10+ and [uv](https://docs.astral.sh/uv/) or [pipx](https://pipx.pypa.io/)
</Info>

<Steps>
  <Step title="Install pflow">
    <Tabs>
      <Tab title="uv (recommended)">
        ```bash theme={null}
        uv tool install pflow-cli
        ```
      </Tab>

      <Tab title="pipx">
        ```bash theme={null}
        pipx install pflow-cli
        ```
      </Tab>
    </Tabs>

    Verify installation:

    ```bash theme={null}
    pflow --version
    ```
  </Step>

  <Step title="Set up your API key">
    pflow uses an LLM for **discovery** — finding the right workflows and nodes without your agent needing to load everything into context. You can use any provider supported by [LiteLLM](https://docs.litellm.ai/docs/providers) (OpenAI, Anthropic, Google, OpenRouter, Ollama, and 100+ more).

    ```bash theme={null}
    # OpenAI
    pflow settings set-env OPENAI_API_KEY "sk-..."

    # Or Anthropic
    pflow settings set-env ANTHROPIC_API_KEY "sk-ant-..."

    # Or Google
    pflow settings set-env GEMINI_API_KEY "..."
    ```

    pflow auto-detects your provider and selects a default model (Claude Sonnet 4.5 for Anthropic, Gemini 3 Flash for Google, GPT-5.2 for OpenAI).

    <Tip>
      Shell environment variables work too — anything `export ANTHROPIC_API_KEY=...` exports is picked up automatically.
    </Tip>

    <Accordion title="Choose a specific model (optional)">
      To use a different model than the auto-detected default:

      ```bash theme={null}
      pflow settings llm set-default anthropic/claude-sonnet-4-5
      ```

      See [LLM model settings](/reference/cli/settings#llm-model-settings) for all options.
    </Accordion>

    <Accordion title="What the model is used for">
      This is **pflow's LLM configuration**, separate from whatever LLM your agent uses:

      * **Discovery commands** - `pflow mcp find` and `pflow find` use LLM to find relevant nodes and workflows
      * **LLM nodes** - workflows that include an LLM node for text processing
      * **Smart filtering** - automatic field selection for large API responses

      <Note>
        Your agent creates workflows using its own LLM (Claude Code uses Claude, Cursor uses its models, etc.). pflow's model configuration is only for pflow's internal features.
      </Note>
    </Accordion>

    <Accordion title="When is it required?">
      Set up an LLM if you're using MCP servers. MCP tool descriptions can consume a third of your agent's context before any work starts — discovery is how pflow avoids that.

      For basic usage without MCP servers or testing pflow, the configuration is optional.

      <Tip>
        Discovery costs a fraction of what your agent spends per task. By loading only what's relevant, it cuts token usage, speeds up responses, and keeps context focused.
      </Tip>
    </Accordion>
  </Step>

  <Step title="Connect pflow to your AI agent">
    Your AI agent can use pflow in two ways:

    **Option 1: CLI access (easiest)**

    If your agent has terminal access (Claude Code, Cursor, Windsurf), instruct it to run:

    ```bash theme={null}
    pflow guide
    ```

    This gives the agent everything it needs to discover existing workflows, run them, or build new ones.

    **Option 2: MCP server**

    Add pflow to your AI tool's MCP config (Claude Desktop, Cursor, etc.):

    ```json theme={null}
    {
      "mcpServers": {
        "pflow": {
          "command": "pflow",
          "args": ["mcp", "serve"]
        }
      }
    }
    ```

    See [AI tool integration](/integrations/overview) for detailed setup instructions for each tool.
  </Step>
</Steps>

## What your agent can do with pflow

Once connected, your agent can:

* **Discover workflows**: `pflow find "what I want to do"`
* **Run workflows**: `pflow my-workflow param1=value1`
* **List workflows**: `pflow list`
* **Discover nodes**: `pflow mcp find "capability I need"`
* **Build new workflows**: Following `pflow guide`

## Next steps

<Columns cols={2}>
  <Card title="AI tool integration" icon="bot" href="/integrations/overview">
    Set up Claude Desktop, Cursor, or other AI tools
  </Card>

  <Card title="Add MCP servers" icon="plug" href="/guides/adding-mcp-servers">
    Expand pflow capabilities with external tools
  </Card>
</Columns>

## Troubleshooting

<Accordion title="Command not found: pflow">
  Make sure the install location is in your PATH:

  ```bash theme={null}
  # For uv
  echo $PATH | grep -q "$HOME/.local/bin" || echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc

  # For pipx
  pipx ensurepath
  ```

  Then restart your terminal.
</Accordion>

<Accordion title="Python version error">
  pflow requires Python 3.10+. Check your version:

  ```bash theme={null}
  python --version
  ```

  If you need to upgrade, use [pyenv](https://github.com/pyenv/pyenv) or your system package manager.
</Accordion>
