# `create-ponder` \[API reference]

The `create-ponder` CLI tool is the easiest way to get started with Ponder.

It asks a few questions, then creates a new Ponder project in the specified directory including all required files (`package.json`, `ponder.config.ts`, ABIs, etc).

:::code-group
```bash [pnpm]
pnpm create ponder {...options}
```

```bash [yarn]
yarn create ponder {...options}
```

```bash [npm]
npm init ponder@latest {...options}
```
:::

## Options

```sh
Usage:
  $ create-ponder <directory> [options]

Options:
  -t, --template [id]             Use a template
  --etherscan [url]               Use the Etherscan template with the specified contract URL
  --etherscan-api-key [key]       Etherscan API key for Etherscan template
  --subgraph [id]                 Use the subgraph template with the specified subgraph ID
  --subgraph-provider [provider]  Specify the subgraph provider
  --npm                           Use npm as your package manager
  --pnpm                          Use pnpm as your package manager
  --yarn                          Use yarn as your package manager
  --skip-git                      Skip initializing a git repository
  --skip-install                  Skip installing packages
  -h, --help                      Display this message
  -v, --version                   Display version number
```

## Templates

Templates help get you started faster by copying contract addresses, ABIs, and deployment blocks from an existing source.

### Etherscan contract link

The `--etherscan [url]` option creates a project using the address, ABI, and deployment block number of a contract on a block explorer. **Enter the full URL, not just the contract address.**

#### Chain support

The template uses the `viem/chains` list of block explorer URLs to determine the chain ID and fetch the contract ABI. Please reference the [`viem/chains` definitions](https://github.com/wevm/viem/tree/main/src/chains/definitions) to see if your block explorer is supported. If you'd like to use an unsupported block explorer, please open a PR there to add it.

![Etherscan contract link screenshot](/etherscan-link.png)

### Subgraph ID

The `--subgraph [id]` option creates a project from an existing subgraph by fetching the addresses, ABIs, and start blocks for each event source defined in `subgraph.yaml`.

To find the subgraph ID, go to the subgraph's page on the [hosted service](https://thegraph.com/hosted-service/subgraph/protofire/makerdao-governance) or [Graph Explorer](https://thegraph.com/explorer/).

![Subgraph ID screenshot](/subgraph-id.png)

### Example projects

The `-t, --template [id]` option creates a new project from one of the [example projects](https://github.com/ponder-sh/ponder/tree/main/examples).
For example, this command creates a project using the `feature-factory` example project.

:::code-group
```bash [pnpm]
pnpm create ponder --template feature-factory
```

```bash [yarn]
yarn create ponder --template feature-factory
```

```bash [npm]
npm init ponder@latest --template feature-factory
```
:::

Here are the available projects:

| Name                   | Template ID              | Link                                                                                      |
| :--------------------- | :----------------------- | :---------------------------------------------------------------------------------------- |
| Factory contract       | feature-factory          | [GitHub](https://github.com/ponder-sh/ponder/tree/main/examples/feature-factory)          |
| Custom event filter    | feature-filter           | [GitHub](https://github.com/ponder-sh/ponder/tree/main/examples/feature-filter)           |
| Multiple chains        | feature-multichain       | [GitHub](https://github.com/ponder-sh/ponder/tree/main/examples/feature-multichain)       |
| Proxy contract         | feature-proxy            | [GitHub](https://github.com/ponder-sh/ponder/tree/main/examples/feature-proxy)            |
| Contract calls         | feature-read-contract    | [GitHub](https://github.com/ponder-sh/ponder/tree/main/examples/feature-read-contract)    |
| Friendtech project     | project-friendtech       | [GitHub](https://github.com/ponder-sh/ponder/tree/main/examples/project-friendtech)       |
| Uniswap V3 flash loans | project-uniswap-v3-flash | [GitHub](https://github.com/ponder-sh/ponder/tree/main/examples/project-uniswap-v3-flash) |
| Basic ERC20 token      | reference-erc20          | [GitHub](https://github.com/ponder-sh/ponder/tree/main/examples/reference-erc20)          |
| Basic ERC721 token     | reference-erc721         | [GitHub](https://github.com/ponder-sh/ponder/tree/main/examples/reference-erc721)         |
