CLI 命令参考
gocronx init
创建新项目。
bash
gocronx init [项目名] [flags]参数
| 参数 | 说明 | 默认值 |
|---|---|---|
--module | Go module 路径 | (交互式输入) |
--db | 数据库驱动:sqlite、mysql、postgres | (交互式选择) |
--redis | 启用 Redis 支持 | false |
示例
bash
# 交互式模式
gocronx init
# 所有参数齐全 — 无需交互
gocronx init myapp --module github.com/user/myapp --db postgres --redis
# 最简模式,使用 SQLite
gocronx init myapp --module github.com/user/myapp --db sqlitegocronx update
更新 CLI 到最新版本。
bash
gocronx update执行流程:
- 查询 GitHub Releases 获取最新版本号
- 如果有新版本,自动下载安装
- 优先使用
go install,如果没有 Go 环境则直接下载二进制文件
gocronx uninstall
从系统中卸载 gocronx。
bash
gocronx uninstall直接删除 gocronx 二进制文件。如果安装在系统路径(如 /usr/local/bin),可能需要 sudo 权限。
版本查看
bash
gocronx --version