This repository contains the implementation of gel command-line tool.
Maintainers: see RELEASING.md for the release steps.
Install the latest stable build with:
curl --proto '=https' --tlsv1.2 -sSfL https://geldata.com/sh | sh
Nightly builds can be installed with:
$ curl --proto '=https' --tlsv1.2 -sSfL https://geldata.com/sh | sh -s -- --nightly
Install the gel-cli package from the Gelstable APT or RPM repository. Follow
the repository setup instructions,
then run sudo apt install gel-cli or sudo dnf install gel-cli. The package
installs the gel command and shell completions.
gel cli upgrade replaces the binary in place only when gel installed itself.
When the binary is owned by a package manager, it prints that manager's upgrade
command and exits without touching anything:
| Install source | What gel cli upgrade prints |
|---|---|
| Homebrew | brew upgrade gel |
| Scoop | scoop update gel |
| WinGet | winget upgrade Gelstable.Gel |
| Nix | nix profile upgrade gel-cli |
| apt, dnf, pacman | update through your system package manager |
--force does not override this. Overwriting a file a package manager owns
corrupts its record of the install, which is worse than refusing. The background
version check reports the same instruction when a newer release exists.
This repository is set up for Nix + direnv development to ensure a pinned Rust toolchain and development dependencies (such as gel-server) are active.
- Nix with Flakes enabled
- direnv (with nix-direnv recommended for caching devshell builds)
After cloning the repository, allow direnv once to load the environment automatically:
direnv allowOnce allowed, your shell will automatically load the dev environment when entering this directory. You can run standard cargo commands directly:
cargo build
cargo run -- --admin -d tutorial
cargo testAlternatively, if you don't have direnv hooked into your shell, you can enter the environment with nix develop or direnv exec . bash.
If you do not use Nix or direnv, standard cargo commands (cargo build, cargo test) will still work if you have a compatible Rust toolchain installed locally.
The registry configuration is read from cli.toml in the platform config
directory: $XDG_CONFIG_HOME/edgedb/cli.toml (usually
~/.config/edgedb/cli.toml) on Unix, or
%LOCALAPPDATA%\EdgeDB\config\cli.toml on Windows. Registry manifests can be
configured with a [registry] table and an ordered sources array:
[registry]
sources = [
"https://mirror.example.com/gel/registry.json", # operator-supplied manifest
"file:///srv/gel-registry/registry.json",
"./registry.json",
]The HTTP URL above is an operator-supplied manifest example. Sources are
checked in the order listed. A later source is used when an earlier source is
missing or unavailable; equivalent artifacts from mirrors keep the first
source, while conflicting mirror records are rejected. Relative paths are
resolved relative to cli.toml; absolute paths and file:// URLs can be used
for local manifests.
Manifest documents use schema_version = 1 and identify each package index with
channel, platform, and ref:
{
"schema_version": 1,
"indexes": [
{
"channel": "stable",
"platform": "x86_64-unknown-linux-gnu",
"ref": "indexes/stable-x86_64-unknown-linux-gnu.json"
},
{
"channel": "testing",
"platform": "x86_64-unknown-linux-gnu",
"ref": "indexes/testing-x86_64-unknown-linux-gnu.json"
}
]
}The testing entry is selected explicitly by its channel field; a client
does not infer a channel from a package version or an index filename.
Index references may be absolute HTTP(S) or file:// URLs, root-relative or
document-relative URLs for HTTP manifests, or paths relative to local manifest
files.
Each configured source is loaded atomically for the requested channel and platform. If any selected index from one source is unavailable or invalid, that source is rejected without contributing partial package data. Other healthy sources continue to work and the CLI reports the degraded source.
A source with no matching index, or a valid index with no packages, is healthy and produces an empty result. The CLI reports a registry error only when no configured source is healthy, or when healthy sources publish conflicting metadata for the same artifact identity.
For compatibility, GEL_PKG_ROOT (preferred) and the legacy
EDGEDB_PKG_ROOT environment variable select the legacy package-root mode and
override [registry].sources. Migrate to [registry].sources for manifest
configuration; remove these environment variables when they are no longer
needed. With neither an environment override nor configured sources, the
built-in default is the legacy package root https://packages.geldata.com.
That URL is a package root, not a registry manifest.
There are a few categories of tests in this repo:
-
unit tests within
src/- run with:
cargo test --bins, - no additional requirements,
- run with:
-
tests/func/- invokes the cli binary,
- run with:
cargo test --test=func, - requires
gel-serverbinary in PATH, - will use test-utils to start the server,
-
tests/shared-client-tests/- generates tests from shared-client-testcases,
- invokes the cli binary,
- run with:
cargo test --package=shared-client-tests, - will write into
/home/gel,
-
tests/portable_*.rs/- tests installation of the portable Gel server,
- will download large packages,
- run with:
cargo test --features=portable_tests --test=portable_X, - assumes you don't have any portables installed before running it,
-
Github Actions & Nightly tests
This project uses rustfmt and clippy to provide a unified code style. When opening pull requests, it is advised to run the following commands before doing so:
cargo clippy --all-features --workspace --all-targets
cargo fmtLicensed under either of
- Apache License, Version 2.0, (./LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (./LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.