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

# squarecloud app network

> 管理你在 Square Cloud 上应用程序的 DNS、自定义域名和边缘可观测性。

涵盖应用的 DNS 记录、自定义域名以及边缘可观测性（analytics、错误、日志、延迟和缓存）。应用 ID 在每个子命令中都是可选的：CLI 会先从参数中解析，然后是当前目录下的 `squarecloud.app` 配置文件，最后回退到交互式选择器。

```bash theme={null}
squarecloud app network dns
# 显示将自定义域名指向该应用所需的 DNS 记录。
```

```bash theme={null}
squarecloud app network domain example.com --app <appID>
# 设置应用的自定义域名。
```

analytics、错误、日志和性能都支持 `--start`/`--end`（RFC 3339 时间戳），默认取最近 24 小时：

```bash theme={null}
squarecloud app network analytics
# 汇总最近 24 小时的访问量、请求数和流量。
```

```bash theme={null}
squarecloud app network analytics --start 2026-07-01T00:00:00Z --end 2026-07-02T00:00:00Z --country BR --status 200
# 按自定义时间窗口以及以下一个或多个条件筛选 analytics：--country、--ip、--path、--status、--os、
# --browser、--protocol、--referer、--provider、--content-type、--bot。
```

```bash theme={null}
squarecloud app network errors
# 汇总最近 24 小时的 5xx 边缘错误，并列出出错最多的路径。
```

```bash theme={null}
squarecloud app network errors --include-4xx
# 在错误明细中同时包含 4xx 响应。
```

```bash theme={null}
squarecloud app network logs
# 显示最近的边缘请求日志。需要 Pro 或 Enterprise 套餐。
```

```bash theme={null}
squarecloud app network performance
# 显示边缘和源站的延迟百分位数（p50/p95/p99）以及最慢的路径。需要 Pro 或 Enterprise 套餐。
```

```bash theme={null}
squarecloud app network purge-cache
# 清除应用的整个边缘缓存。
```

`purge-cache` 子命令具有破坏性：在清除缓存之前，它会要求 `y/N` 确认。传入 `-y`/`--yes` 可跳过该提示。

`dns`、`analytics`、`errors`、`logs` 和 `performance` 都支持 `--json`，用于输出原始的机器可读数据。

使用 `squarecloud app network --help` 获取有关此命令的更多信息。
