Chapter 7. Feature Store command line interface reference
You can use the Feature Store command-line interface (CLI) to manage your Feature Store deployments and repositories. The CLI tool, feast, is bundled with the Feature Store Python package and is available immediately after installation. You can run the commands in your workbench.
General usage of command line options
feast [OPTIONS] COMMAND [ARGS]...
Options
-c, --chdir TEXT- Switch to a different feature repository directory before executing the given subcommand.
--help- Show this message and exit.
7.1. Feature Store global command Copy linkLink copied to clipboard!
You can use the following global options with the feast command in your Feature Store workbench:
| Option | Description |
|---|---|
|
| Use this global, top-level option with other commands. |
|
|
Run |
7.2. Feature Store command line interface options Copy linkLink copied to clipboard!
The following table lists the available Feature Store CLI commands. Run these in your workbench.
| Command | Description |
|---|---|
|
| Create or update a Feature Store deployment. |
|
| Display the Feature Store configuration. |
|
| Delete a Feature Store object from the registry. |
|
| Access entities. |
|
| Access feature views. |
|
| Create a new Feature Store repository. |
|
| Run a non-incremental materialization job to ingest feature data. |
|
| Run an incremental materialization job to ingest feature data. |
|
| Print the contents of the metadata registry. |
|
| Tear down the deployed Feature Store infrastructure. |
|
| Display the Feature Store SDK version. |
7.3. Feature Store apply command Copy linkLink copied to clipboard!
The feast apply command updates a Feature Store deployment to match the feature definitions in the feature repository.
The command performs the following actions:
Scans definitions
Scans the Python files in the feature repository to identify Feature Store object definitions. This includes feature views, entities, and data sources.
Validates definitions
Validates feature definitions to ensure accuracy.
Synchronizes metadata
Synchronizes the metadata of Feature Store objects in the registry. If a registry does not exist, the Feature Store creates one. The standard registry is a
protobufbinary file stored on a disk, either locally or in an object store.Provisions infrastructure
Creates the necessary Feature Store infrastructure. The deployed infrastructure depends on the provider configuration specified in the
feature_store.yamlfile:- Local provider: Creates a SQLite online store.
Cloud provider: Creates cloud infrastructure for services such as Google Cloud Platform (GCP) or Amazon Web Services (AWS).
NoteCreating cloud infrastructure might incur costs.
The feast apply command registers or updates only objects found in your Python files. It does not delete objects that you remove from your code. To delete objects from the registry, use the feast delete command or the explicit delete methods available in the Python SDK.
7.4. Feature Store configuration command Copy linkLink copied to clipboard!
The Feature Store configuration command displays the active configuration for the Feature Store environment. The output includes both user-provided and default configurations.
Configuration example command and output
Feature Store configuration
project: foo
registry: data/registry.db
provider: local
online_store:
type: sqlite
path: data/online_store.db
offline_store:
type: dask
entity_key_serialization_version: 3
auth:
type: no_auth
7.5. Feature Store delete command Copy linkLink copied to clipboard!
The feast delete command removes a Feast object from the registry. This includes objects such as feature views, entities, data sources, and feature services.
The command searches for the specified object name across all object types, including entities, feature views, feature services, data sources, saved datasets, and validation references. It deletes the first matching object found and removes any associated infrastructure.
Delete syntax
feast delete <object_name>
The delete operation is permanent. Proceed with caution.
If multiple objects share the same name across different types, feast delete removes the first one it encounters. For programmatic deletion with greater control, use the Python SDK methods, such as store.delete_feature_view() or store.delete_feature_service().
Delete command examples
Delete a feature view named
driver_hourly_stats:feast delete driver_hourly_statsDelete an entity named
driver:feast delete driver
7.6. Feature Store entities list command Copy linkLink copied to clipboard!
The feast entities list command displays a list of all registered entities.
Entities syntax
feast entities list [options]
Options
--tags <text>-
Filters the list by tags (for example,
--tags 'key:value'). You can specify multiple tags. Items are returned only when all specified tags match.
Example command and output
$ feast entities list
NAME DESCRIPTION TYPE
driver_id driver id ValueType.INT64
7.7. Feature Store feature views command Copy linkLink copied to clipboard!
The feast feature-views list command displays a list of all registered feature views.
Feature views syntax
feast feature-views list [options]
Feature views options
--tags <text>-
Filters the list by tags (for example,
--tags 'key:value'). You can specify multiple tags. Items are returned only when all specified tags match.
Feature views example command and output
$ feast feature-views list
NAME ENTITIES TYPE
driver_hourly_stats {'driver'} FeatureView
7.8. Feature Store init command Copy linkLink copied to clipboard!
The feast init command creates a new feature repository to store feature definitions.
Init syntax
feast init <repository_name> [options]
Init options
-t-
Specifies a template for the repository (for example,
gcporaws).
Init examples
Create a repository with the default template
The following command creates a repository named
my_repo_name:$ feast init my_repo_nameInit output
Creating a new Feast repository in /projects/my_repo_name. . ├── data │ └── driver_stats.parquet ├── example.py └── feature_store.yamlCreate a repository using the Google Cloud Platform (GCP) template:
$ feast init -t gcp my_feature_repoSet the name of the new project:
$ feast init -t gcp my_feature_repo
7.9. Feature Store materialize command Copy linkLink copied to clipboard!
Use the feast materialize command to load data from feature views into the online store for a specific time range.
Materialize syntax
$ feast materialize [options] <start_date> <end_date>
Options
--disable-event-timestamp- Materializes all available data using the current date and time as the event timestamp. This flag is useful when the source data lacks event timestamp columns.
-v __<feature_view_name>__- Limits materialization to a specific feature view.
Materialize data within a time range
The following command materializes data between two ISO 8601 timestamps:
$ feast materialize 2020-01-01T00:00:00 2022-01-01T00:00:00
Materialize example output
Materializing 1 feature views from 2020-01-01 to 2022-01-01
driver_hourly_stats:
100%|██████████████████████████| 5/5 [00:00<00:00, 5949.37it/s]
Materialize without timestamps
The following command uses the current date and time for the event timestamp:
$ feast materialize --disable-event-timestamp
Materialize a specific feature view
The following command materializes the driver_hourly_stats feature view for a specific time range:
$ feast materialize -v driver_hourly_stats 2020-01-01T00:00:00 2022-01-01T00:00:00
The following command materializes the driver_hourly_stats feature view without event timestamps:
$ feast materialize --disable-event-timestamp -v driver_hourly_stats
7.10. Feature Store materialize-incremental command Copy linkLink copied to clipboard!
The feast materialize-incremental command loads data from feature views into the online store.
The command processes data starting from one of the following points:
- The end date of the previous materialization interval.
- The beginning of available history (if no previous materialization exists).
Materialize incremental syntax
$ feast materialize-incremental <end_date>
Materialize incremental example
$ feast materialize-incremental 2022-01-01T00:00:00