temps-cli

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Temps CLI - Complete Reference

Temps CLI - 完整参考手册

Temps CLI is the command-line interface for the Temps deployment platform. It provides full control over projects, deployments, services, domains, monitoring, and platform configuration.
Temps CLI是Temps部署平台的命令行界面,可全面管控项目、部署、服务、域名、监控及平台配置。

Installation

安装

bash
undefined
bash
undefined

Run directly without installing

无需安装直接运行

npx @temps-sdk/cli --version bunx @temps-sdk/cli --version
npx @temps-sdk/cli --version bunx @temps-sdk/cli --version

Or install globally

或全局安装

npm install -g @temps-sdk/cli bun add -g @temps-sdk/cli
undefined
npm install -g @temps-sdk/cli bun add -g @temps-sdk/cli
undefined

Configuration

配置

bash
undefined
bash
undefined

Interactive configuration wizard

交互式配置向导

bunx @temps-sdk/cli configure
bunx @temps-sdk/cli configure

Set API URL

设置API地址

bunx @temps-sdk/cli configure set apiUrl https://your-server.example.com:3000
bunx @temps-sdk/cli configure set apiUrl https://your-server.example.com:3000

Set default output format (table, json, minimal)

设置默认输出格式(table、json、minimal)

bunx @temps-sdk/cli configure set outputFormat table
bunx @temps-sdk/cli configure set outputFormat table

View current configuration

查看当前配置

bunx @temps-sdk/cli configure show
bunx @temps-sdk/cli configure show

List all config values

列出所有配置项

bunx @temps-sdk/cli configure list
bunx @temps-sdk/cli configure list

Reset to defaults

重置为默认配置

bunx @temps-sdk/cli configure reset

**Config file**: `~/.temps/config.json`
**Credentials file**: `~/.temps/.secrets` (mode 0600)

**Environment variables** (override config):
| Variable | Description |
|---|---|
| `TEMPS_API_URL` | Override API endpoint |
| `TEMPS_TOKEN` | API token (highest priority) |
| `TEMPS_API_TOKEN` | API token (CI/CD) |
| `TEMPS_API_KEY` | API key |
| `NO_COLOR` | Disable colored output |
bunx @temps-sdk/cli configure reset

**配置文件**:`~/.temps/config.json`
**凭据文件**:`~/.temps/.secrets`(权限模式0600)

**环境变量**(覆盖配置文件):
| 变量名 | 描述 |
|---|---|
| `TEMPS_API_URL` | 覆盖API端点地址 |
| `TEMPS_TOKEN` | API令牌(优先级最高) |
| `TEMPS_API_TOKEN` | API令牌(CI/CD场景) |
| `TEMPS_API_KEY` | API密钥 |
| `NO_COLOR` | 禁用彩色输出 |

Global Options

全局选项

-v, --version    Display version number
--no-color       Disable colored output
--debug          Enable debug output
-h, --help       Display help for command

-v, --version    显示版本号
--no-color       禁用彩色输出
--debug          启用调试输出
-h, --help       显示命令帮助信息

Authentication

身份验证

Login

登录

bash
undefined
bash
undefined

Interactive login (prompts for API key)

交互式登录(提示输入API密钥)

bunx @temps-sdk/cli login
bunx @temps-sdk/cli login

Non-interactive login

非交互式登录

bunx @temps-sdk/cli login --api-key tk_abc123def456
bunx @temps-sdk/cli login --api-key tk_abc123def456

Login to specific server

登录到指定服务器

bunx @temps-sdk/cli login --api-key tk_abc123def456 -u https://temps.example.com

**Example output:**
Authenticating... Logged in as david@example.com (Admin) Credentials saved to ~/.temps/.secrets
undefined
bunx @temps-sdk/cli login --api-key tk_abc123def456 -u https://temps.example.com

**示例输出:**
正在验证身份... 已以 david@example.com(管理员)身份登录 凭据已保存到 ~/.temps/.secrets
undefined

Logout

登出

bash
bunx @temps-sdk/cli logout
Example output:
  Credentials cleared
bash
bunx @temps-sdk/cli logout
示例输出:
  凭据已清除

Who Am I

当前用户信息

bash
bunx @temps-sdk/cli whoami
bunx @temps-sdk/cli whoami --json
Example output:
  Current User
  ID        1
  Email     david@example.com
  Name      David
  Role      Admin
JSON output:
json
{
  "id": 1,
  "email": "david@example.com",
  "name": "David",
  "role": "admin"
}

bash
bunx @temps-sdk/cli whoami
bunx @temps-sdk/cli whoami --json
示例输出:
  当前用户
  ID        1
  邮箱     david@example.com
  姓名      David
  角色      管理员
JSON输出:
json
{
  "id": 1,
  "email": "david@example.com",
  "name": "David",
  "role": "admin"
}

Projects

项目管理

Aliases:
project
,
p
别名
project
p

List Projects

列出项目

bash
bunx @temps-sdk/cli projects list
bunx @temps-sdk/cli projects ls --json
bunx @temps-sdk/cli projects list --page 2 --per-page 10
Example output:
  Projects (3)
  ┌──────┬──────────────┬────────┬──────────────┬─────────────────────┐
  │ Name │ Slug         │ Preset │ Environments │ Created             │
  ├──────┼──────────────┼────────┼──────────────┼─────────────────────┤
  │ Blog │ blog         │ nextjs │ 2            │ 2025-01-15 10:30:00 │
  │ API  │ api-backend  │ nodejs │ 1            │ 2025-01-14 08:00:00 │
  │ Docs │ docs-site    │ static │ 1            │ 2025-01-12 14:00:00 │
  └──────┴──────────────┴────────┴──────────────┴─────────────────────┘
bash
bunx @temps-sdk/cli projects list
bunx @temps-sdk/cli projects ls --json
bunx @temps-sdk/cli projects list --page 2 --per-page 10
示例输出:
  项目列表(3个)
  ┌──────┬──────────────┬────────┬──────────────┬─────────────────────┐
  │ 名称 │ 标识(Slug) │ 预设模板 │ 环境数量 │ 创建时间             │
  ├──────┼──────────────┼────────┼──────────────┼─────────────────────┤
  │ 博客 │ blog         │ nextjs │ 2            │ 2025-01-15 10:30:00 │
  │ API  │ api-backend  │ nodejs │ 1            │ 2025-01-14 08:00:00 │
  │ 文档 │ docs-site    │ static │ 1            │ 2025-01-12 14:00:00 │
  └──────┴──────────────┴────────┴──────────────┴─────────────────────┘

Create Project

创建项目

bash
undefined
bash
undefined

Interactive creation

交互式创建

bunx @temps-sdk/cli projects create
bunx @temps-sdk/cli projects create

Non-interactive

非交互式创建

bunx @temps-sdk/cli projects create -n "My App" -d "Description of my app" --repo https://github.com/org/repo
undefined
bunx @temps-sdk/cli projects create -n "我的应用" -d "我的应用描述" --repo https://github.com/org/repo
undefined

Show Project

查看项目详情

bash
bunx @temps-sdk/cli projects show -p my-app
bunx @temps-sdk/cli projects show -p my-app --json
Example output:
  My App
  ID            5
  Slug          my-app
  Description   My application
  Preset        nextjs
  Main Branch   main
  Repository    org/my-app
  Created       1/15/2025, 10:30:00 AM
  Updated       1/20/2025, 3:45:00 PM
bash
bunx @temps-sdk/cli projects show -p my-app
bunx @temps-sdk/cli projects show -p my-app --json
示例输出:
  我的应用
  ID            5
  标识(Slug)  my-app
  描述   我的应用程序
  预设模板        nextjs
  主分支   main
  代码仓库    org/my-app
  创建时间       1/15/2025, 10:30:00 AM
  更新时间       1/20/2025, 3:45:00 PM

Update Project

更新项目信息

bash
undefined
bash
undefined

Update name and description

更新名称和描述

bunx @temps-sdk/cli projects update -p my-app -n "New Name" -d "New description"
bunx @temps-sdk/cli projects update -p my-app -n "新名称" -d "新描述"

Non-interactive mode

非交互式模式

bunx @temps-sdk/cli projects update -p my-app -n "New Name" -y
undefined
bunx @temps-sdk/cli projects update -p my-app -n "新名称" -y
undefined

Update Project Settings

更新项目设置

bash
undefined
bash
undefined

Update slug and enable attack mode

更新标识并启用攻击模式

bunx @temps-sdk/cli projects settings -p my-app --slug new-slug --attack-mode
bunx @temps-sdk/cli projects settings -p my-app --slug new-slug --attack-mode

Enable preview environments

启用预览环境

bunx @temps-sdk/cli projects settings -p my-app --preview-envs
bunx @temps-sdk/cli projects settings -p my-app --preview-envs

Disable attack mode

禁用攻击模式

bunx @temps-sdk/cli projects settings -p my-app --no-attack-mode
undefined
bunx @temps-sdk/cli projects settings -p my-app --no-attack-mode
undefined

Update Git Settings

更新Git设置

bash
bunx @temps-sdk/cli projects git -p my-app --owner myorg --repo myrepo --branch main --preset nextjs
bunx @temps-sdk/cli projects git -p my-app --directory apps/web --preset nextjs -y
bash
bunx @temps-sdk/cli projects git -p my-app --owner myorg --repo myrepo --branch main --preset nextjs
bunx @temps-sdk/cli projects git -p my-app --directory apps/web --preset nextjs -y

Update Deployment Config

更新部署配置

bash
undefined
bash
undefined

Scale replicas and set resource limits

调整副本数并设置资源限制

bunx @temps-sdk/cli projects config -p my-app --replicas 3 --cpu-limit 1 --memory-limit 512
bunx @temps-sdk/cli projects config -p my-app --replicas 3 --cpu-limit 1 --memory-limit 512

Enable auto-deploy

启用自动部署

bunx @temps-sdk/cli projects config -p my-app --auto-deploy
undefined
bunx @temps-sdk/cli projects config -p my-app --auto-deploy
undefined

Delete Project

删除项目

bash
bunx @temps-sdk/cli projects delete -p my-app
bunx @temps-sdk/cli projects rm -p my-app -f    # Skip confirmation

bash
bunx @temps-sdk/cli projects delete -p my-app
bunx @temps-sdk/cli projects rm -p my-app -f    # 跳过确认

Deployments

部署管理

Deploy from Git

从Git部署

bash
undefined
bash
undefined

Interactive deployment

交互式部署

bunx @temps-sdk/cli deploy my-app
bunx @temps-sdk/cli deploy my-app

Specify branch and environment

指定分支和环境

bunx @temps-sdk/cli deploy my-app -b feature/new-ui -e staging
bunx @temps-sdk/cli deploy my-app -b feature/new-ui -e staging

Fully automated

完全自动化部署

bunx @temps-sdk/cli deploy -p my-app -b main -e production -y

**Example output:**
Deploying my-app Branch main Environment production
Deployment started (ID: 42) Building... Pushing image... Starting containers... Deployment successful!
undefined
bunx @temps-sdk/cli deploy -p my-app -b main -e production -y

**示例输出:**
正在部署 my-app 分支 main 环境 production
部署已启动(ID: 42) 构建中... 推送镜像... 启动容器... 部署成功!
undefined

Deploy Static Files

部署静态文件

bash
undefined
bash
undefined

Deploy a directory

部署目录

bunx @temps-sdk/cli deploy:static --path ./dist -p my-app
bunx @temps-sdk/cli deploy:static --path ./dist -p my-app

Deploy an archive

部署压缩包

bunx @temps-sdk/cli deploy:static --path ./build.tar.gz -p my-app -e production -y
undefined
bunx @temps-sdk/cli deploy:static --path ./build.tar.gz -p my-app -e production -y
undefined

Deploy Docker Image

部署Docker镜像

bash
undefined
bash
undefined

Deploy a pre-built image

部署预构建镜像

bunx @temps-sdk/cli deploy:image --image ghcr.io/org/app:v1.0 -p my-app
bunx @temps-sdk/cli deploy:image --image ghcr.io/org/app:v1.0 -p my-app

With environment and automation

指定环境并自动化

bunx @temps-sdk/cli deploy:image --image registry.example.com/app:latest -p my-app -e staging -y
undefined
bunx @temps-sdk/cli deploy:image --image registry.example.com/app:latest -p my-app -e staging -y
undefined

Deploy Local Docker Image

部署本地Docker镜像

bash
undefined
bash
undefined

Build from Dockerfile and deploy

从Dockerfile构建并部署

bunx @temps-sdk/cli deploy:local-image -p my-app -f Dockerfile -c .
bunx @temps-sdk/cli deploy:local-image -p my-app -f Dockerfile -c .

Deploy an existing local image

部署现有本地镜像

bunx @temps-sdk/cli deploy:local-image --image my-app:latest -p my-app -e production -y
bunx @temps-sdk/cli deploy:local-image --image my-app:latest -p my-app -e production -y

With build arguments

带构建参数

bunx @temps-sdk/cli deploy:local-image -p my-app --build-arg NODE_ENV=production --build-arg API_URL=https://api.example.com
undefined
bunx @temps-sdk/cli deploy:local-image -p my-app --build-arg NODE_ENV=production --build-arg API_URL=https://api.example.com
undefined

List Deployments

列出部署记录

bash
bunx @temps-sdk/cli deployments list -p my-app
bunx @temps-sdk/cli deployments ls -p my-app --limit 5 --json
bunx @temps-sdk/cli deployments list -p my-app --page 2 --per-page 10 --environment-id 1
Example output:
  Deployments (3)
  ┌────┬─────────┬────────────┬────────────┬──────────┬─────────────────────┐
  │ ID │ Branch  │ Env        │ Status     │ Duration │ Created             │
  ├────┼─────────┼────────────┼────────────┼──────────┼─────────────────────┤
  │ 42 │ main    │ production │ ● running  │ 2m 15s   │ 2025-01-20 15:30:00 │
  │ 41 │ develop │ staging    │ ● running  │ 1m 45s   │ 2025-01-20 14:00:00 │
  │ 40 │ main    │ production │ ○ stopped  │ 3m 02s   │ 2025-01-19 10:00:00 │
  └────┴─────────┴────────────┴────────────┴──────────┴─────────────────────┘
bash
bunx @temps-sdk/cli deployments list -p my-app
bunx @temps-sdk/cli deployments ls -p my-app --limit 5 --json
bunx @temps-sdk/cli deployments list -p my-app --page 2 --per-page 10 --environment-id 1
示例输出:
  部署记录(3个)
  ┌────┬─────────┬────────────┬────────────┬──────────┬─────────────────────┐
  │ ID │ 分支  │ 环境        │ 状态     │ 耗时 │ 创建时间             │
  ├────┼─────────┼────────────┼────────────┼──────────┼─────────────────────┤
  │ 42 │ main    │ production │ ● 运行中  │ 2m 15s   │ 2025-01-20 15:30:00 │
  │ 41 │ develop │ staging    │ ● 运行中  │ 1m 45s   │ 2025-01-20 14:00:00 │
  │ 40 │ main    │ production │ ○ 已停止  │ 3m 02s   │ 2025-01-19 10:00:00 │
  └────┴─────────┴────────────┴────────────┴──────────┴─────────────────────┘

