The Gel CLI​
The gel
command-line interface (CLI) provides an idiomatic way to spin up local instances, open a REPL, execute queries, manage auth roles, introspect schema, create migrations, and more.
If you're using JavaScript or Python, our client libraries will handle downloading and running the CLI for you using tools like npx
and uvx
.
For everyone else, or if you wish to install the CLI globally, you can install using our bash installer or your operating system's package manager.
$
curl https://www.geldata.com/sh --proto "=https" -sSf1 | sh
PS>
irm https://www.geldata.com/ps1 | iex
$
brew install geldata/tap/gel-cli
$
nix-shell -p gel
$
npx gel --version
$
uvx gel --version
Connection options
All commands respect a common set of connection options, which let you specify a target instance. This instance can be local to your machine or hosted remotely.
Uninstallation
Command-line tools contain just one binary, so to remove it on Linux or macOS run:
$
rm "$(which gel)"
To remove all configuration files, run gel info
to list the directories
where Gel stores data, then use rm -rf <dir>
to delete those
directories.
If the command-line tool was installed by the user (recommended) then it will also remove the binary.
If you've used gel
commands you can also delete
instances and server packages, prior to removing the
tool:
$
gel instance destroy <instance_name>
To list instances and server versions use the following commands respectively:
$
gel instance status
$
gel server list-versions --installed-only
Configure CLI and REPL
You can customize the behavior of the gel
CLI and REPL with a
global configuration file. The file is called cli.toml
and its
location differs between operating systems. Use
gel info to find the "Config" directory on your
system.
The cli.toml
has the following structure. All fields are optional:
[shell]
expand-strings = true # Stop escaping newlines in quoted strings
history-size = 10000 # Set number of entries retained in history
implicit-properties = false # Print implicit properties of objects
limit = 100 # Set implicit LIMIT
# Defaults to 100, specify 0 to disable
input-mode = "emacs" # Set input mode. One of: vi, emacs
output-format = "default" # Set output format.
# One of: default, json, json-pretty,
# json-lines
print-stats = "off" # Print statistics on each query.
# One of: off, query, detailed
verbose-errors = false # Print all errors with maximum verbosity