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

# Lifecycle

> How the CLI fits into your development workflow.

## Overview

The sunpeak CLI commands support a complete development lifecycle, from project creation to production builds. This page explains how the commands work together.

## Development Lifecycle

```mermaid theme={null}
flowchart LR
    A[npx sunpeak new] --> B[dev]
    B --> C[build]
    C --> D[start]
```

### 1. Create

Start a new project:

```bash theme={null}
npx sunpeak new
```

This scaffolds a complete sunpeak project with all the configuration and structure you need.

### 2. Develop

Run the development server with hot reload:

<Tabs>
  <Tab title="pnpm">
    ```bash theme={null}
    pnpm dev
    ```
  </Tab>

  <Tab title="npm">
    ```bash theme={null}
    npm run dev
    ```
  </Tab>

  <Tab title="yarn">
    ```bash theme={null}
    yarn dev
    ```
  </Tab>
</Tabs>

This starts:

* The inspector at `http://localhost:3000` for local development
* An MCP server at `http://localhost:8000` for testing with real MCP clients
* A sandbox proxy for cross-origin iframe isolation (matching production host behavior)

Both the inspector and MCP server support Hot Module Reload, letting you iterate quickly on your App UI.

### 3. Build

Create production-ready bundles:

<Tabs>
  <Tab title="pnpm">
    ```bash theme={null}
    pnpm build
    ```
  </Tab>

  <Tab title="npm">
    ```bash theme={null}
    npm run build
    ```
  </Tab>

  <Tab title="yarn">
    ```bash theme={null}
    yarn build
    ```
  </Tab>
</Tabs>

This compiles and optimizes your Resources, Tools, and optional server entry for production.

### 4. Start

Start the production MCP server:

<Tabs>
  <Tab title="pnpm">
    ```bash theme={null}
    pnpm start
    ```
  </Tab>

  <Tab title="npm">
    ```bash theme={null}
    npm run start
    ```
  </Tab>

  <Tab title="yarn">
    ```bash theme={null}
    yarn start
    ```
  </Tab>
</Tabs>

This loads your compiled tools (with real handlers and Zod schemas), serves pre-built resource HTML, and runs your `auth()` function if present. See the [Deployment Guide](/app-framework/guides/deployment) for details on publishing to ChatGPT.

## Dive Deeper

<Card horizontal title="CLI API Reference" icon="terminal" href="/app-framework/cli/new">
  Detailed documentation for all CLI commands and options.
</Card>
