Skip to content

[WIP] Add scaffolding and migration commands to CLI tool#439

Closed
hotlong with Copilot wants to merge 1 commit into
mainfrom
copilot/add-scaffolding-and-migration
Closed

[WIP] Add scaffolding and migration commands to CLI tool#439
hotlong with Copilot wants to merge 1 commit into
mainfrom
copilot/add-scaffolding-and-migration

Conversation

Copilot AI commented Jan 31, 2026

Copy link
Copy Markdown
Contributor

CLI Tool Implementation Plan

Understanding

This task involves implementing a comprehensive CLI tool for ObjectStack with the following feature areas:

  1. P0 Scaffolding: Project initialization, code generation, configuration management
  2. P0 Migration: Database migration, schema migration, data import/export
  3. P0 Code Generation: TypeScript types, API docs, form generation
  4. P1 Development Tools: Dev server, build tools, test tools

Implementation Checklist

Phase 1: Project Structure & Foundation

  • Explore existing CLI structure
  • Understand existing compile command
  • Review spec schemas and patterns
  • Create command structure for new features
  • Add necessary dependencies

Phase 2: P0 Scaffolding Commands

  • Implement os init command (project initialization)
    • Add template support (CRM, Helpdesk, Custom)
    • Add package manager detection
    • Add Git initialization
  • Implement os generate commands
    • os generate object - generate object definition
    • os generate view - generate view configuration
    • os generate app - generate app configuration
    • os generate plugin - generate plugin skeleton
  • Implement os config commands
    • os config list - list configuration
    • os config set - set configuration
    • os config get - get configuration

Phase 3: P0 Migration Commands

  • Implement os migrate commands
    • os migrate create - create migration file
    • os migrate up - execute migration
    • os migrate down - rollback migration
    • os migrate status - migration status
  • Implement data import/export
    • os import - data import
    • os export - data export

Phase 4: P0 Code Generation Commands

  • Implement type generation
    • Schema → TypeScript types
    • Zod Schema generation
  • Implement API documentation generation
    • OpenAPI/Swagger generation
  • Implement form generation
    • React form components

Phase 5: P1 Development Tools

  • Implement os dev - development server
  • Implement os build - production build
  • Implement os test - test runner

Phase 6: Testing & Documentation

  • Add tests for all commands
  • Update documentation
  • Add examples
Original prompt
  1. cli 命令行工具 / CLI Tool

6.1 当前状态 / Current State

已实现功能:

✅ 基础命令框架 (Commander.js)
✅ 配置编译 (compile 命令)
文件结构:

packages/cli/src/
├── bin.ts # CLI 入口
├── index.ts # 导出
└── commands/
└── compile.ts # 编译命令
6.2 待实现功能清单 / Features Roadmap

P0: 脚手架 (Scaffolding)

项目初始化

os init - 创建新项目
模板选择 (CRM, Helpdesk, Custom)
包管理器检测 (npm, pnpm, yarn)
Git 初始化
代码生成

os generate object - 生成对象定义
os generate view - 生成视图配置
os generate app - 生成应用配置
os generate plugin - 生成插件骨架
配置管理

os config list - 列出配置
os config set - 设置配置
os config get - 获取配置
环境配置管理
P0: 迁移 (Migration)

数据库迁移

os migrate create - 创建迁移文件
os migrate up - 执行迁移
os migrate down - 回滚迁移
os migrate status - 迁移状态
Schema 迁移

Schema 版本管理
字段添加/删除/修改
数据转换
迁移历史
数据迁移

数据导入 (os import)
数据导出 (os export)
数据转换
批量操作
P0: 代码生成 (Code Generation)

TypeScript 类型生成

Schema → TypeScript 类型
API 客户端生成
Zod Schema 生成
GraphQL Schema 生成
API 文档生成

OpenAPI/Swagger
GraphQL Schema
API 使用示例
Postman Collection
表单生成器

React 表单组件
Vue 表单组件
表单验证
样式主题
P1: 开发工具

开发服务器

os dev - 启动开发服务器
热重载 (Hot Reload)
错误提示
调试模式
构建工具

os build - 生产构建
代码优化
Tree Shaking
打包配置
测试工具

os test - 运行测试
测试覆盖率
性能测试
E2E 测试


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@vercel

vercel Bot commented Jan 31, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Ready Ready Preview, Comment Jan 31, 2026 6:57am

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants