Command line tool (fda)
fda is a command line utility for interacting with the Feldera Manager's REST API.
It allows you to create, manage, and monitor pipelines. It also features an interactive
shell for inspecting and modifying the state of tables and views using SQL commands.
Installation
Quick Install (Linux)
curl -fsSL https://feldera.com/install-fda | bash
| Supported platforms |
|---|
| linux-x86_64 |
| linux-aarch64 |
Requires glibc >= 2.39 (Ubuntu 24.04+, Debian 13+, Fedora 40+, RHEL 10+).
Installing a Specific Version
Since fda is a single binary, you can update or install older versions by re-running the installer script.
To install a specific version, pass the release git tag to the install script:
curl -fsSL https://feldera.com/install-fda | FDA_VERSION=v0.247.0 bash
To install to a custom directory:
curl -fsSL https://feldera.com/install-fda | FDA_VERSION=v0.247.0 FELDERA_INSTALL=/opt/feldera bash
Using Cargo (Windows, MacOS)
To install fda with Cargo, you need a working Rust environment. You can install Rust by following
the instructions on the Rust website.
Run the following command to install fda as a Rust crate:
cargo install fda
Alternatively, to build and install the latest fda revision from our main git branch, run the following command:
cargo install --git https://github.com/feldera/feldera fda
To build from the sources in your local feldera repository, you can install fda with the
following commands:
cd crates/fda
cargo install --path .
Optional: Shell completion
Once the fda binary is installed, you can enable shell command completion for fda
by adding the following line to your shell init script.
- Bash
echo "source <(COMPLETE=bash fda)" >> ~/.bashrc
- Elvish
echo "eval (COMPLETE=elvish fda)" >> ~/.elvish/rc.elv
- Fish
echo "source (COMPLETE=fish fda | psub)" >> ~/.config/fish/config.fish
- Powershell
echo "COMPLETE=powershell fda | Invoke-Expression" >> $PROFILE
- Zsh
echo "source <(COMPLETE=zsh fda)" >> ~/.zshrc
Connecting & Authentication
To connect to the Feldera manager, you need to provide the URL of the manager. You can either provide the URL as an
environment variable or as a command line argument. The environment variable is called FELDERA_HOST and the
command line argument is called --host.
If your Feldera instance requires authentication (not needed in the local docker form factor), you'll also need to
provide an API key. You can either set the API key as an environment variable or as a command line argument.
The environment variable is called FELDERA_API_KEY and the command line argument is called --auth.
It is recommended to use an environment variable configured in your shell init script to avoid storing the API
key in your shell history.
You can create a new API key by logging into the Feldera WebConsole. Once logged in, click on your profile in the top right. Go to Manage API Keys and click Generate new key.
Examples
Specify the host and API key as command line arguments or environment variables:
fda --host https://try.feldera.com --auth apikey:0aKFj50iE... pipelines
export FELDERA_HOST=https://try.feldera.com
export FELDERA_API_KEY=apikey:0aKFj50iE...
fda pipelines
Create a new pipeline p1 from a program.sql file:
echo "CREATE TABLE example ( id INT NOT NULL PRIMARY KEY );
CREATE VIEW example_count AS ( SELECT COUNT(*) AS num_rows FROM example );" > program.sql
fda create p1 program.sql
Retrieve the program for p1 and create a new pipeline p2 from it:
fda program get p1 | fda create p2 -s
Enable storage for p1:
fda set-config p1 storage true
Add Rust UDF code to p1:
fda program set p1 --udf-toml udf.toml --udf-rs udf.rs
Run the pipeline p1:
fda start p1
Start a transaction for p1:
fda start-transaction p1
Commit a transaction for p1:
fda commit-transaction p1
Retrieve the stats for p1:
fda stats p1
Retrieve the latest log messages for p1:
fda logs p1
Download the support bundle for p1:
fda support-bundle p1
Shutdown and delete the pipeline p1:
fda shutdown p1
fda delete p1
Execute ad-hoc SQL query:
fda exec pipeline-name "SELECT * FROM materialized_view;"
cat query.sql | fda exec pipeline-name -s
Shell
You can enter the fda shell for a pipeline by running the following command:
fda shell p1
Within the shell, you can interact with the pipeline p1 by sending ad-hoc SQL queries to it.
The shell also lets you execute certain CLI commands like start, restart, shutdown without having to provide the
pipeline name every time. Type help for more information.