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
| Command | What it does |
|---|---|
anfra serve | Start a warm server for the current project. Other commands route to it when it is running. |
anfra query | Compile and run an AMQL query against a dataset. |
anfra validate | Validate the AMQL project, optionally scoped to file globs. |
anfra ingest | Build the local search catalog from context sources. |
anfra search | Search the local catalog. |
anfra status | Report whether a warm server is running and its sidecars are healthy. |
anfra update | Update the binary to the latest release. |
anfra version | Print 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.
| Flag | Description |
|---|---|
-d, --dataset | Name of the dataset to compile against. Required. |
-a, --aql | The AMQL query. If omitted, it is read from stdin. |
-g, --generate | Print the generated SQL instead of running the query. |
-c, --validate, --check | Type-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.
| Flag | Description |
|---|---|
-s, --source | Ingest only this context source. |
anfra search
Searches the local catalog:
anfra search "monthly revenue"anfra update
Replaces the binary with the latest release.
| Flag | Description |
|---|---|
--check | Only check for a newer release. Do not install it. |