@edgespark/cli

中文文档
0.0.25发布于 2026/10/26MITES Module近 30 天下载 2093

EdgeSpark CLI - Create and manage your EdgeSpark projects

原始使用文档
文档目录16 节
  1. Installation
  2. Usage
  3. Initialize a new project
  4. Pull from EdgeSpark platform
  5. Manage custom domains
  6. Help
  7. Commands
  8. Project Structure
  9. Development
  10. Publishing
  11. 1. Beta release
  12. 2. Iterate on beta
  13. 3. Test beta
  14. 4. Graduate to release
  15. Version commands cheat sheet
  16. License

@edgespark/cli

EdgeSpark CLI - Create and manage your EdgeSpark projects.

Installation

npm install -g @edgespark/cli

Usage

Initialize a new project

# With specific AI agent (--agent is required)
edgespark init my-project --agent claude    # Creates CLAUDE.md
edgespark init my-project --agent gemini    # Creates GEMINI.md
edgespark init my-project --agent codex     # Creates AGENTS.md

Agent options: claude, codex, gemini (others fall back to AGENTS.md)

Pull from EdgeSpark platform

edgespark pull

Pulls the latest generated artifacts from your EdgeSpark project:

  • schema files into src/__generated__/
  • SDK types into src/__generated__/edgespark.d.ts and src/__generated__/server-types.d.ts

Import boundary in generated projects:

  • src/defs/** may import shared types from @sdk/server-types
  • src/defs/** must not import from "edgespark"
  • route and application code should import runtime SDK values from "edgespark"

You can also pull selectively:

edgespark pull schema
edgespark pull types

Manage custom domains

Custom domains are production-only. Staging custom domains are not supported.

# Start domain setup and get the required DNS records
edgespark domain add app.example.com

# Poll verification and activate routing once DNS is in place
edgespark domain verify app.example.com

# Inspect current status, DNS records, and any warnings
edgespark domain status app.example.com

# List all custom domains for the current project
edgespark domain list

# Remove a custom domain and release the claim
edgespark domain remove app.example.com

domain add and domain status always return the manual DNS records needed for setup.
When EdgeSpark can build a supported Domain Connect setup URL, it is returned as a convenience, but manual DNS remains the source of truth.

Help

# General help
edgespark --help

# Command-specific help
edgespark init --help
edgespark pull --help

Commands

CommandDescription
edgespark init <name> --agent <name>Initialize a new EdgeSpark project
edgespark db generateGenerate migration files from src/defs/db_schema.ts
edgespark db migrateApply pending migrations to the project database
edgespark db studioOpen a database browser for the project database
edgespark db checkValidate local migration consistency
edgespark db sqlRun ad-hoc SQL against the project database
edgespark domain add <hostname>Start custom domain setup and print DNS records
edgespark domain verify <hostname>Check whether a custom domain is active
edgespark domain status <hostname>Show current custom domain status and DNS guidance
edgespark domain listList custom domains for the current project
edgespark domain remove <hostname>Remove a custom domain from the project
edgespark pullPull schemas and types from EdgeSpark
edgespark pull schemaPull platform-managed system DB schema
edgespark pull typesPull generated SDK type declarations

Project Structure

After running edgespark init, your project will have:

my-project/
├── src/
│   ├── index.ts              # Your API routes (Hono)
│   ├── __generated__/        # Generated artifacts (pulled from platform)
│   │   ├── index.ts          # Barrel exports
│   │   ├── sys_schema.ts     # System database schema (Drizzle ORM)
│   │   ├── sys_relations.ts  # System relation definitions (if any)
│   │   ├── storage_schema.ts # Storage bucket definitions
│   │   ├── edgespark.d.ts    # What user code can import from "edgespark" and "edgespark/*"
│   │   └── server-types.d.ts # Shared SDK type definitions
├── edgespark.toml            # Project configuration
├── package.json
├── tsconfig.json
└── AGENTS.md                 # AI coding agent instructions (or CLAUDE.md / GEMINI.md)

Development

npm run build:dev   # tsc (for development/tests)
npm run dev         # tsc --watch
npm test            # run tests
npm run link        # build bundle + npm link for local testing

Publishing

prepublishOnly automatically runs esbuild + copies templates before any publish.

1. Beta release

npm version <version>-beta.0       # first beta for a new version (manual)
npm publish --tag beta             # publish to "beta" tag (latest untouched)

2. Iterate on beta

npm version prerelease             # auto-bumps beta.0 → beta.1 → beta.2
npm publish --tag beta

3. Test beta

npm install -g @edgespark/cli@beta # install globally
edgespark --version                # verify
npx @edgespark/cli@beta --version  # or test without global install

4. Graduate to release

npm version patch                  # 0.0.X-beta.N → 0.0.X (clean version)
npm publish                        # publishes to "latest" tag

Version commands cheat sheet

CommandExample
npm version <version>-beta.0First beta (manual)
npm version prereleasebeta.0 → beta.1
npm version patch0.0.10-beta.2 → 0.0.10
npm version minor→ 0.1.0
npm version major→ 1.0.0

License

MIT

版本与发布记录

@edgespark/cli 共发布 59 个版本,首次发布于 2025/12/08;过去 12 个月发布了 59 个版本。

版本发布日期距今
0.0.25latest2026/10/2618 天前
0.0.242026/10/2024 天前
0.0.0-beta.8b6c080beta2026/10/2024 天前
0.0.232026/08/123 个月前
0.0.222026/07/104 个月前
0.0.212026/05/255 个月前

其他发布通道:alpha → 0.0.1-alpha.9,beta → 0.0.0-beta.8b6c080。

关于 @edgespark/cli 的常见问题

@edgespark/cli 是什么?

EdgeSpark CLI - Create and manage your EdgeSpark projects

如何安装 @edgespark/cli?

在项目目录运行 npm install @edgespark/cli,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 edgespark,可以用 npx edgespark 直接运行。

@edgespark/cli 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/edgespark__cli 是否存在。

@edgespark/cli 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@edgespark/cli 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22.0.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@edgespark/cli 可以商用吗?

@edgespark/cli 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@edgespark/cli 的下载量有多少?

根据 npm 官方下载统计,@edgespark/cli 在 2026/10/13 – 2026/11/11 这 30 天内被下载 2,093 次,日均约 70 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@edgespark/cli 还在维护吗?

最新版本 0.0.25 发布于 2026/10/26(18 天前);至今共发布 59 个版本,其中过去 12 个月发布了 59 个;首次发布于 2025/12/08。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。