Anfra docs
Anfra Self-Hosted

CLI reference

Commands for running, querying, and validating an Anfra project

Run anfra --help for the list of commands, or anfra <command> --help for details on one command. Run commands from inside your Anfra project folder.

Commands

CommandWhat it does
anfra serveStart a warm server for the current project. Other commands route to it when it is running.
anfra queryCompile and run an AMQL query against a dataset.
anfra validateValidate the AMQL project, optionally scoped to file globs.
anfra ingestBuild the local search catalog from context sources.
anfra searchSearch the local catalog.
anfra statusReport whether a warm server is running and its sidecars are healthy.
anfra updateUpdate the binary to the latest release.
anfra versionPrint the Anfra version.

anfra serve

Starts the Anfra server for the current project and keeps it running. While it runs, database connections are reused across requests, and other anfra commands send their work to it instead of starting from scratch.

Only one server can run per project.

anfra query

Compiles and runs an AMQL query against a dataset.

FlagDescription
-d, --datasetName of the dataset to compile against. Required.
-a, --aqlThe AMQL query. If omitted, it is read from stdin.
-g, --generatePrint the generated SQL instead of running the query.
-c, --validate, --checkType-check the query and report diagnostics instead of running it.

anfra validate

Validates the models and datasets in the project. Pass file globs to report diagnostics only for matching files:

anfra validate "models/*.aml"

anfra ingest

Builds the local search catalog from context sources.

FlagDescription
-s, --sourceIngest only this context source.

Searches the local catalog:

anfra search "monthly revenue"

anfra update

Replaces the binary with the latest release.

FlagDescription
--checkOnly check for a newer release. Do not install it.

On this page