# 配置文件

> Shoplazza CLI 读取的 TOML 配置文件：shoplazza.app.toml 与 shoplazza.extension.toml、分环境配置，以及项目目录结构。

Shoplazza CLI 使用 TOML 配置文件管理应用和扩展设置。

## shoplazza.app.toml

应用主配置文件，由 `shoplazza app init` 创建：

```toml
client_id = "your-client-id"
scopes = "read_customer write_cart_transform"
```

## 多环境配置

```
my-app/
├── shoplazza.app.toml          # 默认配置
├── shoplazza.app.prod.toml     # 生产环境
└── shoplazza.app.staging.toml  # 预发布环境
```

切换配置：`shoplazza app config use --config prod`

链接新配置：`shoplazza app config link --client-id your-client-id`

## shoplazza.extension.toml

每个扩展的独立配置：

```toml
id = "extension-id"
name = "My Extension"
type = "theme"  # theme / checkout / function
```

## 项目目录结构

```
my-app/
├── shoplazza.app.toml
├── extensions/
│   ├── theme-extension/
│   ├── checkout-extension/
│   └── function-extension/
├── package.json
└── README.md
```
