Skip to content

About

dev workflow tools

Resources

Stars

27 stars

Watchers

1 watching

Forks

Repository files navigation

Galaxy Flow

CI Coverage Status Dependencies Downloads License: Apache-2.0 Rust 2024 edition GitHub stars

Galaxy Flow 是基于 GXL 的开源自动化工作流引擎,提供自动化编排与执行底座,当前以 gx 作为统一 CLI 入口:

  • gx run:执行工作流(默认读取 ./_gal/work.gxl)
  • gx adm:执行管理流(默认读取 ./_gal/adm.gxl)
  • gx init/mod/doc/check/self:项目与工具管理

在整体产品分工中:

  • galaxy-flow 负责流程定义与执行
  • galaxy-ops 负责运维能力的组织、配置与交付

GXL 内置能力 / GXL built-ins

这些是 GXL(工作流定义语言)内置的 gx.* 能力:

  • gx.assert
  • gx.cmd
  • gx.echo
  • gx.read_file / gx.read_cmd / gx.read_stdin
  • gx.vars(仅 env 内)
  • gx.tpl
  • gx.ver
  • gx.run
  • gx.shell
  • gx.tar / gx.untar
  • gx.download / gx.upload
  • gx.patch_file
  • 表达式函数:defined(${VAR})

详细说明见 docs/gxl/inner/index.md;速查(参数、示例、坑位)见 gx-skills 的 gxl-authoring skill。

安装说明 / Installation

一键安装(推荐)

稳定版

curl -sSf https://get.warpparse.ai/inst-x.sh | bash -s -- gx

测试版(beta 通道)

curl -sSf https://get.warpparse.ai/inst-x.sh | bash -s -- gx beta

开发版(alpha 通道)

curl -sSf https://get.warpparse.ai/inst-x.sh | bash -s -- gx alpha

默认安装到:$HOME/bin。如需自定义安装目录:

curl -sSf https://get.warpparse.ai/inst-x.sh | WP_INST_INSTALL_DIR=/usr/local/bin bash -s -- gx

安装后验证:

gx --version

如果提示命令不存在,请把安装目录加入 PATH(例如 $HOME/bin)。

Quick Start

Build

cargo build --workspace

如果本机启用了 sccache 且报错,可临时关闭:

RUSTC_WRAPPER='' cargo build --workspace

Initialize Project

# 初始化运行环境(首次使用)
gx init env

# 初始化项目(本地,不依赖远程模板)
gx init project

# 初始化项目(从默认模板仓库的子目录)
# 默认仓库:https://github.com/galaxio-labs/prj-tpl.git
gx init project --path rust

# 初始化项目(从指定仓库 / 指定仓库子目录)
gx init project --repo https://your-tpl-repo.git
gx init project --repo https://your-tpl-repo.git --path subdir --branch dev

其中 gx init env 会初始化 ~/.galaxy/ 下的用户级运行配置,包括 conf.toml。

gx init project 不带 --repo/--path 时执行本地初始化,创建基本的 ./_gal/work.gxl 和 ./_gal/adm.gxl 文件;带 --path(或 --repo)时从 git 仓库拉取模板,--branch 与 --tag 互斥。详见 docs/guidle/cli/gx.md。

Run Flows

# 查看工作流信息
gx run

# 运行工作流中的 conf flow
gx run conf

# 运行管理流中的 conf flow
gx adm conf

CLI Overview

主命令:

gx <COMMAND>

一级命令:run / adm / init / mod / doc / check / self

常用子命令:

gx run — 执行工作流

gx run                       # 不传 flow 时列出可用 flow / env
gx run build -e debug        # 执行 build 流(环境 debug)
gx run conf                  # 运行工作流中的 conf flow
gx run test

常用参数:-e/--env、-c/--conf、-d/--debug、--log、-q/--quiet、--cmd-arg、--dryrun、--ai(当前无效)

gx adm — 执行管理流

gx adm                       # 列出管理流
gx adm conf                  # 运行管理流中的 conf flow
gx adm v_patch               # 版本升级(patch)
gx adm tag_alpha             # 打 alpha 标签(会 push 远程)

gx init — 初始化

gx init env                  # 初始化用户级运行环境(~/.galaxy/,含 conf.toml)
gx init project              # 本地初始化(_gal/work.gxl + _gal/adm.gxl)
gx init project --path rust  # 从默认模板仓库的子目录拉取
gx init project --repo <url> --path <subdir> --branch <b>   # 指定仓库 / 子目录 / 分支(--branch 与 --tag 互斥)

gx mod — 模块管理

gx mod update                # 更新本地 _gal 声明的模块

gx doc — 内置文档

gx doc                       # 列出主题
gx doc gx                    # 查看主题(如 gx / gxl / gx.cmd)

gx check

gx check                     # 打印当前运行环境信息

gx self — 自升级

gx self status
gx self check --channel <stable|alpha|beta>
gx self update --channel <stable|alpha|beta> [--to <version>] [--dry-run] [--force] --yes
gx self rollback [--id <backup_id>]

# agent skills
gx self skill install           # 安装 gx skills(默认源 galaxio-labs/gx-skills)
gx self skill list              # 列出可安装的 skills
  • rollback 参数是 --id,不是 --backup-id
  • gx self skill install [skill] [--source <owner/repo|url|dir>] [--ref <branch|tag>] [--target codex|claude|zed|all] [--dir <path>] [--symlink] [--yes]:从仓库安装 agent skills(默认源 galaxio-labs/gx-skills),装前校验 SKILL.md frontmatter;gx self skill list 列出可安装项
  • 更新包下载到临时目录,完成后清理;成功更新后替换当前安装目录中的 gx
  • 备份与状态目录:~/.galaxy/self_update/state.json、~/.galaxy/self_update/backups/<backup_id>/
  • Manifest 来源:https://raw.githubusercontent.com/galaxio-labs/get/main/updates/gx/{channel}/manifest.json

gx.patch_file Notes

  • strict 默认 true,语义是:marker 结构异常即失败
  • 注释/反注释动作要求 comment_prefix 非空
  • marker 支持 @gxl:*,并兼容 #@gxl:*、//@gxl:*(匹配 token 本体)

Docs

Release

GitHub Releases:

About

dev workflow tools

Resources

Stars

27 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages