Skip to main content

celq

Crates.io Documentation Playground Minimum rustc 1.94

celq is a command-line tool for evaluating Common Expression Language (CEL) expressions. It processes JSON input, performs computations, and outputs results. Think of it as if jq supported CEL.

Quick Start

celq reads JSON from the input and lets users process it with CEL:

echo '["apples", "bananas", "blueberry"]' | celq 'this.filter(s, s.contains("a"))'
# Outputs: ["apples","bananas"]

celq can also evaluate expressions with arguments, without reading from the input:

celq -n --arg='fruit:string=apple' 'fruit.contains("a")'
# Outputs: true

Popular configuration formats such as JSON5, YAML, TOML, and XML are supported. The closely related format NDJSON is also supported.

For detailed usage examples and recipes, see the manual.

Interactive Playground

Want to try celq without installing anything? Visit the celq-playground to try it in your browser!

Why?

There are implementations of CEL for Go, Java, C++, JavaScript, Python, C#, Rust, Ruby, and possibly more languages.

celq brings the same CEL syntax to the command-line. celq is not necessarily better than jq, but perhaps it makes it easier to reuse snippets of code across multiple places.

Moreover, the CEL specification is simpler than the jqlang specification. If you need something less powerful than jq or Python, then celq might be what you are looking for.

Check our comparison with other tools for more details.

Installation

Pre-built Binaries

We publish pre-built binaries for Linux, macOS, FreeBSD, and Windows in celq's GitHub Releases page. To install the current version for Linux or macOS, run:

curl --proto '=https' --tlsv1.2 -sSf https://get-celq.github.io/install.sh | bash

Notice that the installer tries not to be clever and doesn't modify $PATH or overwrite existing files. To specify a destination, use the --to flag:

curl --proto '=https' --tlsv1.2 -sSf https://get-celq.github.io/install.sh | \
    bash -s -- --to DESTINATION

See the installation guide for more details on the installer such as --force to replace existing binaries, --target to specify which binary to download, versioned URLs, GitHub tokens, attestations, and more.

Homebrew (macOS)

If you are a macOS Homebrew user, then you can install celq with:

brew install get-celq/tap/celq

Scoop (Windows)

If you are a Scoop user on Windows, you can install celq with:

scoop bucket add get-celq https://github.com/get-celq/scoop-bucket
scoop install get-celq/celq

Chocolatey (Windows)

If you are a Chocolatey user on Windows, you can install celq with:

choco install celq

WinGet (Windows)

If you are a WinGet user on Windows, you can install celq with:

winget install IvanIsCoding.celq

Cargo

Installing From Source

If you want to install from source, celq publishes to crates.io.

cargo install celq --locked

Installing With cargo-binstall

If you have cargo-binstall installed, you can install pre-built binaries directly:

cargo binstall celq

Mise

celq can be used with mise. To install celq, use the Conda back-end:

mise use -g conda:celq

Alternatively, add this to mise.toml:

[tools]
"conda:celq" = "latest"

GitHub Actions

celq can be used in GitHub actions. For one-off commands, the get-celq/celq-action is the quickest way:

- name: Example Celq Action
  id: exampleID
  uses: get-celq/celq-action@main
  with:
    cmd: celq 'this.exampleID' < example.json

- name: Reuse a variable obtained in another step
  run: echo ${{ steps.exampleID.outputs.result }}

See the installation guide for more details on GitHub actions such as pinning the celq version and the Action itself.

If you are going to use celq in scripts or for multiple calls, we recommend using taiki-e/install-action:

- uses: taiki-e/install-action@v2
  with:
    tool: celq

Nix

celq is available for Nix. To run it as a Flake:

nix run github:IvanIsCoding/celq -- -n '"Hello World"'

By default, Nix fetches the stable version from crates.io. If you want to run the code from HEAD, use the dev derivation:

nix run github:IvanIsCoding/celq#dev -- -n '"Hello World"'

See the installation guide for other Nix setups.

FreeBSD

FreeBSD builds are tested with freebsd-vm and cross-compiled with Zig. Although celq is not yet in the ports tree, it does publish pre-built binaries:

VERSION=v0.7.0
RELEASE_URL=https://github.com/IvanIsCoding/celq/releases/download/${VERSION}
PLATFORM=x86_64 # or aarch64

fetch ${RELEASE_URL}/celq-freebsd-${PLATFORM}.tar.gz

tar xzf celq-freebsd-${PLATFORM}.tar.gz
su root -c 'install -m 755 celq /usr/local/bin/'

celq can also be installed from source following the Cargo section. We strive to always compile with the Rust version provided in the ports tree.

OpenBSD

OpenBSD builds are tested in CI using the latest stable release. celq strives to always compile with the Rust version provided in the ports tree. Refer to the Cargo section for installation instructions.

NetBSD

NetBSD builds are tested in CI against the latest stable release. celq aims to remain compatible with the Rust version provided by the NetBSD pkgsrc quarterly branch. See the Cargo section for installation instructions.

NPM (Node.js/JavaScript)

celq is packaged for NPM. Node.js users can install celq in their project with:

npm install celq

This adds celq to package.json and makes it available for scripts. It is also possible to run single commands with npx:

npx celq -n '"Hello World"'

Python

celq is packaged for PyPI. Python users can install it with pip:

pip install celq

If you have uv installed, celq can be used as a tool:

uvx celq -n '"Hello World"'

Conda Forge

celq is available on conda-forge and can be installed with conda, mamba, micromamba, and pixi:

conda install -c conda-forge celq

If you have pixi, you can run celq in a temporary environment with:

pixi exec celq -n '"Hello World"'

Skills

To teach agents how to use celq, we provide a skill at get-celq/agent-skills.

Install it with the skills CLI:

npx skills add get-celq/agent-skills --skill celq

Or install it with the GitHub CLI:

gh skill install get-celq/agent-skills celq

Limitations

Eager JSON Parsing

celq eagerly parses all JSON input into memory before evaluation. This design was made to simplify the code implementation, at the cost of memory and performance.

Currently, there are no benchmarks for celq. I believe the tool is "good enough" for my personal use. That might be revisited in the future. In the meantime, expect celq to be slower than jq. With that being said, celq feels snappy in practice. celq glues together Rust parsers that are performant with a CEL engine that strives to be fast.

CEL Implementation Differences

celq uses cel-rust, a community-maintained Rust implementation of CEL, rather than the official Go implementation.

There may be edge cases or advanced features where behavior differs from the official implementation. If you find one, open an issue at the celq repository and we'll triage the issue before sending it to cel-rust.

Malformed expressions

Currently, the error messages for CEL expressions that are invalid are cryptic. We will enhance them in future releases.

Non-Goals

REPL

While conceptually interesting, celq does not aim to be a CEL REPL. In the original author's view, that should live on a separate binary.

Full YAML Support

celq works with JSON. YAML is supported as a best-effort. If the ingested YAML can be translated to JSON, celq most likely works fine. Full YAML support is out-of-scope, as the specification has too many edge cases.

Acknowledgments

Special thanks to the maintainers of:

  • cel-rust for providing the CEL evaluation engine that powers celq
  • cel-python for publishing their CLI. celq has heavily drawn from their interface
  • jaq for giving an excellent blueprint on how to test a Rust CLI
  • gron for greppable JSON

Large Language Models Disclosure

Many commits in this repository were co-authored by LLMs. All commits were guided and reviewed by a human. I tried my best to keep things simple and auditable.

All the documentation in the manual has been hand-crafted. That was done to keep the tone of the original author. If you find a typo or a grammar mistake, please send a pull request.

License

This project is dual-licensed under the MIT License and Apache 2.0 licenses. See LICENSE-MIT and LICENSE-APACHE files for details.

The install.sh published with each GitHub release and its template at the root of the repository (template_install.sh) are licensed independently. Those files are under the CC0-1.0 license. They are the original work of Casey Rodarmor from just and have been adapted for celq.

Contributing

Contributions are welcome! See CONTRIBUTING.md for more details.

Unless explicitly stated otherwise, any contribution intentionally submitted for inclusion in celq by you shall be dual-licensed under the MIT License and the Apache 2.0 license. Contributions to template_install.sh shall be dedicated to the public domain. Any additional terms or conditions shall not apply.

Metadata

