Skip to main content

Exon CLI Reference

The Exon CLI is a command line tool for for interacting with the Exon and your underlying data. You can use the CLI in a terminal for interactive work, or in bioinformatic or data workflows. If you're doing more complex work, you may want to consider using BioBear for Python, ExonR for R, or Exon itself for Rust.

Installation

There are two ways to use the CLI: docker and, if there's a release, a binary.

Docker

You can pull and run the Exon CLI using Docker.

docker run public.ecr.aws/where-true-tech/exon-cli exon-cli -c "SELECT 1"

This will pull the latest version of the Exon CLI from the AWS Public ECR and run the SELECT 1 query against the Exon.

Consider using a specific version under the "Image Tags" tab.

Binary

You can check the releases page for the Exon CLI to see if there's a binary available for your platform. If there is, you can download and run it directly.

For example, for MacOS (ARM64) on version 0.9.3:

wget https://github.com/wheretrue/exon/releases/download/v0.9.3/exon-cli-macOS-ARM64.tar.gz
tar -xvf exon-cli-macOS-ARM64.tar.gz
./target/release/exon-cli-macOS-ARM64 -c "SELECT 1"
# +----------+
# | Int64(1) |
# +----------+
# | 1 |
# +----------+
# 1 row in set. Query took 0.005 seconds.

You can move the binary to a location in your PATH to use it more easily.

CLI Usage

The interface for the Exon CLI is fairly simple. First, if you run exon-cli without any flags, you'll start in an interactive mode.

docker run -it public.ecr.aws/where-true-tech/exon-cli exon-cli

You can also pass a query directly to the CLI, with the -c flag.

docker run public.ecr.aws/where-true-tech/exon-cli exon-cli -c "SELECT 1"

Multiple queries can be passed to the CLI by passing the -c flag multiple times.

docker run public.ecr.aws/where-true-tech/exon-cli exon-cli \
-c "CREATE TABLE t AS SELECT 1 AS a" \
-c "SELECT * FROM t"

Individual files can be passed to the CLI with the -f flag.

docker run public.ecr.aws/where-true-tech/exon-cli exon-cli -f /path/to/file.sql

Please note the file will need to be able to be found by the container.

Finally, if you want to see other options, you can run exon-cli --help.

docker run public.ecr.aws/where-true-tech/exon-cli exon-cli --help