Deployment Status

部署状态

bash
bunx @temps-sdk/cli deployments status -p my-app -d 42
bunx @temps-sdk/cli deployments status -p my-app -d 42 --json
bash
bunx @temps-sdk/cli deployments status -p my-app -d 42
bunx @temps-sdk/cli deployments status -p my-app -d 42 --json

Deployment Lifecycle

部署生命周期管理

bash
undefined
bash
undefined

Rollback to previous deployment

回滚到上一次部署版本

bunx @temps-sdk/cli deployments rollback -p my-app -e production
bunx @temps-sdk/cli deployments rollback -p my-app -e production

Rollback to specific deployment

回滚到指定部署版本

bunx @temps-sdk/cli deployments rollback -p my-app --to 40
bunx @temps-sdk/cli deployments rollback -p my-app --to 40

Cancel a running deployment

取消正在运行的部署

bunx @temps-sdk/cli deployments cancel -p 5 -d 42
bunx @temps-sdk/cli deployments cancel -p 5 -d 42

Pause/resume

暂停/恢复部署

bunx @temps-sdk/cli deployments pause -p 5 -d 42 bunx @temps-sdk/cli deployments resume -p 5 -d 42
bunx @temps-sdk/cli deployments pause -p 5 -d 42 bunx @temps-sdk/cli deployments resume -p 5 -d 42

Teardown (remove all resources)

销毁部署(移除所有资源)

bunx @temps-sdk/cli deployments teardown -p 5 -d 42
undefined
bunx @temps-sdk/cli deployments teardown -p 5 -d 42
undefined

Deployment Logs

部署日志

bash
undefined
bash
undefined

View logs

查看日志

bunx @temps-sdk/cli logs -p my-app
bunx @temps-sdk/cli logs -p my-app

Stream logs in real-time

实时流式查看日志

bunx @temps-sdk/cli logs -p my-app -f
bunx @temps-sdk/cli logs -p my-app -f

Show last 50 lines from staging

查看staging环境最后50行日志

bunx @temps-sdk/cli logs -p my-app -e staging -n 50
bunx @temps-sdk/cli logs -p my-app -e staging -n 50

Logs for specific deployment

查看指定部署的日志

bunx @temps-sdk/cli logs -p my-app -d 42 -f

---
bunx @temps-sdk/cli logs -p my-app -d 42 -f

---

Environments

环境管理

List Environments

列出环境

bash
bunx @temps-sdk/cli environments list -p my-app
bunx @temps-sdk/cli environments ls -p my-app --json
bash
bunx @temps-sdk/cli environments list -p my-app
bunx @temps-sdk/cli environments ls -p my-app --json

Create Environment

创建环境

bash
bunx @temps-sdk/cli environments create -p my-app -n staging
bash
bunx @temps-sdk/cli environments create -p my-app -n staging

Delete Environment

删除环境

bash
bunx @temps-sdk/cli environments delete -p my-app -n staging
bunx @temps-sdk/cli environments rm -p my-app -n staging -f
bash
bunx @temps-sdk/cli environments delete -p my-app -n staging
bunx @temps-sdk/cli environments rm -p my-app -n staging -f

Environment Variables

环境变量

bash
undefined
bash
undefined

List all variables

列出所有变量

bunx @temps-sdk/cli environments vars list -p my-app -e production bunx @temps-sdk/cli environments vars list -p my-app -e production --json
bunx @temps-sdk/cli environments vars list -p my-app -e production bunx @temps-sdk/cli environments vars list -p my-app -e production --json

Get a specific variable

获取指定变量

bunx @temps-sdk/cli environments vars get -p my-app -e production -k DATABASE_URL
bunx @temps-sdk/cli environments vars get -p my-app -e production -k DATABASE_URL

Set a variable

设置变量

bunx @temps-sdk/cli environments vars set -p my-app -e production -k API_KEY -v "sk_live_abc123"
bunx @temps-sdk/cli environments vars set -p my-app -e production -k API_KEY -v "sk_live_abc123"

Set a secret variable (masked in UI)

设置保密变量(在UI中会被掩码显示)

bunx @temps-sdk/cli environments vars set -p my-app -e production -k SECRET_KEY -v "supersecret" --secret
bunx @temps-sdk/cli environments vars set -p my-app -e production -k SECRET_KEY -v "supersecret" --secret

Delete a variable

删除变量

bunx @temps-sdk/cli environments vars delete -p my-app -e production -k OLD_KEY -y
bunx @temps-sdk/cli environments vars delete -p my-app -e production -k OLD_KEY -y

Import from .env file

从.env文件导入变量

bunx @temps-sdk/cli environments vars import -p my-app -e production -f .env.production
bunx @temps-sdk/cli environments vars import -p my-app -e production -f .env.production

Export to file

导出变量到文件

bunx @temps-sdk/cli environments vars export -p my-app -e production -f .env.backup
undefined
bunx @temps-sdk/cli environments vars export -p my-app -e production -f .env.backup
undefined

Environment Resources

环境资源

bash
bunx @temps-sdk/cli environments resources -p my-app -e production --json
bash
bunx @temps-sdk/cli environments resources -p my-app -e production --json

Scale Environment

扩容环境

bash
bunx @temps-sdk/cli environments scale -p my-app -e production --replicas 3
bash
bunx @temps-sdk/cli environments scale -p my-app -e production --replicas 3

Cron Jobs

定时任务(Cron Jobs)

bash
undefined
bash
undefined

List cron jobs

列出定时任务

bunx @temps-sdk/cli environments crons list --project-id 5
bunx @temps-sdk/cli environments crons list --project-id 5

Show cron job details

查看定时任务详情

bunx @temps-sdk/cli environments crons show --id 1 --json
bunx @temps-sdk/cli environments crons show --id 1 --json

List cron executions

列出定时任务执行记录

bunx @temps-sdk/cli environments crons executions --cron-id 1 --limit 10

---
bunx @temps-sdk/cli environments crons executions --cron-id 1 --limit 10

---

Services (Databases, Caches, Storage)

服务管理(数据库、缓存、存储)

Alias:
svc
别名
svc

List Services

列出服务

bash
bunx @temps-sdk/cli services list
bunx @temps-sdk/cli services ls --json
Example output:
  External Services (2)
  ┌────┬───────────┬────────────┬─────────────┬──────────┐
  │ ID │ Name      │ Type       │ Version     │ Status   │
  ├────┼───────────┼────────────┼─────────────┼──────────┤
  │ 1  │ main-db   │ PostgreSQL │ 16-alpine   │ ● active │
  │ 2  │ cache     │ Redis      │ 7-alpine    │ ● active │
  └────┴───────────┴────────────┴─────────────┴──────────┘
bash
bunx @temps-sdk/cli services list
bunx @temps-sdk/cli services ls --json
示例输出:
  外部服务(2个)
  ┌────┬───────────┬────────────┬─────────────┬──────────┐
  │ ID │ 名称      │ 类型       │ 版本     │ 状态   │
  ├────┼───────────┼────────────┼─────────────┼──────────┤
  │ 1  │ main-db   │ PostgreSQL │ 16-alpine   │ ● 活跃 │
  │ 2  │ cache     │ Redis      │ 7-alpine    │ ● 活跃 │
  └────┴───────────┴────────────┴─────────────┴──────────┘

Create Service

创建服务

bash
undefined
bash
undefined

Interactive creation

交互式创建

bunx @temps-sdk/cli services create
bunx @temps-sdk/cli services create

Non-interactive

非交互式创建

bunx @temps-sdk/cli services create -t postgres -n main-db -y bunx @temps-sdk/cli services create -t redis -n cache -y bunx @temps-sdk/cli services create -t mongodb -n data-store -y bunx @temps-sdk/cli services create -t s3 -n files -y
bunx @temps-sdk/cli services create -t postgres -n main-db -y bunx @temps-sdk/cli services create -t redis -n cache -y bunx @temps-sdk/cli services create -t mongodb -n data-store -y bunx @temps-sdk/cli services create -t s3 -n files -y

With custom parameters

带自定义参数

bunx @temps-sdk/cli services create -t postgres -n analytics-db --parameters '{"version":"17-alpine"}' -y

**Service types**: `postgres`, `mongodb`, `redis`, `s3`
bunx @temps-sdk/cli services create -t postgres -n analytics-db --parameters '{"version":"17-alpine"}' -y

**服务类型**:`postgres`、`mongodb`、`redis`、`s3`

Show Service

查看服务详情

bash
bunx @temps-sdk/cli services show --id 1
bunx @temps-sdk/cli services show --id 1 --json
Example output:
  main-db
  ID            1
  Type          PostgreSQL
  Version       16-alpine
  Status        ● active
  Connection    postgresql://user:pass@localhost:5432/main
  Created       1/15/2025, 10:30:00 AM
  Updated       1/20/2025, 3:45:00 PM

  Parameters
  max_connections   200
  shared_buffers    256MB
bash
bunx @temps-sdk/cli services show --id 1
bunx @temps-sdk/cli services show --id 1 --json
示例输出:
  main-db
  ID            1
  类型          PostgreSQL
  版本       16-alpine
  状态        ● 活跃
  连接地址    postgresql://user:pass@localhost:5432/main
  创建时间       1/15/2025, 10:30:00 AM
  更新时间       1/20/2025, 3:45:00 PM

  参数配置
  max_connections   200
  shared_buffers    256MB

Service Lifecycle

服务生命周期管理

bash
undefined
bash
undefined

Start/stop

启动/停止服务

bunx @temps-sdk/cli services start --id 1 bunx @temps-sdk/cli services stop --id 1
bunx @temps-sdk/cli services start --id 1 bunx @temps-sdk/cli services stop --id 1

Update

更新服务

bunx @temps-sdk/cli services update --id 1 -n postgres:18-alpine
bunx @temps-sdk/cli services update --id 1 -n postgres:18-alpine

Upgrade version

升级版本

bunx @temps-sdk/cli services upgrade --id 1 -v postgres:18-alpine
bunx @temps-sdk/cli services upgrade --id 1 -v postgres:18-alpine

Remove

删除服务

bunx @temps-sdk/cli services remove --id 1 bunx @temps-sdk/cli services rm --id 1 -f
undefined
bunx @temps-sdk/cli services remove --id 1 bunx @temps-sdk/cli services rm --id 1 -f
undefined

Import Existing Service

导入现有服务

bash
undefined
bash
undefined

Import a running Docker container as a managed service

将运行中的Docker容器导入为托管服务

bunx @temps-sdk/cli services import -t postgres -n imported-db --container-id my-postgres-container -y
undefined
bunx @temps-sdk/cli services import -t postgres -n imported-db --container-id my-postgres-container -y
undefined

Link/Unlink to Projects

关联/取消关联项目

bash
undefined
bash
undefined

Link service to project (injects env vars)

将服务关联到项目(自动注入环境变量)

bunx @temps-sdk/cli services link --id 1 --project-id 5
bunx @temps-sdk/cli services link --id 1 --project-id 5

Unlink

取消关联

bunx @temps-sdk/cli services unlink --id 1 --project-id 5
bunx @temps-sdk/cli services unlink --id 1 --project-id 5

View linked projects

查看已关联的项目

bunx @temps-sdk/cli services projects --id 1
bunx @temps-sdk/cli services projects --id 1

View injected env vars

查看注入的环境变量

bunx @temps-sdk/cli services env --id 1 --project-id 5
bunx @temps-sdk/cli services env --id 1 --project-id 5

Get specific env var

获取指定环境变量

bunx @temps-sdk/cli services env-var --id 1 --project-id 5 --var DATABASE_URL
undefined
bunx @temps-sdk/cli services env-var --id 1 --project-id 5 --var DATABASE_URL
undefined

List Service Types

列出支持的服务类型

bash
bunx @temps-sdk/cli services types
bunx @temps-sdk/cli services types --json

bash
bunx @temps-sdk/cli services types
bunx @temps-sdk/cli services types --json

Git Providers

Git提供商管理

List Providers

列出提供商

bash
bunx @temps-sdk/cli providers list
bunx @temps-sdk/cli providers ls --json
bash
bunx @temps-sdk/cli providers list
bunx @temps-sdk/cli providers ls --json

Add Provider

添加提供商

bash
undefined
bash
undefined

Interactive

交互式添加

bunx @temps-sdk/cli providers add
bunx @temps-sdk/cli providers add

Non-interactive

非交互式添加

bunx @temps-sdk/cli providers add --type github --name "My GitHub" --token ghp_abc123 -y bunx @temps-sdk/cli providers add --type gitlab --name "My GitLab" --token glpat-abc123 -y
undefined
bunx @temps-sdk/cli providers add --type github --name "我的GitHub" --token ghp_abc123 -y bunx @temps-sdk/cli providers add --type gitlab --name "我的GitLab" --token glpat-abc123 -y
undefined

Manage Providers

管理提供商

bash
bunx @temps-sdk/cli providers show --id 1 --json
bunx @temps-sdk/cli providers activate --id 1
bunx @temps-sdk/cli providers deactivate --id 1
bunx @temps-sdk/cli providers remove --id 1 -f
bash
bunx @temps-sdk/cli providers show --id 1 --json
bunx @temps-sdk/cli providers activate --id 1
bunx @temps-sdk/cli providers deactivate --id 1
bunx @temps-sdk/cli providers remove --id 1 -f

Safe delete (checks for dependencies)

安全删除(检查依赖)

bunx @temps-sdk/cli providers safe-delete --id 1 -y bunx @temps-sdk/cli providers deletion-check --id 1 --json
undefined
bunx @temps-sdk/cli providers safe-delete --id 1 -y bunx @temps-sdk/cli providers deletion-check --id 1 --json
undefined

Git Connections

Git连接管理

bash
undefined
bash
undefined

Connect git to project

将Git与项目关联

bunx @temps-sdk/cli providers git connect --project my-app --provider-id 1 --repo org/repo --branch main
bunx @temps-sdk/cli providers git connect --project my-app --provider-id 1 --repo org/repo --branch main

List repos from provider

列出提供商的代码仓库

bunx @temps-sdk/cli providers git repos --id 1 bunx @temps-sdk/cli providers git repos --search "my-app" --language typescript --page 1 --per-page 50 bunx @temps-sdk/cli providers git repos --sort stars --direction desc --owner myorg
bunx @temps-sdk/cli providers git repos --id 1 bunx @temps-sdk/cli providers git repos --search "my-app" --language typescript --page 1 --per-page 50 bunx @temps-sdk/cli providers git repos --sort stars --direction desc --owner myorg

Manage connections

管理连接

bunx @temps-sdk/cli providers connections list --json bunx @temps-sdk/cli providers connections list --page 1 --per-page 50 --sort account_name --direction asc bunx @temps-sdk/cli providers connections show --id 1 bunx @temps-sdk/cli providers connections sync --id 1 bunx @temps-sdk/cli providers connections validate --id 1 bunx @temps-sdk/cli providers connections update-token --id 1 --token ghp_newtoken bunx @temps-sdk/cli providers connections activate --id 1 bunx @temps-sdk/cli providers connections deactivate --id 1 bunx @temps-sdk/cli providers connections delete --id 1 -y

---
bunx @temps-sdk/cli providers connections list --json bunx @temps-sdk/cli providers connections list --page 1 --per-page 50 --sort account_name --direction asc bunx @temps-sdk/cli providers connections show --id 1 bunx @temps-sdk/cli providers connections sync --id 1 bunx @temps-sdk/cli providers connections validate --id 1 bunx @temps-sdk/cli providers connections update-token --id 1 --token ghp_newtoken bunx @temps-sdk/cli providers connections activate --id 1 bunx @temps-sdk/cli providers connections deactivate --id 1 bunx @temps-sdk/cli providers connections delete --id 1 -y

---

Domains

域名管理

List Domains

列出域名

bash
bunx @temps-sdk/cli domains list -p my-app
bunx @temps-sdk/cli domains ls -p my-app --json
bash
bunx @temps-sdk/cli domains list -p my-app
bunx @temps-sdk/cli domains ls -p my-app --json

Add Domain

添加域名

bash
bunx @temps-sdk/cli domains add -p my-app -d example.com -y
bash
bunx @temps-sdk/cli domains add -p my-app -d example.com -y

Verify & Status

验证与状态查询

bash
bunx @temps-sdk/cli domains verify -p my-app -d example.com
bunx @temps-sdk/cli domains status -p my-app -d example.com --json
bunx @temps-sdk/cli domains ssl -p my-app -d example.com --json
bash
bunx @temps-sdk/cli domains verify -p my-app -d example.com
bunx @temps-sdk/cli domains status -p my-app -d example.com --json
bunx @temps-sdk/cli domains ssl -p my-app -d example.com --json

Remove Domain

删除域名

bash
bunx @temps-sdk/cli domains remove -p my-app -d example.com -f
bash
bunx @temps-sdk/cli domains remove -p my-app -d example.com -f

Certificate Orders

证书订单管理

bash
undefined
bash
undefined

List certificate orders

列出证书订单

bunx @temps-sdk/cli domains orders list --json
bunx @temps-sdk/cli domains orders list --json

Create order

创建证书订单

bunx @temps-sdk/cli domains orders create --domain-id 1 --challenge-type http-01
bunx @temps-sdk/cli domains orders create --domain-id 1 --challenge-type http-01

Show order details

查看订单详情

bunx @temps-sdk/cli domains orders show --order-id 1 --json
bunx @temps-sdk/cli domains orders show --order-id 1 --json

Finalize (verify challenge and issue certificate)

完成订单(验证挑战并颁发证书)

bunx @temps-sdk/cli domains orders finalize --domain-id 1
bunx @temps-sdk/cli domains orders finalize --domain-id 1

Cancel order

取消订单

bunx @temps-sdk/cli domains orders cancel --order-id 1 -y
undefined
bunx @temps-sdk/cli domains orders cancel --order-id 1 -y
undefined

DNS Challenges

DNS挑战管理

bash
undefined
bash
undefined

Get DNS challenge record to add

获取需要添加的DNS挑战记录

bunx @temps-sdk/cli domains dns-challenge --domain-id 1 --json
bunx @temps-sdk/cli domains dns-challenge --domain-id 1 --json

Debug HTTP challenge accessibility

调试HTTP挑战的可访问性

bunx @temps-sdk/cli domains http-debug --domain example.com --token abc123 --expected xyz789

---
bunx @temps-sdk/cli domains http-debug --domain example.com --token abc123 --expected xyz789

---

Custom Domains

自定义域名管理

Alias:
cdom
bash
undefined
别名
cdom
bash
undefined

List custom domains

列出自定义域名

bunx @temps-sdk/cli custom-domains list --project-id 5 --json
bunx @temps-sdk/cli custom-domains list --project-id 5 --json

Create with environment targeting

创建带环境目标的自定义域名

bunx @temps-sdk/cli custom-domains create --project-id 5 -d app.example.com --environment-id 1 -y
bunx @temps-sdk/cli custom-domains create --project-id 5 -d app.example.com --environment-id 1 -y

Create redirect domain

创建重定向域名

bunx @temps-sdk/cli custom-domains create --project-id 5 -d old.example.com --redirect-to https://new.example.com --status-code 301 -y
bunx @temps-sdk/cli custom-domains create --project-id 5 -d old.example.com --redirect-to https://new.example.com --status-code 301 -y

Show details

查看详情

bunx @temps-sdk/cli custom-domains show --project-id 5 --domain-id 1 --json
bunx @temps-sdk/cli custom-domains show --project-id 5 --domain-id 1 --json

Update

更新自定义域名

bunx @temps-sdk/cli custom-domains update --project-id 5 --domain-id 1 --branch feature/v2
bunx @temps-sdk/cli custom-domains update --project-id 5 --domain-id 1 --branch feature/v2

Link certificate

关联证书

bunx @temps-sdk/cli custom-domains link-cert --project-id 5 --domain-id 1 --certificate-id 3
bunx @temps-sdk/cli custom-domains link-cert --project-id 5 --domain-id 1 --certificate-id 3

Remove

删除自定义域名

bunx @temps-sdk/cli custom-domains remove --project-id 5 --domain-id 1 -f

---
bunx @temps-sdk/cli custom-domains remove --project-id 5 --domain-id 1 -f

---

DNS Management

DNS管理

bash
undefined
bash
undefined

List DNS records

列出DNS记录

bunx @temps-sdk/cli dns list --json
bunx @temps-sdk/cli dns list --json

Add record

添加DNS记录

bunx @temps-sdk/cli dns add --type A --name app --content 1.2.3.4 --ttl 3600 -y
bunx @temps-sdk/cli dns add --type A --name app --content 1.2.3.4 --ttl 3600 -y

Show record

查看DNS记录详情

bunx @temps-sdk/cli dns show --id 1 --json
bunx @temps-sdk/cli dns show --id 1 --json

Test DNS resolution

测试DNS解析

bunx @temps-sdk/cli dns test --name app.example.com --type A --json
bunx @temps-sdk/cli dns test --name app.example.com --type A --json

List zones

列出DNS区域

bunx @temps-sdk/cli dns zones --json
bunx @temps-sdk/cli dns zones --json

Remove record

删除DNS记录

bunx @temps-sdk/cli dns remove --id 1 -f

---
bunx @temps-sdk/cli dns remove --id 1 -f

---

DNS Providers

DNS提供商管理

Alias:
dnsp
bash
undefined
别名
dnsp
bash
undefined

List DNS providers

列出DNS提供商

bunx @temps-sdk/cli dns-providers list --json
bunx @temps-sdk/cli dns-providers list --json

Create Cloudflare provider

创建Cloudflare提供商

bunx @temps-sdk/cli dns-providers create -n "Cloudflare" -t cloudflare --api-token cf_abc123 -y
bunx @temps-sdk/cli dns-providers create -n "Cloudflare" -t cloudflare --api-token cf_abc123 -y

Create Route53 provider

创建Route53提供商

bunx @temps-sdk/cli dns-providers create -n "AWS" -t route53 --access-key-id AKIA... --secret-access-key secret --region us-east-1 -y
bunx @temps-sdk/cli dns-providers create -n "AWS" -t route53 --access-key-id AKIA... --secret-access-key secret --region us-east-1 -y

Test provider connection

测试提供商连接

bunx @temps-sdk/cli dns-providers test --id 1
bunx @temps-sdk/cli dns-providers test --id 1

List provider zones

列出提供商的区域

bunx @temps-sdk/cli dns-providers zones --id 1 --json
bunx @temps-sdk/cli dns-providers zones --id 1 --json

Manage domains

管理域名

bunx @temps-sdk/cli dns-providers domains list --id 1 --json bunx @temps-sdk/cli dns-providers domains add --id 1 -d example.com --auto-manage bunx @temps-sdk/cli dns-providers domains verify --provider-id 1 -d example.com bunx @temps-sdk/cli dns-providers domains remove --provider-id 1 -d example.com -f
bunx @temps-sdk/cli dns-providers domains list --id 1 --json bunx @temps-sdk/cli dns-providers domains add --id 1 -d example.com --auto-manage bunx @temps-sdk/cli dns-providers domains verify --provider-id 1 -d example.com bunx @temps-sdk/cli dns-providers domains remove --provider-id 1 -d example.com -f

DNS lookup

DNS查询

bunx @temps-sdk/cli dns-providers lookup -d example.com --json

**Provider types**: `cloudflare`, `namecheap`, `route53`, `digitalocean`, `gcp`, `azure`, `manual`

---
bunx @temps-sdk/cli dns-providers lookup -d example.com --json

**提供商类型**:`cloudflare`、`namecheap`、`route53`、`digitalocean`、`gcp`、`azure`、`manual`

---

Notifications

通知管理

Notification Providers

通知提供商管理

bash
undefined
bash
undefined

List providers

列出提供商

bunx @temps-sdk/cli notifications list --json
bunx @temps-sdk/cli notifications list --json

Add Slack provider

添加Slack提供商

bunx @temps-sdk/cli notifications add --type slack --name "Alerts" --webhook-url https://hooks.slack.com/... --channel "#alerts" -y
bunx @temps-sdk/cli notifications add --type slack --name "告警通知" --webhook-url https://hooks.slack.com/... --channel "#alerts" -y

Add Email provider

添加邮件提供商

bunx @temps-sdk/cli notifications add --type email --name "Email Alerts" --smtp-host smtp.gmail.com --smtp-port 587 --smtp-user user@gmail.com --smtp-pass apppassword --from alerts@example.com --to team@example.com -y
bunx @temps-sdk/cli notifications add --type email --name "邮件告警" --smtp-host smtp.gmail.com --smtp-port 587 --smtp-user user@gmail.com --smtp-pass apppassword --from alerts@example.com --to team@example.com -y

Add Webhook provider

添加Webhook提供商

bunx @temps-sdk/cli notifications add --type webhook --name "Custom Hook" --url https://example.com/webhook --secret mysecret -y
bunx @temps-sdk/cli notifications add --type webhook --name "自定义钩子" --url https://example.com/webhook --secret mysecret -y

Show/manage providers

查看/管理提供商

bunx @temps-sdk/cli notifications show --id 1 --json bunx @temps-sdk/cli notifications enable --id 1 bunx @temps-sdk/cli notifications disable --id 1 bunx @temps-sdk/cli notifications update --id 1 --name "New Name" bunx @temps-sdk/cli notifications test --id 1 bunx @temps-sdk/cli notifications remove --id 1 -f
undefined
bunx @temps-sdk/cli notifications show --id 1 --json bunx @temps-sdk/cli notifications enable --id 1 bunx @temps-sdk/cli notifications disable --id 1 bunx @temps-sdk/cli notifications update --id 1 --name "新名称" bunx @temps-sdk/cli notifications test --id 1 bunx @temps-sdk/cli notifications remove --id 1 -f
undefined

Notification Preferences

通知偏好设置

Alias:
notif-prefs
bash
undefined
别名
notif-prefs
bash
undefined

Show current preferences

查看当前偏好设置

bunx @temps-sdk/cli notification-preferences show --json
bunx @temps-sdk/cli notification-preferences show --json

Update preferences

更新偏好设置

bunx @temps-sdk/cli notification-preferences update -k email_enabled -v true bunx @temps-sdk/cli notification-preferences update -k deployment_failures_enabled -v true bunx @temps-sdk/cli notification-preferences update -k ssl_days_before_expiration -v 30 bunx @temps-sdk/cli notification-preferences update -k minimum_severity -v warning
bunx @temps-sdk/cli notification-preferences update -k email_enabled -v true bunx @temps-sdk/cli notification-preferences update -k deployment_failures_enabled -v true bunx @temps-sdk/cli notification-preferences update -k ssl_days_before_expiration -v 30 bunx @temps-sdk/cli notification-preferences update -k minimum_severity -v warning

Reset to defaults

重置为默认设置

bunx @temps-sdk/cli notification-preferences reset -y

**Available preference keys:**
- **Boolean**: `email_enabled`, `slack_enabled`, `weekly_digest_enabled`, `batch_similar_notifications`, `deployment_failures_enabled`, `build_errors_enabled`, `runtime_errors_enabled`, `ssl_expiration_enabled`, `domain_expiration_enabled`, `dns_changes_enabled`, `backup_failures_enabled`, `backup_successes_enabled`, `route_downtime_enabled`, `load_balancer_issues_enabled`, `s3_connection_issues_enabled`, `retention_policy_violations_enabled`
- **Numbers**: `error_threshold`, `error_time_window`, `ssl_days_before_expiration`
- **Strings**: `minimum_severity`, `digest_send_time`, `digest_send_day`

---
bunx @temps-sdk/cli notification-preferences reset -y

**可用偏好键:**
- **布尔型**:`email_enabled`、`slack_enabled`、`weekly_digest_enabled`、`batch_similar_notifications`、`deployment_failures_enabled`、`build_errors_enabled`、`runtime_errors_enabled`、`ssl_expiration_enabled`、`domain_expiration_enabled`、`dns_changes_enabled`、`backup_failures_enabled`、`backup_successes_enabled`、`route_downtime_enabled`、`load_balancer_issues_enabled`、`s3_connection_issues_enabled`、`retention_policy_violations_enabled`
- **数值型**:`error_threshold`、`error_time_window`、`ssl_days_before_expiration`
- **字符串型**:`minimum_severity`、`digest_send_time`、`digest_send_day`

---

Monitoring

监控管理

Monitors

监控器管理

bash
undefined
bash
undefined

List monitors

列出监控器

bunx @temps-sdk/cli monitors list --project-id 5 --json
bunx @temps-sdk/cli monitors list --project-id 5 --json

Create HTTP monitor

创建HTTP监控器

bunx @temps-sdk/cli monitors create --project-id 5 -n "API Health" -t http -i 60 -y
bunx @temps-sdk/cli monitors create --project-id 5 -n "API健康检查" -t http -i 60 -y

Create TCP monitor

创建TCP监控器

bunx @temps-sdk/cli monitors create --project-id 5 -n "DB Connection" -t tcp -i 300 -y
bunx @temps-sdk/cli monitors create --project-id 5 -n "数据库连接检查" -t tcp -i 300 -y

Show details

查看监控器详情

bunx @temps-sdk/cli monitors show --id 1 --json
bunx @temps-sdk/cli monitors show --id 1 --json

Current status

当前状态

bunx @temps-sdk/cli monitors status --id 1 --json
bunx @temps-sdk/cli monitors status --id 1 --json

Uptime history

上线历史

bunx @temps-sdk/cli monitors history --id 1 --days 30 --json
bunx @temps-sdk/cli monitors history --id 1 --days 30 --json

Remove

删除监控器

bunx @temps-sdk/cli monitors remove --id 1 -f

**Monitor types**: `http`, `tcp`, `ping`
**Intervals**: `60`, `300`, `600`, `900`, `1800` seconds
bunx @temps-sdk/cli monitors remove --id 1 -f

**监控器类型**:`http`、`tcp`、`ping`
**检查间隔**:`60`、`300`、`600`、`900`、`1800`秒

Incidents

事件管理

Alias:
incident
bash
undefined
别名
incident
bash
undefined

List incidents

列出事件

bunx @temps-sdk/cli incidents list --project-id 5 --status investigating --json bunx @temps-sdk/cli incidents list --project-id 5 --page 1 --page-size 20 --environment-id 1
bunx @temps-sdk/cli incidents list --project-id 5 --status investigating --json bunx @temps-sdk/cli incidents list --project-id 5 --page 1 --page-size 20 --environment-id 1

Create incident

创建事件

bunx @temps-sdk/cli incidents create --project-id 5 -t "API Degradation" -d "High response times" -s major -y
bunx @temps-sdk/cli incidents create --project-id 5 -t "API性能下降" -d "响应时间过长" -s major -y

Show incident

查看事件详情

bunx @temps-sdk/cli incidents show --id 1 --json
bunx @temps-sdk/cli incidents show --id 1 --json

Update status

更新事件状态

bunx @temps-sdk/cli incidents update-status --id 1 -s monitoring -m "Fix deployed, monitoring" bunx @temps-sdk/cli incidents update-status --id 1 -s resolved -m "Issue resolved"
bunx @temps-sdk/cli incidents update-status --id 1 -s monitoring -m "修复已部署,正在监控" bunx @temps-sdk/cli incidents update-status --id 1 -s resolved -m "问题已解决"

List updates

列出事件更新记录

bunx @temps-sdk/cli incidents updates --id 1 --json
bunx @temps-sdk/cli incidents updates --id 1 --json

Bucketed incidents (time series)

按时间分组的事件统计

bunx @temps-sdk/cli incidents bucketed --project-id 5 -i hourly --json

**Severities**: `critical`, `major`, `minor`
**Statuses**: `investigating`, `identified`, `monitoring`, `resolved`

---
bunx @temps-sdk/cli incidents bucketed --project-id 5 -i hourly --json

**事件严重级别**:`critical`、`major`、`minor`
**事件状态**:`investigating`、`identified`、`monitoring`、`resolved`

---

Containers

容器管理

Alias:
cts
bash
undefined
别名
cts
bash
undefined

List containers

列出容器

bunx @temps-sdk/cli containers list -p 5 -e 1 --json
bunx @temps-sdk/cli containers list -p 5 -e 1 --json

Show container details

查看容器详情

bunx @temps-sdk/cli containers show -p 5 -e 1 -c abc123 --json
bunx @temps-sdk/cli containers show -p 5 -e 1 -c abc123 --json

Start/stop/restart

启动/停止/重启容器

bunx @temps-sdk/cli containers start -p 5 -e 1 -c abc123 bunx @temps-sdk/cli containers stop -p 5 -e 1 -c abc123 bunx @temps-sdk/cli containers restart -p 5 -e 1 -c abc123
bunx @temps-sdk/cli containers start -p 5 -e 1 -c abc123 bunx @temps-sdk/cli containers stop -p 5 -e 1 -c abc123 bunx @temps-sdk/cli containers restart -p 5 -e 1 -c abc123

Force stop

强制停止容器

bunx @temps-sdk/cli containers stop -p 5 -e 1 -c abc123 -f
bunx @temps-sdk/cli containers stop -p 5 -e 1 -c abc123 -f

Live metrics (auto-refresh)

实时指标(自动刷新)

bunx @temps-sdk/cli containers metrics -p 5 -e 1 -c abc123 -w -i 2 bunx @temps-sdk/cli containers metrics -p 5 -e 1 -c abc123 --json

---
bunx @temps-sdk/cli containers metrics -p 5 -e 1 -c abc123 -w -i 2 bunx @temps-sdk/cli containers metrics -p 5 -e 1 -c abc123 --json

---

Runtime Logs

运行时日志

Alias:
rtlogs
bash
undefined
别名
rtlogs
bash
undefined

Stream container runtime logs

流式查看容器运行时日志

bunx @temps-sdk/cli runtime-logs -p my-app
bunx @temps-sdk/cli runtime-logs -p my-app

Follow mode with specific environment

跟踪指定环境的日志

bunx @temps-sdk/cli runtime-logs -p my-app -e staging -f
bunx @temps-sdk/cli runtime-logs -p my-app -e staging -f

Show specific container

查看指定容器的最后200行日志

bunx @temps-sdk/cli runtime-logs -p my-app --container web-1 --tail 200
bunx @temps-sdk/cli runtime-logs -p my-app --container web-1 --tail 200

JSON output

JSON格式输出

bunx @temps-sdk/cli runtime-logs -p my-app --json

---
bunx @temps-sdk/cli runtime-logs -p my-app --json

---

Backups

备份管理

Backup Sources

备份源管理

bash
undefined
bash
undefined

List sources

列出备份源

bunx @temps-sdk/cli backups sources list --json
bunx @temps-sdk/cli backups sources list --json

Create source

创建备份源

bunx @temps-sdk/cli backups sources create -n "Main DB" --source-type postgres --connection-string "postgresql://..." -y
bunx @temps-sdk/cli backups sources create -n "主数据库" --source-type postgres --connection-string "postgresql://..." -y

Show source

查看备份源详情

bunx @temps-sdk/cli backups sources show --id 1 --json
bunx @temps-sdk/cli backups sources show --id 1 --json

Update source

更新备份源

bunx @temps-sdk/cli backups sources update --id 1 -n "Primary DB"
bunx @temps-sdk/cli backups sources update --id 1 -n "主数据库(更新后)"

List backups for source

列出备份源的备份记录

bunx @temps-sdk/cli backups sources backups --id 1 --json
bunx @temps-sdk/cli backups sources backups --id 1 --json

Trigger manual backup

触发手动备份

bunx @temps-sdk/cli backups sources run --id 1
bunx @temps-sdk/cli backups sources run --id 1

Remove source

删除备份源

bunx @temps-sdk/cli backups sources remove --id 1 -f
undefined
bunx @temps-sdk/cli backups sources remove --id 1 -f
undefined

Backup Schedules

备份计划管理

bash
undefined
bash
undefined

List schedules

列出备份计划

bunx @temps-sdk/cli backups schedules list --json
bunx @temps-sdk/cli backups schedules list --json

Create schedule

创建备份计划

bunx @temps-sdk/cli backups schedules create --source-id 1 --cron "0 2 * * *" --retention-count 7 --storage-backend local -y
bunx @temps-sdk/cli backups schedules create --source-id 1 --cron "0 2 * * *" --retention-count 7 --storage-backend local -y

Show schedule

查看备份计划详情

bunx @temps-sdk/cli backups schedules show --id 1 --json
bunx @temps-sdk/cli backups schedules show --id 1 --json

Enable/disable

启用/禁用备份计划

bunx @temps-sdk/cli backups schedules enable --id 1 bunx @temps-sdk/cli backups schedules disable --id 1
bunx @temps-sdk/cli backups schedules enable --id 1 bunx @temps-sdk/cli backups schedules disable --id 1

Delete schedule

删除备份计划

bunx @temps-sdk/cli backups schedules delete --id 1 -f
undefined
bunx @temps-sdk/cli backups schedules delete --id 1 -f
undefined

Backups

备份记录管理

bash
undefined
bash
undefined

List all backups

列出所有备份记录

bunx @temps-sdk/cli backups list --json
bunx @temps-sdk/cli backups list --json

Show backup details

查看备份详情

bunx @temps-sdk/cli backups show --id 1 --json
bunx @temps-sdk/cli backups show --id 1 --json

Run a service backup

触发服务备份

bunx @temps-sdk/cli backups run-service --service-id 1 --json

---
bunx @temps-sdk/cli backups run-service --service-id 1 --json

---

Security Scanning

安全扫描

Alias:
scan
bash
undefined
别名
scan
bash
undefined

List project scans

列出项目扫描记录

bunx @temps-sdk/cli scans list --project-id 5 --json bunx @temps-sdk/cli scans list --project-id 5 --page 2 --page-size 10
bunx @temps-sdk/cli scans list --project-id 5 --json bunx @temps-sdk/cli scans list --project-id 5 --page 2 --page-size 10

Trigger scan

触发安全扫描

bunx @temps-sdk/cli scans trigger --project-id 5 --environment-id 1
bunx @temps-sdk/cli scans trigger --project-id 5 --environment-id 1

Latest scan

查看最新扫描结果

bunx @temps-sdk/cli scans latest --project-id 5 --json
bunx @temps-sdk/cli scans latest --project-id 5 --json

Scans per environment

按环境查看扫描记录

bunx @temps-sdk/cli scans environments --project-id 5 --json
bunx @temps-sdk/cli scans environments --project-id 5 --json

Show scan details

查看扫描详情

bunx @temps-sdk/cli scans show --id 1 --json
bunx @temps-sdk/cli scans show --id 1 --json

List vulnerabilities

列出漏洞

bunx @temps-sdk/cli scans vulnerabilities --id 1 --json bunx @temps-sdk/cli scans vulns --id 1 --severity CRITICAL --json
bunx @temps-sdk/cli scans vulnerabilities --id 1 --json bunx @temps-sdk/cli scans vulns --id 1 --severity CRITICAL --json

Scan by deployment

按部署查看扫描记录

bunx @temps-sdk/cli scans by-deployment --deployment-id 42 --json
bunx @temps-sdk/cli scans by-deployment --deployment-id 42 --json

Remove scan

删除扫描记录

bunx @temps-sdk/cli scans remove --id 1 -f

**Severity filter**: `CRITICAL`, `HIGH`, `MEDIUM`, `LOW`

---
bunx @temps-sdk/cli scans remove --id 1 -f

**严重级别过滤**:`CRITICAL`、`HIGH`、`MEDIUM`、`LOW`

---

Error Tracking

错误追踪

Alias:
error
bash
undefined
别名
error
bash
undefined

List error groups

列出错误分组

bunx @temps-sdk/cli errors list --project-id 5 --json bunx @temps-sdk/cli errors list --project-id 5 --status unresolved --page 1 --page-size 20 bunx @temps-sdk/cli errors list --project-id 5 --environment-id 1 --start-date 2025-01-01 --end-date 2025-01-31 bunx @temps-sdk/cli errors list --project-id 5 --sort-by total_count --sort-order desc
bunx @temps-sdk/cli errors list --project-id 5 --json bunx @temps-sdk/cli errors list --project-id 5 --status unresolved --page 1 --page-size 20 bunx @temps-sdk/cli errors list --project-id 5 --environment-id 1 --start-date 2025-01-01 --end-date 2025-01-31 bunx @temps-sdk/cli errors list --project-id 5 --sort-by total_count --sort-order desc

Show error group

查看错误分组详情

bunx @temps-sdk/cli errors show --project-id 5 --group-id abc123 --json
bunx @temps-sdk/cli errors show --project-id 5 --group-id abc123 --json

Update error group status

更新错误分组状态

bunx @temps-sdk/cli errors update --project-id 5 --group-id abc123 --status resolved
bunx @temps-sdk/cli errors update --project-id 5 --group-id abc123 --status resolved

List events for error group

列出错误分组的事件记录

bunx @temps-sdk/cli errors events --project-id 5 --group-id abc123 --json
bunx @temps-sdk/cli errors events --project-id 5 --group-id abc123 --json

Show single event

查看单个事件详情

bunx @temps-sdk/cli errors event --project-id 5 --group-id abc123 --event-id evt456 --json
bunx @temps-sdk/cli errors event --project-id 5 --group-id abc123 --event-id evt456 --json

Statistics

错误统计

bunx @temps-sdk/cli errors stats --project-id 5 --json
bunx @temps-sdk/cli errors stats --project-id 5 --json

Timeline

错误时间线

bunx @temps-sdk/cli errors timeline --project-id 5 --days 7 --bucket 1h --json
bunx @temps-sdk/cli errors timeline --project-id 5 --days 7 --bucket 1h --json

Dashboard

错误仪表板

bunx @temps-sdk/cli errors dashboard --project-id 5 --days 7 --compare --json

**Statuses**: `unresolved`, `resolved`, `ignored`

---
bunx @temps-sdk/cli errors dashboard --project-id 5 --days 7 --compare --json

**错误状态**:`unresolved`、`resolved`、`ignored`

---

Webhooks

Webhook管理

Alias:
hooks
bash
undefined
别名
hooks
bash
undefined

List webhooks

列出Webhook

bunx @temps-sdk/cli webhooks list --project-id 5 --json
bunx @temps-sdk/cli webhooks list --project-id 5 --json

List deliveries with limit

列出Webhook交付记录(带数量限制)

bunx @temps-sdk/cli webhooks deliveries list --project-id 5 --webhook-id 1 --limit 100 --json
bunx @temps-sdk/cli webhooks deliveries list --project-id 5 --webhook-id 1 --limit 100 --json

Create webhook

创建Webhook

bunx @temps-sdk/cli webhooks create --project-id 5 -u https://example.com/webhook -e "deployment.success,deployment.failed" -s mysecret -y
bunx @temps-sdk/cli webhooks create --project-id 5 -u https://example.com/webhook -e "deployment.success,deployment.failed" -s mysecret -y

Show webhook

查看Webhook详情

bunx @temps-sdk/cli webhooks show --project-id 5 --webhook-id 1 --json
bunx @temps-sdk/cli webhooks show --project-id 5 --webhook-id 1 --json

Update webhook

更新Webhook

bunx @temps-sdk/cli webhooks update --project-id 5 --webhook-id 1 -u https://new-endpoint.com/webhook
bunx @temps-sdk/cli webhooks update --project-id 5 --webhook-id 1 -u https://new-endpoint.com/webhook

Enable/disable

启用/禁用Webhook

bunx @temps-sdk/cli webhooks enable --project-id 5 --webhook-id 1 bunx @temps-sdk/cli webhooks disable --project-id 5 --webhook-id 1
bunx @temps-sdk/cli webhooks enable --project-id 5 --webhook-id 1 bunx @temps-sdk/cli webhooks disable --project-id 5 --webhook-id 1

List available event types

列出支持的事件类型

bunx @temps-sdk/cli webhooks events --json
bunx @temps-sdk/cli webhooks events --json

View deliveries

查看交付记录