Release files for celq 0.7.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for celq 0.7.0
File Size Uploaded
celq-0.7.0.tar.gz 66.5 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for celq 0.7.0
File
celq-0.7.0-py3-none-win_arm64.whl Python 3 none Windows ARM64 Details
celq-0.7.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
celq-0.7.0-py3-none-musllinux_1_2_x86_64.whl Python 3 none Linux musl 1.2+ x86-64 Details
celq-0.7.0-py3-none-musllinux_1_2_riscv64.whl Python 3 none Linux musl 1.2+ RISC-V 64 Details
celq-0.7.0-py3-none-musllinux_1_2_ppc64le.whl Python 3 none Linux musl 1.2+ PowerPC 64-le Details
celq-0.7.0-py3-none-musllinux_1_2_aarch64.whl Python 3 none Linux musl 1.2+ ARM64 Details
celq-0.7.0-py3-none-manylinux_2_31_riscv64.whl Python 3 none Linux glibc 2.31+ RISC-V 64 Details
celq-0.7.0-py3-none-manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.28+ x86-64 Details
celq-0.7.0-py3-none-manylinux_2_28_ppc64le.whl Python 3 none Linux glibc 2.28+ PowerPC 64-le Details
celq-0.7.0-py3-none-manylinux_2_28_aarch64.whl Python 3 none Linux glibc 2.28+ ARM64 Details
celq-0.7.0-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details
celq-0.7.0-py3-none-macosx_10_12_x86_64.whl Python 3 none macOS 10.12+ x86-64 Details

Total release size: 26.0 MB

Release files / celq-0.7.0.tar.gz

Download URL celq-0.7.0.tar.gz
Size 66.5 kB
Tags Source
SHA-256 checksum
How to use checksums
1f39a60d0db27d148de3f110c63c3826fc46cd15f76c100d37f7b2dc7ebca602
BLAKE2b-256 checksum
How to use checksums
8175ed62edf6383465ed814aead5186a8ee8ba6dee4dde85f9f5b699438083e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / celq-0.7.0-py3-none-win_arm64.whl

Download URL celq-0.7.0-py3-none-win_arm64.whl
Size 2.0 MB
Tags Python 3 Windows ARM64
SHA-256 checksum
How to use checksums
fbb51131d6031439c3d06bb688f7cec72847dccd6f494351049e59f3d6034ac4
BLAKE2b-256 checksum
How to use checksums
bb81c7a5c78b4238ff19dd91e4488ef384cf4c9461a0f2cac7e90ec8f61c3784
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / celq-0.7.0-py3-none-win_amd64.whl

Download URL celq-0.7.0-py3-none-win_amd64.whl
Size 2.1 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
06e5e021afac66860087cecb1a806dae4a7743f378e166af6f807a4f9c992a39
BLAKE2b-256 checksum
How to use checksums
4d863029b6e57f25abd63e4c795de46d4f6de4b56f70cd8d83c2aef9a388217f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / celq-0.7.0-py3-none-musllinux_1_2_x86_64.whl

Download URL celq-0.7.0-py3-none-musllinux_1_2_x86_64.whl
Size 2.2 MB
Tags Linux musl 1.2+ x86-64 Python 3
SHA-256 checksum
How to use checksums
0c996f4c48b6833c7f2f5ad61d2c3c8fdac5ef1d9db48b607bb1bba4dd60d209
BLAKE2b-256 checksum
How to use checksums
bf5fdcf13500b66abbfd5eb446023041b2d0774d324af19b9541d729f7ac4515
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / celq-0.7.0-py3-none-musllinux_1_2_riscv64.whl

Download URL celq-0.7.0-py3-none-musllinux_1_2_riscv64.whl
Size 2.2 MB
Tags Linux musl 1.2+ RISC-V 64 Python 3
SHA-256 checksum
How to use checksums
9288d03c0680f9c9c11c9e7a9d63f5c9f817dc6ff1c9b0d9e3a0c4776d2c5dfc
BLAKE2b-256 checksum
How to use checksums
bed07b3fd90f87536a7863fd7dbb4dc62f30e4fc6e8cf8472be52296c997f83d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / celq-0.7.0-py3-none-musllinux_1_2_ppc64le.whl

