Gel CLI
$ gel 官方出品 中风险gel 是 Gel(原 EdgeDB)的 Rust CLI,支持以 --output-format json(含 json-pretty、json-lines)执行 EdgeQL/SQL 查询、管理本地与云端实例生命周期,并通过 --non-interactive 生成与执行模式迁移(gel migration create、gel migrate)。
brew install geldata/tap/gel-cli gel 直接读取本地 gel.toml 与 dbschema/ 迁移目录完成模式比对和 JSON 查询,无需额外封装 MCP。
Agent 友好度体检单
当前为静态评估(本机尚未安装或尚未运行探针)。可在本地运行 npm run data:probe 并提交 data/probes/ 升级为实测证据。
FCRS-1.0 六维评分拆解
gel query 支持 --output-format json / json-pretty / json-lines,创建迁移支持 --non-interactive,migrate 支持 --quiet。
gel query --output-format json-linesandgel migration create --non-interactive
将迁移生成(migration create)与执行(migrate)解耦,提供 gel migration status 状态核查,并支持 --dsn 与凭据文件隔离。
- Two-step
migration create+migrateworkflow andmigration statuscheck
单一 Rust 二进制,可通过 Homebrew tap(geldata/tap/gel-cli)与官方脚本在 macOS、Linux 与 Windows 安装。
- Native Rust binary distributed via Homebrew tap and install script
围绕 gel.toml 统一本地实例管理、EdgeQL/SQL 查询与模式差异迁移。
- Integrated
query,migration,instance, andprojectcommands
由 Gel Data 官方维护(geldata/gel-cli),采用 Apache-2.0 OR MIT 开源协议。
- Official Gel Data repository under Apache-2.0 / MIT
docs.geldata.com/reference/cli 与 --help 提供了清晰的命令参数文档。
- Official CLI reference at docs.geldata.com
安全边界、鉴权与放权指南
将实例凭据保存在 ~/.config/edgedb/credentials/(或 Gel 配置目录),同时支持 --dsn、--credentials-file 及 GEL_DSN / GEL_SECRET_KEY 环境变量。
CLI 采用 Apache-2.0 / MIT 双协议开源;Gel Cloud 托管实例按云服务计费。
# Gel CLI (gel) Agent Rules - Use `gel query --output-format json` (or `json-lines`) for parseable query output. - Always pass `--non-interactive` on `gel migration create` and verify with `gel migration status` before `gel migrate`. - Avoid `--dev-mode` on shared or production instances.
Agent 高频安全命令配方
只读查询(安全推荐)
gel query --output-format json-lines "select schema::ObjectType { name } filter .builtin = false;" 查询 Gel 中用户自定义对象类型并输出换行分隔的 JSON。
gel migration status
对比本地 dbschema/migrations/ 文件与目标实例当前的迁移版本。
受控写入与预演
gel migration create --non-interactive
根据 dbschema/ 变更生成下一个 .edgeql 迁移脚本而不触发交互问答。
核心优势
- +
gel query原生支持json、json-pretty与json-lines输出格式。 - +
gel migration create --non-interactive可基于dbschema/差异生成确定性的.edgeql迁移文件。
注意事项与踩坑点
- ! 遇到字段重命名等歧义变更时,
--non-interactive会直接报错并需要人工决策。 - ! 从
edgedb更名为gel后,旧项目仍可能残留edgedb.toml或EDGEDB_*环境变量。