bunx @temps-sdk/cli webhooks deliveries list --project-id 5 --webhook-id 1 --json bunx @temps-sdk/cli webhooks deliveries show --project-id 5 --webhook-id 1 --delivery-id 1 --json
bunx @temps-sdk/cli webhooks deliveries list --project-id 5 --webhook-id 1 --json bunx @temps-sdk/cli webhooks deliveries show --project-id 5 --webhook-id 1 --delivery-id 1 --json

Retry failed delivery

重试失败的交付

bunx @temps-sdk/cli webhooks deliveries retry --project-id 5 --webhook-id 1 --delivery-id 1
bunx @temps-sdk/cli webhooks deliveries retry --project-id 5 --webhook-id 1 --delivery-id 1

Remove webhook

删除Webhook

bunx @temps-sdk/cli webhooks remove --project-id 5 --webhook-id 1 -f

---
bunx @temps-sdk/cli webhooks remove --project-id 5 --webhook-id 1 -f

---

API Keys

API密钥管理

Alias:
keys
bash
undefined
别名
keys
bash
undefined

List API keys

列出API密钥

bunx @temps-sdk/cli apikeys list --json
bunx @temps-sdk/cli apikeys list --json

Create API key

创建API密钥

bunx @temps-sdk/cli apikeys create -n "CI/CD Key" -r developer -e 90 -y
bunx @temps-sdk/cli apikeys create -n "CI/CD密钥" -r developer -e 90 -y

Create with specific permissions

创建带特定权限的API密钥

bunx @temps-sdk/cli apikeys create -n "Deploy Only" -r developer -p "deployments:create,deployments:read" -e 30 -y
bunx @temps-sdk/cli apikeys create -n "仅部署权限" -r developer -p "deployments:create,deployments:read" -e 30 -y

Show key details

查看API密钥详情

bunx @temps-sdk/cli apikeys show --id 1 --json
bunx @temps-sdk/cli apikeys show --id 1 --json

Activate/deactivate

激活/停用API密钥

bunx @temps-sdk/cli apikeys activate --id 1 bunx @temps-sdk/cli apikeys deactivate --id 1
bunx @temps-sdk/cli apikeys activate --id 1 bunx @temps-sdk/cli apikeys deactivate --id 1

List available permissions

列出可用权限

bunx @temps-sdk/cli apikeys permissions --json
bunx @temps-sdk/cli apikeys permissions --json

Remove

删除API密钥

bunx @temps-sdk/cli apikeys remove --id 1 -f

**Roles**: `admin`, `developer`, `viewer`, `readonly`
**Expiry**: `7`, `30`, `90`, `365` days

---
bunx @temps-sdk/cli apikeys remove --id 1 -f

**角色**:`admin`、`developer`、`viewer`、`readonly`
**有效期**:`7`、`30`、`90`、`365`天

---

Deployment Tokens

部署令牌管理

Alias:
token
bash
undefined
别名
token
bash
undefined

List tokens

列出部署令牌

bunx @temps-sdk/cli tokens list -p my-app --json
bunx @temps-sdk/cli tokens list -p my-app --json

Create token

创建部署令牌

bunx @temps-sdk/cli tokens create -p my-app -n "Analytics Token" --permissions "analytics:read,events:write" -e 90 -y
bunx @temps-sdk/cli tokens create -p my-app -n "分析令牌" --permissions "analytics:read,events:write" -e 90 -y

Show token

查看部署令牌详情

bunx @temps-sdk/cli tokens show -p my-app --id 1 --json
bunx @temps-sdk/cli tokens show -p my-app --id 1 --json

Delete token

删除部署令牌

bunx @temps-sdk/cli tokens delete -p my-app --id 1 -f
bunx @temps-sdk/cli tokens delete -p my-app --id 1 -f

List available permissions

列出可用权限

bunx @temps-sdk/cli tokens permissions --json

**Permissions**: `*`, `visitors:enrich`, `emails:send`, `analytics:read`, `events:write`, `errors:read`
**Expiry**: `7`, `30`, `90`, `365`, `never`

---
bunx @temps-sdk/cli tokens permissions --json

**权限**:`*`、`visitors:enrich`、`emails:send`、`analytics:read`、`events:write`、`errors:read`
**有效期**:`7`、`30`、`90`、`365`、`never`(永久)

---

Users

用户管理

bash
undefined
bash
undefined

List users

列出用户

bunx @temps-sdk/cli users list --json
bunx @temps-sdk/cli users list --json

Create user

创建用户

bunx @temps-sdk/cli users create --email user@example.com --name "New User" --password "secure123" --role developer -y
bunx @temps-sdk/cli users create --email user@example.com --name "新用户" --password "secure123" --role developer -y

Show current user

查看当前用户信息

bunx @temps-sdk/cli users me --json
bunx @temps-sdk/cli users me --json

Change user role

变更用户角色

bunx @temps-sdk/cli users role --id 2 --role admin
bunx @temps-sdk/cli users role --id 2 --role admin

Remove user (soft delete)

删除用户(软删除)

bunx @temps-sdk/cli users remove --id 2 -f
bunx @temps-sdk/cli users remove --id 2 -f

Restore deleted user

恢复已删除用户

bunx @temps-sdk/cli users restore --id 2

---
bunx @temps-sdk/cli users restore --id 2

---

DSN (Data Source Names)

DSN(数据源名称)管理

bash
undefined
bash
undefined

List DSNs

列出DSN

bunx @temps-sdk/cli dsn list --project-id 5 --json
bunx @temps-sdk/cli dsn list --project-id 5 --json

Create DSN

创建DSN

bunx @temps-sdk/cli dsn create --project-id 5 -n "Production DSN" --environment-id 1 -y
bunx @temps-sdk/cli dsn create --project-id 5 -n "生产环境DSN" --environment-id 1 -y

Get or create DSN (idempotent)

获取或创建DSN(幂等操作)

bunx @temps-sdk/cli dsn get-or-create --project-id 5 --environment-id 1 --json
bunx @temps-sdk/cli dsn get-or-create --project-id 5 --environment-id 1 --json

Regenerate DSN key

重新生成DSN密钥

bunx @temps-sdk/cli dsn regenerate --project-id 5 --dsn-id 1 -f
bunx @temps-sdk/cli dsn regenerate --project-id 5 --dsn-id 1 -f

Revoke DSN

吊销DSN

bunx @temps-sdk/cli dsn revoke --project-id 5 --dsn-id 1 -f

---
bunx @temps-sdk/cli dsn revoke --project-id 5 --dsn-id 1 -f

---

Analytics Funnels

分析漏斗管理

Alias:
funnel
bash
undefined
别名
funnel
bash
undefined

List funnels

列出分析漏斗

bunx @temps-sdk/cli funnels list --project-id 5 --json
bunx @temps-sdk/cli funnels list --project-id 5 --json

Create funnel

创建分析漏斗

bunx @temps-sdk/cli funnels create --project-id 5 -n "Signup Funnel"
-s '[{"event_name":"page_view","filters":{"path":"/signup"}},{"event_name":"form_submit"},{"event_name":"signup_complete"}]' -y
bunx @temps-sdk/cli funnels create --project-id 5 -n "注册漏斗"
-s '[{"event_name":"page_view","filters":{"path":"/signup"}},{"event_name":"form_submit"},{"event_name":"signup_complete"}]' -y

Update funnel

更新分析漏斗

bunx @temps-sdk/cli funnels update --project-id 5 --funnel-id 1 -n "Updated Funnel"
bunx @temps-sdk/cli funnels update --project-id 5 --funnel-id 1 -n "更新后的注册漏斗"

View funnel metrics

查看漏斗指标

bunx @temps-sdk/cli funnels metrics --project-id 5 --funnel-id 1 --json
bunx @temps-sdk/cli funnels metrics --project-id 5 --funnel-id 1 --json

Preview metrics (without saving)

预览漏斗指标(不保存)

bunx @temps-sdk/cli funnels preview --project-id 5
-s '[{"event_name":"page_view"},{"event_name":"signup"}]' --json
bunx @temps-sdk/cli funnels preview --project-id 5
-s '[{"event_name":"page_view"},{"event_name":"signup"}]' --json

Remove funnel

删除分析漏斗

bunx @temps-sdk/cli funnels remove --project-id 5 --funnel-id 1 -f

---
bunx @temps-sdk/cli funnels remove --project-id 5 --funnel-id 1 -f

---

Email

邮件管理

Email Providers

邮件提供商管理

Alias:
eprov
bash
undefined
别名
eprov
bash
undefined

List email providers

列出邮件提供商

bunx @temps-sdk/cli email-providers list --json
bunx @temps-sdk/cli email-providers list --json

Create SES provider

创建SES提供商

bunx @temps-sdk/cli email-providers create -n "AWS SES" -t ses --access-key-id AKIA... --secret-access-key secret --region us-east-1 -y
bunx @temps-sdk/cli email-providers create -n "AWS SES" -t ses --access-key-id AKIA... --secret-access-key secret --region us-east-1 -y

Create Scaleway provider

创建Scaleway提供商

bunx @temps-sdk/cli email-providers create -n "Scaleway" -t scaleway --api-key scw_abc --project-id proj123 --region fr-par -y
bunx @temps-sdk/cli email-providers create -n "Scaleway" -t scaleway --api-key scw_abc --project-id proj123 --region fr-par -y

Test provider

测试邮件提供商

bunx @temps-sdk/cli email-providers test --id 1 --from noreply@example.com
bunx @temps-sdk/cli email-providers test --id 1 --from noreply@example.com

Remove

删除邮件提供商

bunx @temps-sdk/cli email-providers remove --id 1 -f
undefined
bunx @temps-sdk/cli email-providers remove --id 1 -f
undefined

Email Domains

邮件域名管理

Alias:
edom
bash
undefined
别名
edom
bash
undefined

List domains

列出邮件域名

bunx @temps-sdk/cli email-domains list --json
bunx @temps-sdk/cli email-domains list --json

Create email domain

创建邮件域名

bunx @temps-sdk/cli email-domains create -d example.com --provider-id 1 -y
bunx @temps-sdk/cli email-domains create -d example.com --provider-id 1 -y

Show domain

查看邮件域名详情

bunx @temps-sdk/cli email-domains show --id 1 --json
bunx @temps-sdk/cli email-domains show --id 1 --json

Get DNS records to configure

获取需要配置的DNS记录

bunx @temps-sdk/cli email-domains dns-records --id 1 --json
bunx @temps-sdk/cli email-domains dns-records --id 1 --json

Auto-setup DNS records

自动配置DNS记录

bunx @temps-sdk/cli email-domains setup-dns --id 1 --dns-provider-id 2
bunx @temps-sdk/cli email-domains setup-dns --id 1 --dns-provider-id 2

Verify domain

验证邮件域名

bunx @temps-sdk/cli email-domains verify --id 1
bunx @temps-sdk/cli email-domains verify --id 1

Remove

删除邮件域名

bunx @temps-sdk/cli email-domains remove --id 1 -f
undefined
bunx @temps-sdk/cli email-domains remove --id 1 -f
undefined

Emails

邮件发送管理

Alias:
email
bash
undefined
别名
email
bash
undefined

List sent emails

列出已发送邮件

bunx @temps-sdk/cli emails list --json bunx @temps-sdk/cli emails list --page 1 --page-size 20 --status delivered bunx @temps-sdk/cli emails list --domain-id 1 --project-id 5 --from-address noreply@example.com
bunx @temps-sdk/cli emails list --json bunx @temps-sdk/cli emails list --page 1 --page-size 20 --status delivered bunx @temps-sdk/cli emails list --domain-id 1 --project-id 5 --from-address noreply@example.com

Send email

发送邮件

bunx @temps-sdk/cli emails send --to user@example.com --subject "Hello" --body "Welcome!" --from noreply@example.com -y
bunx @temps-sdk/cli emails send --to user@example.com --subject "你好" --body "欢迎使用!" --from noreply@example.com -y

Show email details

查看邮件详情

bunx @temps-sdk/cli emails show --id 1 --json
bunx @temps-sdk/cli emails show --id 1 --json

Email statistics

邮件统计

bunx @temps-sdk/cli emails stats --json
bunx @temps-sdk/cli emails stats --json

Validate email address

验证邮箱地址

bunx @temps-sdk/cli emails validate --email user@example.com --json

---
bunx @temps-sdk/cli emails validate --email user@example.com --json

---

IP Access Control

IP访问控制

Alias:
ipa
bash
undefined
别名
ipa
bash
undefined

List rules

列出访问规则

bunx @temps-sdk/cli ip-access list --json
bunx @temps-sdk/cli ip-access list --json

Allow an IP

允许指定IP访问

bunx @temps-sdk/cli ip-access create --ip 203.0.113.0/24 --action allow --description "Office network" -y
bunx @temps-sdk/cli ip-access create --ip 203.0.113.0/24 --action allow --description "办公网络" -y

Block an IP

阻止指定IP访问

bunx @temps-sdk/cli ip-access create --ip 198.51.100.5 --action deny --description "Suspicious traffic" -y
bunx @temps-sdk/cli ip-access create --ip 198.51.100.5 --action deny --description "可疑流量" -y

Check if IP is blocked

检查IP是否被阻止

bunx @temps-sdk/cli ip-access check --ip 198.51.100.5 --json
bunx @temps-sdk/cli ip-access check --ip 198.51.100.5 --json

Update rule

更新访问规则

bunx @temps-sdk/cli ip-access update --id 1 --description "Updated description"
bunx @temps-sdk/cli ip-access update --id 1 --description "更新后的描述"

Remove rule

删除访问规则

bunx @temps-sdk/cli ip-access remove --id 1 -f

---
bunx @temps-sdk/cli ip-access remove --id 1 -f

---

Load Balancer

负载均衡器管理

Alias:
lb
bash
undefined
别名
lb
bash
undefined

List routes

列出路由规则

bunx @temps-sdk/cli load-balancer list --json
bunx @temps-sdk/cli load-balancer list --json

Create route

创建路由规则

bunx @temps-sdk/cli load-balancer create -d app.example.com -t http://localhost:8080 -y
bunx @temps-sdk/cli load-balancer create -d app.example.com -t http://localhost:8080 -y

Show route

查看路由规则详情

bunx @temps-sdk/cli load-balancer show -d app.example.com --json
bunx @temps-sdk/cli load-balancer show -d app.example.com --json

Update route

更新路由规则

bunx @temps-sdk/cli load-balancer update -d app.example.com -t http://localhost:9090
bunx @temps-sdk/cli load-balancer update -d app.example.com -t http://localhost:9090

Remove route

删除路由规则

bunx @temps-sdk/cli load-balancer remove -d app.example.com -f

---
bunx @temps-sdk/cli load-balancer remove -d app.example.com -f

---

Audit Logs

审计日志

bash
undefined
bash
undefined

List audit logs

列出审计日志

bunx @temps-sdk/cli audit list --limit 50 --json
bunx @temps-sdk/cli audit list --limit 50 --json

With pagination and filters

带分页和过滤条件的查询

bunx @temps-sdk/cli audit list --limit 20 --offset 40 bunx @temps-sdk/cli audit list --operation-type PROJECT_CREATED --user-id 1 bunx @temps-sdk/cli audit list --from 2025-01-01T00:00:00Z --to 2025-01-31T23:59:59Z
bunx @temps-sdk/cli audit list --limit 20 --offset 40 bunx @temps-sdk/cli audit list --operation-type PROJECT_CREATED --user-id 1 bunx @temps-sdk/cli audit list --from 2025-01-01T00:00:00Z --to 2025-01-31T23:59:59Z

Show audit log entry

查看审计日志条目详情

bunx @temps-sdk/cli audit show --id 1 --json

**Example output:**
Audit Logs (50) ┌────┬────────────────────┬───────────────────┬──────────────┬──────────────┬─────────────────────┐ │ ID │ Operation │ User │ IP │ Location │ Date │ ├────┼────────────────────┼───────────────────┼──────────────┼──────────────┼─────────────────────┤ │ 42 │ PROJECT_CREATED │ david@example.com │ 203.0.113.1 │ Madrid, ES │ 2025-01-20 15:30:00 │ │ 41 │ DEPLOYMENT_STARTED │ david@example.com │ 203.0.113.1 │ Madrid, ES │ 2025-01-20 15:28:00 │ └────┴────────────────────┴───────────────────┴──────────────┴──────────────┴─────────────────────┘

---
bunx @temps-sdk/cli audit show --id 1 --json

**示例输出:**
审计日志(50条) ┌────┬────────────────────┬───────────────────┬──────────────┬──────────────┬─────────────────────┐ │ ID │ 操作类型 │ 用户 │ IP地址 │ 地理位置 │ 时间 │ ├────┼────────────────────┼───────────────────┼──────────────┼──────────────┼─────────────────────┤ │ 42 │ 项目已创建 │ david@example.com │ 203.0.113.1 │ 马德里, ES │ 2025-01-20 15:30:00 │ │ 41 │ 部署已启动 │ david@example.com │ 203.0.113.1 │ 马德里, ES │ 2025-01-20 15:28:00 │ └────┴────────────────────┴───────────────────┴──────────────┴──────────────┴─────────────────────┘

---

Proxy Logs

代理日志

Alias:
plogs
bash
undefined
别名
plogs
bash
undefined

List proxy logs

列出代理日志

bunx @temps-sdk/cli proxy-logs list --limit 20 --json
bunx @temps-sdk/cli proxy-logs list --limit 20 --json

With pagination and filters

带分页和过滤条件的查询

bunx @temps-sdk/cli proxy-logs list --page 2 --limit 50 bunx @temps-sdk/cli proxy-logs list --project-id 5 --environment-id 1 bunx @temps-sdk/cli proxy-logs list --method POST --status-code 500 bunx @temps-sdk/cli proxy-logs list --host app.example.com --path /api/users bunx @temps-sdk/cli proxy-logs list --start-date 2025-01-20T00:00:00Z --end-date 2025-01-21T00:00:00Z bunx @temps-sdk/cli proxy-logs list --sort-by response_time_ms --sort-order desc bunx @temps-sdk/cli proxy-logs list --is-bot --json bunx @temps-sdk/cli proxy-logs list --has-error --json
bunx @temps-sdk/cli proxy-logs list --page 2 --limit 50 bunx @temps-sdk/cli proxy-logs list --project-id 5 --environment-id 1 bunx @temps-sdk/cli proxy-logs list --method POST --status-code 500 bunx @temps-sdk/cli proxy-logs list --host app.example.com --path /api/users bunx @temps-sdk/cli proxy-logs list --start-date 2025-01-20T00:00:00Z --end-date 2025-01-21T00:00:00Z bunx @temps-sdk/cli proxy-logs list --sort-by response_time_ms --sort-order desc bunx @temps-sdk/cli proxy-logs list --is-bot --json bunx @temps-sdk/cli proxy-logs list --has-error --json

Show log details

查看代理日志详情

bunx @temps-sdk/cli proxy-logs show --id 1 --json
bunx @temps-sdk/cli proxy-logs show --id 1 --json

Get log by request ID

按请求ID查询日志

bunx @temps-sdk/cli proxy-logs by-request --request-id req_abc123 --json
bunx @temps-sdk/cli proxy-logs by-request --request-id req_abc123 --json

Request statistics

请求统计

bunx @temps-sdk/cli proxy-logs stats --json
bunx @temps-sdk/cli proxy-logs stats --json

Today's statistics

今日请求统计

bunx @temps-sdk/cli proxy-logs today --json

---
bunx @temps-sdk/cli proxy-logs today --json

---

Platform Information

平台信息

Alias:
plat
bash
undefined
别名
plat
bash
undefined

Platform info (OS, architecture)

平台信息(操作系统、架构)

bunx @temps-sdk/cli platform info --json
bunx @temps-sdk/cli platform info --json

Access/networking info

访问/网络信息

bunx @temps-sdk/cli platform access --json
bunx @temps-sdk/cli platform access --json

Public IP

公网IP

bunx @temps-sdk/cli platform public-ip
bunx @temps-sdk/cli platform public-ip

Private IP

内网IP

bunx @temps-sdk/cli platform private-ip

**Example output (`platform access --json`):**
```json
{
  "access_mode": "public",
  "public_ip": "203.0.113.50",
  "private_ip": "10.0.1.5",
  "can_create_domains": true,
  "domain_creation_error": null
}

bunx @temps-sdk/cli platform private-ip

**示例输出(`platform access --json`):**
```json
{
  "access_mode": "public",
  "public_ip": "203.0.113.50",
  "private_ip": "10.0.1.5",
  "can_create_domains": true,
  "domain_creation_error": null
}

Settings (Platform)

平台设置

bash
undefined
bash
undefined

Show platform settings

查看平台设置

bunx @temps-sdk/cli settings show --json
bunx @temps-sdk/cli settings show --json

Update settings

更新平台设置

bunx @temps-sdk/cli settings update --preview-domain example.com
bunx @temps-sdk/cli settings update --preview-domain example.com

Set external URL

设置外部访问地址

bunx @temps-sdk/cli settings set-external-url --url https://app.example.com
bunx @temps-sdk/cli settings set-external-url --url https://app.example.com

Set preview domain

设置预览域名

bunx @temps-sdk/cli settings set-preview-domain --domain preview.example.com

---
bunx @temps-sdk/cli settings set-preview-domain --domain preview.example.com

---

Presets & Templates

预设模板

bash
undefined
bash
undefined

List build presets

列出构建预设

bunx @temps-sdk/cli presets list --json bunx @temps-sdk/cli presets list --type server bunx @temps-sdk/cli presets list --type static
bunx @temps-sdk/cli presets list --json bunx @temps-sdk/cli presets list --type server bunx @temps-sdk/cli presets list --type static

Show preset details

查看预设详情

bunx @temps-sdk/cli presets show nextjs --json
bunx @temps-sdk/cli presets show nextjs --json

List deployment templates

列出部署模板

bunx @temps-sdk/cli templates list --json bunx @temps-sdk/cli templates list --type server

---
bunx @temps-sdk/cli templates list --json bunx @temps-sdk/cli templates list --type server

---

Imports

导入管理

bash
undefined
bash
undefined

List import sources

列出导入源

bunx @temps-sdk/cli imports sources --json
bunx @temps-sdk/cli imports sources --json

Discover workloads

发现工作负载

bunx @temps-sdk/cli imports discover -s docker --json
bunx @temps-sdk/cli imports discover -s docker --json

Create import plan

创建导入计划

bunx @temps-sdk/cli imports plan -s docker -w my-container
bunx @temps-sdk/cli imports plan -s docker -w my-container

Execute import

执行导入

bunx @temps-sdk/cli imports execute -s docker -w my-container -y
bunx @temps-sdk/cli imports execute -s docker -w my-container -y

Check import status

检查导入状态

bunx @temps-sdk/cli imports status --session-id sess_abc123 --json

**Workflow**: `sources` -> `discover` -> `plan` -> `execute` -> `status`

---
bunx @temps-sdk/cli imports status --session-id sess_abc123 --json

**工作流**:`sources`(源管理)-> `discover`(发现)-> `plan`(计划)-> `execute`(执行)-> `status`(状态查询)

---

Documentation Generation

文档生成

bash
undefined
bash
undefined

Generate markdown docs

生成Markdown格式文档

bunx @temps-sdk/cli docs
bunx @temps-sdk/cli docs

Generate MDX docs

生成MDX格式文档

bunx @temps-sdk/cli docs -f mdx
bunx @temps-sdk/cli docs -f mdx

Generate JSON docs

生成JSON格式文档

bunx @temps-sdk/cli docs -f json
bunx @temps-sdk/cli docs -f json

Write to file

写入到文件

bunx @temps-sdk/cli docs -f markdown -o docs/cli-reference.md

---
bunx @temps-sdk/cli docs -f markdown -o docs/cli-reference.md

---

Temps Cloud

Temps Cloud

Temps Cloud (
temps.sh
) is a managed hosting service separate from self-hosted Temps. Cloud commands use their own authentication (
cloudApiKey
) and do not interfere with self-hosted credentials.
Environment variables:
VariableDescription
TEMPS_CLOUD_URL
Override cloud API endpoint (default:
https://temps.sh
)
TEMPS_CLOUD_TOKEN
Cloud API token (highest priority)
TEMPS_CLOUD_API_KEY
Cloud API key
Temps Cloud(
temps.sh
)是独立于自托管Temps的托管服务。Cloud命令使用独立的身份验证(
cloudApiKey
),不会影响自托管凭据。
环境变量:
变量名描述
TEMPS_CLOUD_URL
覆盖Cloud API端点(默认:
https://temps.sh
TEMPS_CLOUD_TOKEN
Cloud API令牌(优先级最高)
TEMPS_CLOUD_API_KEY
Cloud API密钥

Cloud Authentication

Cloud身份验证

bash
undefined
bash
undefined

Login via device authorization flow (opens browser)

通过设备授权流登录(打开浏览器)

bunx @temps-sdk/cli cloud login
bunx @temps-sdk/cli cloud login

Show current cloud account

查看当前Cloud账户信息

bunx @temps-sdk/cli cloud whoami
bunx @temps-sdk/cli cloud whoami

Logout from Temps Cloud

登出Temps Cloud

bunx @temps-sdk/cli cloud logout

**Example output (`cloud whoami`):**
Temps Cloud Account ──────────────────────── ID: 42 Name: David Username: david Email: david@example.com Plan: pro
undefined
bunx @temps-sdk/cli cloud logout

**示例输出(`cloud whoami`):**
Temps Cloud账户信息 ──────────────────────── ID: 42 姓名: David 用户名: david 邮箱: david@example.com 套餐: 专业版
undefined

Cloud VPS

Cloud VPS管理

Manage cloud VPS instances. Public endpoints (images, locations, types) work without authentication.
管理Cloud VPS实例。公共端点(镜像、区域、服务器类型)无需身份验证即可访问。

List VPS Instances

列出VPS实例

bash
bunx @temps-sdk/cli cloud vps list
bunx @temps-sdk/cli cloud vps list --json
Example output:
  VPS Instances (2)
  ──────────────────────────────────────────────────────────────
  ID           │ Hostname        │ Status    │ IPv4          │ Type  │ Price
  ─────────────┼─────────────────┼───────────┼───────────────┼───────┼────────
  abc12def     │ vps-abc12def    │ ● active  │ 49.12.100.50  │ cx22  │ €4.51/mo
  xyz34ghi     │ vps-xyz34ghi    │ ● error   │ pending       │ cx32  │ €7.49/mo
bash
bunx @temps-sdk/cli cloud vps list
bunx @temps-sdk/cli cloud vps list --json
示例输出:
  VPS实例(2个)
  ──────────────────────────────────────────────────────────────
  ID           │ 主机名        │ 状态    │ IPv4地址      │ 类型  │ 价格
  ─────────────┼─────────────────┼───────────┼───────────────┼───────┼────────
  abc12def     │ vps-abc12def    │ ● 活跃  │ 49.12.100.50  │ cx22  │ €4.51/月
  xyz34ghi     │ vps-xyz34ghi    │ ● 异常  │ 待分配       │ cx32  │ €7.49/月

Create VPS Instance

创建VPS实例

bash
undefined
bash
undefined

Interactive wizard (image -> location -> server type)

交互式向导(选择镜像 -> 区域 -> 服务器类型)

bunx @temps-sdk/cli cloud vps create
bunx @temps-sdk/cli cloud vps create

Non-interactive

非交互式创建

bunx @temps-sdk/cli cloud vps create --image ubuntu-22.04 --location fsn1 --type cx22 bunx @temps-sdk/cli cloud vps create --image ubuntu-22.04 --location fsn1 --type cx22 --json
undefined
bunx @temps-sdk/cli cloud vps create --image ubuntu-22.04 --location fsn1 --type cx22 bunx @temps-sdk/cli cloud vps create --image ubuntu-22.04 --location fsn1 --type cx22 --json
undefined

Show VPS Details

查看VPS详情

bash
bunx @temps-sdk/cli cloud vps show abc12def
bunx @temps-sdk/cli cloud vps show abc12def --json
Shows instance details, server specs, and provisioning logs.
bash
bunx @temps-sdk/cli cloud vps show abc12def
bunx @temps-sdk/cli cloud vps show abc12def --json
展示实例详情、服务器规格及配置日志。

Destroy VPS Instance

销毁VPS实例

bash
undefined
bash
undefined

With confirmation prompt

带确认提示的销毁

bunx @temps-sdk/cli cloud vps destroy abc12def
undefined
bunx @temps-sdk/cli cloud vps destroy abc12def
undefined

Retry Failed Provisioning

重试失败的配置

bash
bunx @temps-sdk/cli cloud vps retry abc12def
bash
bunx @temps-sdk/cli cloud vps retry abc12def

Show VPS Credentials

查看VPS凭据

bash
bunx @temps-sdk/cli cloud vps credentials abc12def
bunx @temps-sdk/cli cloud vps credentials abc12def --json
Shows web panel URL, username, and password.
bash
bunx @temps-sdk/cli cloud vps credentials abc12def
bunx @temps-sdk/cli cloud vps credentials abc12def --json
展示Web面板地址、用户名和密码。

List Available OS Images (No Auth Required)

列出可用操作系统镜像(无需身份验证)

bash
bunx @temps-sdk/cli cloud vps images
bunx @temps-sdk/cli cloud vps images --json
bash
bunx @temps-sdk/cli cloud vps images
bunx @temps-sdk/cli cloud vps images --json

List Available Locations (No Auth Required)

列出可用区域(无需身份验证)

bash
bunx @temps-sdk/cli cloud vps locations
bunx @temps-sdk/cli cloud vps locations --json
bash
bunx @temps-sdk/cli cloud vps locations
bunx @temps-sdk/cli cloud vps locations --json

List Server Types with Pricing (No Auth Required)

列出服务器类型及价格(无需身份验证)

bash
bunx @temps-sdk/cli cloud vps types
bunx @temps-sdk/cli cloud vps types --location fsn1
bunx @temps-sdk/cli cloud vps types --json
Example output:
  Server Types for fsn1 (4)
  ─────────────────────────────────────────────────────────────────
  ID    │ Name         │ vCPU │ Memory (GB) │ Disk (GB) │ Price     │ Available
  ──────┼──────────────┼──────┼─────────────┼───────────┼───────────┼──────────
  cx22  │ CX22         │    2 │           4 │        40 │ €4.51/mo  │ yes
  cx32  │ CX32         │    4 │           8 │        80 │ €7.49/mo  │ yes
  cx42  │ CX42         │    8 │          16 │       160 │ €14.99/mo │ yes
  cx52  │ CX52         │   16 │          32 │       320 │ €29.99/mo │ no
bash
bunx @temps-sdk/cli cloud vps types
bunx @temps-sdk/cli cloud vps types --location fsn1
bunx @temps-sdk/cli cloud vps types --json
示例输出:
  fsn1区域的服务器类型(4种)
  ─────────────────────────────────────────────────────────────────
  ID    │ 名称         │ vCPU │ 内存(GB) │ 磁盘(GB) │ 价格     │ 可用性
  ──────┼──────────────┼──────┼─────────────┼───────────┼───────────┼──────────
  cx22  │ CX22         │    2 │           4 │        40 │ €4.51/月  │ 可用
  cx32  │ CX32         │    4 │           8 │        80 │ €7.49/月  │ 可用
  cx42  │ CX42         │    8 │          16 │       160 │ €14.99/月 │ 可用
  cx52  │ CX52         │   16 │          32 │       320 │ €29.99/月 │ 不可用

Cloud ACME Certificates (acme.sh)

Cloud ACME证书(基于acme.sh)

Provision TLS certificates for
*.temps.dev
subdomains using
acme.sh
with DNS-01 validation through the Temps Cloud ACME API. This is designed for self-hosted Temps instances behind NAT/firewalls that cannot complete HTTP-01 challenges because port 80 is not publicly accessible.
通过Temps Cloud ACME API,使用
acme.sh
结合DNS-01验证,为
*.temps.dev
子域名颁发TLS证书。该功能专为位于NAT/防火墙后的自托管Temps实例设计——这类实例因80端口无法公网访问,无法完成HTTP-01验证。

How It Works

工作原理

  1. acme.sh
    requests a certificate from Let's Encrypt for your
    *.temps.dev
    subdomain
  2. Let's Encrypt asks for a DNS TXT record at
    _acme-challenge.your-host.username.temps.dev
  3. The custom DNS hook calls
    bunx @temps-sdk/cli cloud acme set
    to create the TXT record on Cloudflare
  4. Let's Encrypt verifies the record and issues the certificate
  5. acme.sh
    saves the certificate locally and handles auto-renewal
  1. acme.sh
    向Let's Encrypt申请
    *.temps.dev
    子域名的证书
  2. Let's Encrypt要求在
    _acme-challenge.your-host.username.temps.dev
    添加DNS TXT记录
  3. 自定义DNS钩子调用
    bunx @temps-sdk/cli cloud acme set
    在Cloudflare上创建TXT记录
  4. Let's Encrypt验证记录后颁发证书
  5. acme.sh
    将证书保存到本地并自动处理续期

Prerequisites

前置条件

  • Temps CLI (
    @temps-sdk/cli
    ) installed — for cloud ACME commands (
    bunx @temps-sdk/cli cloud acme
    )
  • Temps server binary (
    temps
    ) installed on the server — for certificate import (
    temps domain import
    )
  • Temps Cloud account — authenticate with
    bunx @temps-sdk/cli cloud login
  • acme.sh installed (see installation below)
  • 已安装Temps CLI
    @temps-sdk/cli
    )——用于执行Cloud ACME命令(
    bunx @temps-sdk/cli cloud acme
  • 服务器上已安装Temps服务端二进制文件
    temps
    )——用于导入证书(
    temps domain import
  • 拥有Temps Cloud账户——通过
    bunx @temps-sdk/cli cloud login
    完成身份验证
  • 已安装acme.sh(安装方法见下文)

Hostname Format

主机名格式

Your self-hosted Temps instance uses a subdomain of
temps.dev
:
{server-name}.{username}.temps.dev
Examples:
  • myserver.david.temps.dev
    — main domain
  • *.myserver.david.temps.dev
    — wildcard for deployed apps
The ACME API uses the short hostname (without
.temps.dev
):
myserver.david
自托管Temps实例使用
temps.dev
的子域名:
{服务器名称}.{用户名}.temps.dev
示例:
  • myserver.david.temps.dev
    —— 主域名
  • *.myserver.david.temps.dev
    —— 部署应用的通配符域名
ACME API使用短主机名(不含
.temps.dev
):
myserver.david

Cloud ACME CLI Commands

Cloud ACME CLI命令

Manage
_acme-challenge
TXT records on Cloudflare for DNS-01 validation via the Temps CLI:
Set TXT record:
bash
undefined
通过Temps CLI管理Cloudflare上的
_acme-challenge
TXT记录,用于DNS-01验证:
设置TXT记录:
bash
undefined

Set ACME challenge TXT record for a hostname

为主机名设置ACME挑战TXT记录

bunx @temps-sdk/cli cloud acme set --hostname myserver.david --token "token-value-from-acme"

**Example output:**
ACME Challenge Set ──────────────────────── Hostname: myserver.david.temps.dev TXT Record: _acme-challenge.myserver.david.temps.dev Status: ✓ Record created

**Check propagation status:**

```bash
bunx @temps-sdk/cli cloud acme status --hostname myserver.david
bunx @temps-sdk/cli cloud acme status --hostname myserver.david --json
Example output:
  ACME Challenge Status
  ────────────────────────
  Hostname:    myserver.david.temps.dev
  Propagated:  ✓ Yes
JSON output:
json
{
  "hostname": "myserver.david",
  "propagated": true
}
Clean up TXT record:
bash
bunx @temps-sdk/cli cloud acme clean --hostname myserver.david
Example output:
  ACME challenge record removed for myserver.david.temps.dev
Wait for propagation (set + poll):
bash
undefined
bunx @temps-sdk/cli cloud acme set --hostname myserver.david --token "来自acme的令牌值"

**示例输出:**
ACME挑战记录已设置 ──────────────────────── 主机名: myserver.david.temps.dev TXT记录: _acme-challenge.myserver.david.temps.dev 状态: ✓ 记录已创建

**检查传播状态:**

```bash
bunx @temps-sdk/cli cloud acme status --hostname myserver.david
bunx @temps-sdk/cli cloud acme status --hostname myserver.david --json
示例输出:
  ACME挑战记录传播状态
  ────────────────────────
  主机名:    myserver.david.temps.dev
  已传播:  ✓ 是
JSON输出:
json
{
  "hostname": "myserver.david",
  "propagated": true
}
清理TXT记录:
bash
bunx @temps-sdk/cli cloud acme clean --hostname myserver.david
示例输出:
  已移除myserver.david.temps.dev的ACME挑战记录
等待传播完成(设置+轮询):
bash
undefined

Set record and wait until DNS propagation is confirmed (polls every 5s, max 120s)

设置记录并等待DNS传播确认(每5秒轮询一次,最长等待120秒)

bunx @temps-sdk/cli cloud acme set --hostname myserver.david --token "token-value" --wait
undefined
bunx @temps-sdk/cli cloud acme set --hostname myserver.david --token "令牌值" --wait
undefined

acme.sh DNS Hook Script

acme.sh DNS钩子脚本

Create the file
~/.acme.sh/dnsapi/dns_temps.sh
:
bash
#!/usr/bin/env bash
创建文件
~/.acme.sh/dnsapi/dns_temps.sh
bash
#!/usr/bin/env bash

Temps Cloud DNS hook for acme.sh

Temps Cloud DNS钩子脚本(用于acme.sh)

Uses @temps-sdk/cli (temps cloud acme) to manage _acme-challenge TXT records

使用@temps-sdk/cli(temps cloud acme)管理*.temps.dev子域名的_acme-challenge TXT记录

for *.temps.dev subdomains.

Prerequisites:

前置条件:

- @temps-sdk/cli installed globally (npm install -g @temps-sdk/cli)

- 已全局安装@temps-sdk/cli(npm install -g @temps-sdk/cli)

or available via bunx/npx

或可通过bunx/npx调用

- Authenticated to Temps Cloud: temps cloud login

- 已完成Temps Cloud身份验证:temps cloud login

dns_temps_add() { local fulldomain="$1" local txtvalue="$2"
_info "Adding TXT record for $fulldomain"

Extract hostname: _acme-challenge.server.user.temps.dev -> server.user

local hostname hostname=$(echo "$fulldomain" | sed -E 's/^_acme-challenge.(.+).temps.dev$/\1/')
if [ "$hostname" = "$fulldomain" ]; then _err "Could not extract hostname from $fulldomain" return 1 fi

Set TXT record and wait for DNS propagation

if ! bunx @temps-sdk/cli cloud acme set --hostname "$hostname" --token "$txtvalue" --wait; then _err "Failed to set TXT record via temps CLI" return 1 fi
_info "TXT record set and propagation confirmed" return 0 }
dns_temps_rm() { local fulldomain="$1"
_info "Removing TXT record for $fulldomain"
local hostname hostname=$(echo "$fulldomain" | sed -E 's/^_acme-challenge.(.+).temps.dev$/\1/')
if [ "$hostname" = "$fulldomain" ]; then _err "Could not extract hostname from $fulldomain" return 1 fi
if ! bunx @temps-sdk/cli cloud acme clean --hostname "$hostname"; then _err "Failed to remove TXT record via temps CLI" return 1 fi
_info "TXT record removed" return 0 }

Make the script executable:

```bash
chmod +x ~/.acme.sh/dnsapi/dns_temps.sh
dns_temps_add() { local fulldomain="$1" local txtvalue="$2"
_info "为$fulldomain添加TXT记录"

提取主机名:_acme-challenge.server.user.temps.dev -> server.user

local hostname hostname=$(echo "$fulldomain" | sed -E 's/^_acme-challenge.(.+).temps.dev$/\1/')
if [ "$hostname" = "$fulldomain" ]; then _err "无法从$fulldomain中提取主机名" return 1 fi

设置TXT记录并等待DNS传播

if ! bunx @temps-sdk/cli cloud acme set --hostname "$hostname" --token "$txtvalue" --wait; then _err "通过temps CLI设置TXT记录失败" return 1 fi
_info "TXT记录已设置且传播已确认" return 0 }
dns_temps_rm() { local fulldomain="$1"
_info "移除$fulldomain的TXT记录"
local hostname hostname=$(echo "$fulldomain" | sed -E 's/^_acme-challenge.(.+).temps.dev$/\1/')
if [ "$hostname" = "$fulldomain" ]; then _err "无法从$fulldomain中提取主机名" return 1 fi
if ! bunx @temps-sdk/cli cloud acme clean --hostname "$hostname"; then _err "通过temps CLI移除TXT记录失败" return 1 fi
_info "TXT记录已移除" return 0 }

为脚本添加可执行权限:

```bash
chmod +x ~/.acme.sh/dnsapi/dns_temps.sh

Full Certificate Flow

完整证书申请流程

1. Install acme.sh:
bash
curl https://get.acme.sh | sh -s email=your-email@example.com
source ~/.bashrc  # or ~/.zshrc
2. Authenticate to Temps Cloud (using
@temps-sdk/cli
):
bash
bunx @temps-sdk/cli cloud login
The hook script uses the
@temps-sdk/cli
, which reads credentials from
~/.temps/.secrets
automatically.
3. Issue the certificate:
bash
acme.sh --issue --dns dns_temps \
  -d 'myserver.david.temps.dev' \
  -d '*.myserver.david.temps.dev'
This will:
  • Request a certificate from Let's Encrypt
  • Call
    dns_temps_add()
    which runs
    bunx @temps-sdk/cli cloud acme set --wait
  • Wait for DNS propagation
  • Complete the ACME challenge
  • Save the certificate
4. Certificate output location:
~/.acme.sh/myserver.david.temps.dev/
├── ca.cer                    # CA certificate chain
├── fullchain.cer             # Full chain (cert + CA)
├── myserver.david.temps.dev.cer  # Domain certificate
└── myserver.david.temps.dev.key  # Private key
5. Import the certificate into Temps (server-side):
Temps stores certificates in the database (encrypted at rest) and loads them dynamically via SNI during TLS handshake. Run the
temps domain import
command on the server using the Temps server binary (not the
@temps-sdk/cli
):
bash
undefined
1. 安装acme.sh:
bash
curl https://get.acme.sh | sh -s email=your-email@example.com
source ~/.bashrc  # 或~/.zshrc
2. 登录到Temps Cloud(使用
@temps-sdk/cli
):
bash
bunx @temps-sdk/cli cloud login
钩子脚本会使用
@temps-sdk/cli
,该工具会自动从
~/.temps/.secrets
读取凭据。
3. 申请证书:
bash
acme.sh --issue --dns dns_temps \
  -d 'myserver.david.temps.dev' \
  -d '*.myserver.david.temps.dev'
该命令会:
  • 向Let's Encrypt申请证书
  • 调用
    dns_temps_add()
    ,后者执行
    bunx @temps-sdk/cli cloud acme set --wait
  • 等待DNS传播完成
  • 完成ACME挑战
  • 保存证书
4. 证书输出位置:
~/.acme.sh/myserver.david.temps.dev/
├── ca.cer                    # CA证书链
├── fullchain.cer             # 完整证书链(域名证书+CA证书)
├── myserver.david.temps.dev.cer  # 域名证书
└── myserver.david.temps.dev.key  # 私钥
5. 将证书导入到Temps(服务端操作):
Temps会将证书存储在数据库中(静态加密),并在TLS握手时通过SNI动态加载。在服务器上执行
temps domain import
命令(使用Temps服务端二进制文件,而非
@temps-sdk/cli
):
bash
undefined

Import the wildcard certificate

导入通配符证书

temps domain import
-d '*.myserver.david.temps.dev'
--certificate ~/.acme.sh/myserver.david.temps.dev/fullchain.cer
--private-key ~/.acme.sh/myserver.david.temps.dev/myserver.david.temps.dev.key
--database-url "$TEMPS_DATABASE_URL"
temps domain import
-d '*.myserver.david.temps.dev'
--certificate ~/.acme.sh/myserver.david.temps.dev/fullchain.cer
--private-key ~/.acme.sh/myserver.david.temps.dev/myserver.david.temps.dev.key
--database-url "$TEMPS_DATABASE_URL"

Import the base domain certificate

导入主域名证书

temps domain import
-d 'myserver.david.temps.dev'
--certificate ~/.acme.sh/myserver.david.temps.dev/fullchain.cer
--private-key ~/.acme.sh/myserver.david.temps.dev/myserver.david.temps.dev.key
--database-url "$TEMPS_DATABASE_URL"

> **Note:** `temps domain import` is a server-side command from the Temps Rust binary (`temps`), not the `@temps-sdk/cli` package. It runs directly on the server where Temps is installed and requires `--database-url` access.

Use `--force` to overwrite an existing certificate (e.g., on renewal):

```bash
temps domain import \
  -d '*.myserver.david.temps.dev' \
  --certificate ~/.acme.sh/myserver.david.temps.dev/fullchain.cer \
  --private-key ~/.acme.sh/myserver.david.temps.dev/myserver.david.temps.dev.key \
  --database-url "$TEMPS_DATABASE_URL" \
  --force
6. Verify the certificate is loaded (server-side):
bash
temps domain list --database-url "$TEMPS_DATABASE_URL"
Example output:
  DOMAIN                                   STATUS          TYPE         EXPIRES
  ──────────────────────────────────────────────────────────────────────────────────────────
  *.myserver.david.temps.dev               active          wildcard     2025-05-15
  myserver.david.temps.dev                 active          single       2025-05-15
The Temps proxy (listening on
--tls-address
) will automatically serve these certificates for matching SNI hostnames — no restart required.
temps domain import
-d 'myserver.david.temps.dev'
--certificate ~/.acme.sh/myserver.david.temps.dev/fullchain.cer
--private-key ~/.acme.sh/myserver.david.temps.dev/myserver.david.temps.dev.key
--database-url "$TEMPS_DATABASE_URL"

> **注意:** `temps domain import`是Temps Rust二进制文件(`temps`)提供的服务端命令,而非`@temps-sdk/cli`包的命令。该命令需在Temps安装的服务器上执行,且需要`--database-url`访问权限。

使用`--force`参数覆盖现有证书(例如续期时):

```bash
temps domain import \
  -d '*.myserver.david.temps.dev' \
  --certificate ~/.acme.sh/myserver.david.temps.dev/fullchain.cer \
  --private-key ~/.acme.sh/myserver.david.temps.dev/myserver.david.temps.dev.key \
  --database-url "$TEMPS_DATABASE_URL" \
  --force
6. 验证证书已加载(服务端操作):
bash
temps domain list --database-url "$TEMPS_DATABASE_URL"
示例输出:
  域名                                   状态          类型         过期时间
  ──────────────────────────────────────────────────────────────────────────────────────────
  *.myserver.david.temps.dev               活跃          通配符     2025-05-15
  myserver.david.temps.dev                 活跃          单域名       2025-05-15
Temps代理(监听
--tls-address
)会自动为匹配SNI主机名的请求提供这些证书——无需重启服务。

DNS Propagation Verification

DNS传播验证

The hook script automatically polls for propagation via
--wait
. To verify manually:
bash
undefined
钩子脚本会通过
--wait
参数自动轮询传播状态。手动验证方法:
bash
undefined

Using Temps CLI

使用Temps CLI验证

bunx @temps-sdk/cli cloud acme status --hostname myserver.david
bunx @temps-sdk/cli cloud acme status --hostname myserver.david

Using dig

使用dig验证

dig TXT _acme-challenge.myserver.david.temps.dev @1.1.1.1
undefined
dig TXT _acme-challenge.myserver.david.temps.dev @1.1.1.1
undefined

Auto-Renewal

自动续期

acme.sh
automatically renews certificates via cron (every 60 days by default). To also re-import the renewed certificate into Temps, use the
--install-cert
hook with a
--reloadcmd
that calls the server-side
temps domain import
:
bash
acme.sh --install-cert -d 'myserver.david.temps.dev' \
  --reloadcmd 'temps domain import -d "*.myserver.david.temps.dev" \
    --certificate ~/.acme.sh/myserver.david.temps.dev/fullchain.cer \
    --private-key ~/.acme.sh/myserver.david.temps.dev/myserver.david.temps.dev.key \
    --database-url "$TEMPS_DATABASE_URL" --force && \
  temps domain import -d "myserver.david.temps.dev" \
    --certificate ~/.acme.sh/myserver.david.temps.dev/fullchain.cer \
    --private-key ~/.acme.sh/myserver.david.temps.dev/myserver.david.temps.dev.key \
    --database-url "$TEMPS_DATABASE_URL" --force'
Note: The
--reloadcmd
runs on the server where both
acme.sh
and the Temps binary are installed. The
temps domain import
here refers to the server-side Rust binary, not
@temps-sdk/cli
.
This registers a reload command that
acme.sh
runs after every successful renewal, automatically importing the fresh certificate into Temps.
Verify the cron job is installed:
bash
crontab -l | grep acme
Force a renewal test:
bash
acme.sh --renew -d 'myserver.david.temps.dev' --force
acme.sh
默认通过cron自动续期证书(每60天一次)。如需在续期后自动将新证书导入Temps,可使用
--install-cert
钩子,指定
--reloadcmd
调用服务端的
temps domain import
bash
acme.sh --install-cert -d 'myserver.david.temps.dev' \
  --reloadcmd 'temps domain import -d "*.myserver.david.temps.dev" \
    --certificate ~/.acme.sh/myserver.david.temps.dev/fullchain.cer \
    --private-key ~/.acme.sh/myserver.david.temps.dev/myserver.david.temps.dev.key \
    --database-url "$TEMPS_DATABASE_URL" --force && \
  temps domain import -d "myserver.david.temps.dev" \
    --certificate ~/.acme.sh/myserver.david.temps.dev/fullchain.cer \
    --private-key ~/.acme.sh/myserver.david.temps.dev/myserver.david.temps.dev.key \
    --database-url "$TEMPS_DATABASE_URL" --force'
注意:
--reloadcmd
需在同时安装了
acme.sh
和Temps二进制文件的服务器上执行。此处的
temps domain import
指服务端Rust二进制文件,而非
@temps-sdk/cli
该命令会注册一个重载命令,
acme.sh
在每次续期成功后都会执行该命令,自动将新证书导入Temps。
验证cron任务已安装:
bash
crontab -l | grep acme
强制测试续期:
bash
acme.sh --renew -d 'myserver.david.temps.dev' --force

Troubleshooting

故障排查

Authentication error (401/403) on cloud ACME commands:
  • Verify you're logged in:
    bunx @temps-sdk/cli cloud whoami
  • Re-authenticate:
    bunx @temps-sdk/cli cloud login
DNS propagation timeout:
  • Cloudflare TTL is usually 60–120s; the
    --wait
    flag polls up to 120s
  • Verify the record was created:
    bunx @temps-sdk/cli cloud acme status --hostname myserver.david
  • Check manually with
    dig TXT _acme-challenge.myserver.david.temps.dev @1.1.1.1
Let's Encrypt rate limits:
  • 50 certificates per registered domain per week
  • Use
    --staging
    flag for testing:
    acme.sh --issue --staging --dns dns_temps -d '...'
  • Remove
    --staging
    for production certificates
Hook script not found:
  • Ensure the file is at
    ~/.acme.sh/dnsapi/dns_temps.sh
  • Ensure it's executable:
    chmod +x ~/.acme.sh/dnsapi/dns_temps.sh
  • The
    --dns dns_temps
    argument maps to the filename
    dns_temps.sh

Cloud ACME命令出现身份验证错误(401/403):
  • 验证是否已登录:
    bunx @temps-sdk/cli cloud whoami
  • 重新登录:
    bunx @temps-sdk/cli cloud login
DNS传播超时:
  • Cloudflare的TTL通常为60–120秒;
    --wait
    参数最多等待120秒
  • 验证记录是否已创建:
    bunx @temps-sdk/cli cloud acme status --hostname myserver.david
  • 使用
    dig TXT _acme-challenge.myserver.david.temps.dev @1.1.1.1
    手动检查
Let's Encrypt速率限制:
  • 每个注册域名每周最多申请50张证书
  • 测试时使用
    --staging
    参数:
    acme.sh --issue --staging --dns dns_temps -d '...'
  • 生产环境证书需移除
    --staging
    参数
钩子脚本未找到:
  • 确保文件路径为
    ~/.acme.sh/dnsapi/dns_temps.sh
  • 确保脚本具有可执行权限:
    chmod +x ~/.acme.sh/dnsapi/dns_temps.sh
  • --dns dns_temps
    参数对应文件名
    dns_temps.sh

Common Patterns

常见使用模式

Automation / CI/CD

自动化/CI/CD

All write commands support
-y/--yes
to skip interactive prompts:
bash
undefined
所有写入类命令均支持
-y/--yes
参数跳过交互式确认:
bash
undefined

Full CI/CD pipeline

完整CI/CD流水线

export TEMPS_TOKEN=tk_abc123 export TEMPS_API_URL=https://temps.example.com
bunx @temps-sdk/cli deploy my-app -b main -e production -y bunx @temps-sdk/cli environments vars set -p my-app -e production -k VERSION -v "1.2.3" bunx @temps-sdk/cli scans trigger --project-id 5 --environment-id 1
undefined
export TEMPS_TOKEN=tk_abc123 export TEMPS_API_URL=https://temps.example.com
bunx @temps-sdk/cli deploy my-app -b main -e production -y bunx @temps-sdk/cli environments vars set -p my-app -e production -k VERSION -v "1.2.3" bunx @temps-sdk/cli scans trigger --project-id 5 --environment-id 1
undefined

JSON Output

JSON输出

Every list/show command supports
--json
for scripting:
bash
undefined
所有列表/详情类命令均支持
--json
参数,便于脚本处理:
bash
undefined

Get project ID from slug

根据项目标识(Slug)获取项目ID

bunx @temps-sdk/cli projects show -p my-app --json | jq '.id'
bunx @temps-sdk/cli projects show -p my-app --json | jq '.id'

List running services

列出运行中的服务

bunx @temps-sdk/cli services list --json | jq '.[] | select(.status == "running")'
bunx @temps-sdk/cli services list --json | jq '.[] | select(.status == "running")'

Check deployment status

检查部署状态

bunx @temps-sdk/cli deployments status -p my-app -d 42 --json | jq '.status'
undefined
bunx @temps-sdk/cli deployments status -p my-app -d 42 --json | jq '.status'
undefined

Command Aliases

命令别名

Full CommandShort Alias
bunx @temps-sdk/cli projects
bunx @temps-sdk/cli p
bunx @temps-sdk/cli services
bunx @temps-sdk/cli svc
bunx @temps-sdk/cli containers
bunx @temps-sdk/cli cts
bunx @temps-sdk/cli deployments
bunx @temps-sdk/cli deploys
bunx @temps-sdk/cli runtime-logs
bunx @temps-sdk/cli rtlogs
bunx @temps-sdk/cli webhooks
bunx @temps-sdk/cli hooks
bunx @temps-sdk/cli proxy-logs
bunx @temps-sdk/cli plogs
bunx @temps-sdk/cli apikeys
bunx @temps-sdk/cli keys
bunx @temps-sdk/cli tokens
bunx @temps-sdk/cli token
bunx @temps-sdk/cli custom-domains
bunx @temps-sdk/cli cdom
bunx @temps-sdk/cli dns-providers
bunx @temps-sdk/cli dnsp
bunx @temps-sdk/cli email-domains
bunx @temps-sdk/cli edom
bunx @temps-sdk/cli email-providers
bunx @temps-sdk/cli eprov
bunx @temps-sdk/cli ip-access
bunx @temps-sdk/cli ipa
bunx @temps-sdk/cli load-balancer
bunx @temps-sdk/cli lb
bunx @temps-sdk/cli platform
bunx @temps-sdk/cli plat
bunx @temps-sdk/cli scans
bunx @temps-sdk/cli scan
bunx @temps-sdk/cli errors
bunx @temps-sdk/cli error
bunx @temps-sdk/cli funnels
bunx @temps-sdk/cli funnel
bunx @temps-sdk/cli incidents
bunx @temps-sdk/cli incident
bunx @temps-sdk/cli emails
bunx @temps-sdk/cli email
bunx @temps-sdk/cli templates
bunx @temps-sdk/cli tpl
bunx @temps-sdk/cli presets
bunx @temps-sdk/cli preset
bunx @temps-sdk/cli notification-preferences
bunx @temps-sdk/cli notif-prefs
|
bunx @temps-sdk/cli cloud vps
| — |
Within commands, common subcommand aliases:
list
->
ls
,
create
->
add
/
new
,
remove
->
rm
,
show
->
get
.
完整命令短别名
bunx @temps-sdk/cli projects
bunx @temps-sdk/cli p
bunx @temps-sdk/cli services
bunx @temps-sdk/cli svc
bunx @temps-sdk/cli containers
bunx @temps-sdk/cli cts
bunx @temps-sdk/cli deployments
bunx @temps-sdk/cli deploys
bunx @temps-sdk/cli runtime-logs
bunx @temps-sdk/cli rtlogs
bunx @temps-sdk/cli webhooks
bunx @temps-sdk/cli hooks
bunx @temps-sdk/cli proxy-logs
bunx @temps-sdk/cli plogs
bunx @temps-sdk/cli apikeys
bunx @temps-sdk/cli keys
bunx @temps-sdk/cli tokens
bunx @temps-sdk/cli token
bunx @temps-sdk/cli custom-domains
bunx @temps-sdk/cli cdom
bunx @temps-sdk/cli dns-providers
bunx @temps-sdk/cli dnsp
bunx @temps-sdk/cli email-domains
bunx @temps-sdk/cli edom
bunx @temps-sdk/cli email-providers
bunx @temps-sdk/cli eprov
bunx @temps-sdk/cli ip-access
bunx @temps-sdk/cli ipa
bunx @temps-sdk/cli load-balancer
bunx @temps-sdk/cli lb
bunx @temps-sdk/cli platform
bunx @temps-sdk/cli plat
bunx @temps-sdk/cli scans
bunx @temps-sdk/cli scan
bunx @temps-sdk/cli errors
bunx @temps-sdk/cli error
bunx @temps-sdk/cli funnels
bunx @temps-sdk/cli funnel
bunx @temps-sdk/cli incidents
bunx @temps-sdk/cli incident
bunx @temps-sdk/cli emails
bunx @temps-sdk/cli email
bunx @temps-sdk/cli templates
bunx @temps-sdk/cli tpl
bunx @temps-sdk/cli presets
bunx @temps-sdk/cli preset
bunx @temps-sdk/cli notification-preferences
bunx @temps-sdk/cli notif-prefs
|
bunx @temps-sdk/cli cloud vps
| — |
命令内部的子命令也支持常见别名:
list
->
ls
create
->
add
/
new
remove
->
rm
show
->
get