Download URL celq-0.7.0-py3-none-musllinux_1_2_ppc64le.whl
Size 2.3 MB
Tags Linux musl 1.2+ PowerPC 64-le Python 3
SHA-256 checksum
How to use checksums
1a80210d83f30e0c2e144be098505cfb760865c9cc6990df2847fb8e8f685598
BLAKE2b-256 checksum
How to use checksums
fec23849b6b4c9a154fd890243ec4e1469f23f99be60d9f5586304a90c21af36
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / celq-0.7.0-py3-none-musllinux_1_2_aarch64.whl

Download URL celq-0.7.0-py3-none-musllinux_1_2_aarch64.whl
Size 2.1 MB
Tags Linux musl 1.2+ ARM64 Python 3
SHA-256 checksum
How to use checksums
76df025e70f71715d76843ce9a18df403b34f834311049c694c0c178ca380b62
BLAKE2b-256 checksum
How to use checksums
0739b442cbf40f5d85476b10e113a88f483d6f1becbfef0ea39bb1c787036156
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / celq-0.7.0-py3-none-manylinux_2_31_riscv64.whl

Download URL celq-0.7.0-py3-none-manylinux_2_31_riscv64.whl
Size 2.1 MB
Tags Linux glibc 2.31+ RISC-V 64 Python 3
SHA-256 checksum
How to use checksums
abedc912eb2cc33c94e1218074e006c99be3f756e00cf48db0643a3da5871c34
BLAKE2b-256 checksum
How to use checksums
1e52d292968b8d863124043ef01bf9f029b312918e8ba790055d9996feb5edfe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / celq-0.7.0-py3-none-manylinux_2_28_x86_64.whl

Download URL celq-0.7.0-py3-none-manylinux_2_28_x86_64.whl
Size 2.2 MB
Tags Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
d609279684dfc6c7f00edea71d34eb99ae7bb2a0d09f64de4ddfe89f2b5b2e7f
BLAKE2b-256 checksum
How to use checksums
156f6be964f926b8d596e4d6611c289ef013edda0a912044704fe553f7adbbac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / celq-0.7.0-py3-none-manylinux_2_28_ppc64le.whl

Download URL celq-0.7.0-py3-none-manylinux_2_28_ppc64le.whl
Size 2.4 MB
Tags Linux glibc 2.28+ PowerPC 64-le Python 3
SHA-256 checksum
How to use checksums
8f9c7231f20e0d93c24212755d1d4320835ab59b849ad02256e1d81e4fba33d0
BLAKE2b-256 checksum
How to use checksums
75e368babde2e021d1b725e701e84eb60db1b8045c3e77027772f690c36e1939
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / celq-0.7.0-py3-none-manylinux_2_28_aarch64.whl

Download URL celq-0.7.0-py3-none-manylinux_2_28_aarch64.whl
Size 2.1 MB
Tags Linux glibc 2.28+ ARM64 Python 3
SHA-256 checksum
How to use checksums
43b93d6c31a05edd53b5367361b177b706edb1ac5a663f53eaaa8668e9b6ba3c
BLAKE2b-256 checksum
How to use checksums
e6ddfbc7856279f4643d868ed9495e5e8d40e08bc8d56190dda34718c1a4f592
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / celq-0.7.0-py3-none-macosx_11_0_arm64.whl

Download URL celq-0.7.0-py3-none-macosx_11_0_arm64.whl
Size 2.1 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
4b391c66149e93427f937540736d2eec8d4211178bf0842d17e39473f9f3545a
BLAKE2b-256 checksum
How to use checksums
93e441481f7cffb378c31aed1d62300f218236aba2ee06a0671d3c692367a2c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / celq-0.7.0-py3-none-macosx_10_12_x86_64.whl

Download URL celq-0.7.0-py3-none-macosx_10_12_x86_64.whl
Size 2.2 MB
Tags Python 3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
125f7fba329a9f061b46512af0a12bb722158f1655db7473112f44c34ddfd9fc
BLAKE2b-256 checksum
How to use checksums
43b6ae24fca789f25fb4e5072324ab29d938d90657afb9463151d9bdf1de8d70
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page