3131from feast .feature_table import FeatureTable
3232from feast .loaders .yaml import yaml_loader
3333from feast .repo_config import load_repo_config
34- from feast .repo_operations import apply_total , registry_dump , teardown
34+ from feast .repo_operations import (
35+ apply_total ,
36+ cli_check_repo ,
37+ init_repo ,
38+ registry_dump ,
39+ teardown ,
40+ )
3541
3642_logger = logging .getLogger (__name__ )
3743
@@ -360,22 +366,28 @@ def project_list():
360366
361367
362368@cli .command ("apply" )
363- @click .argument ("repo_path" , type = click .Path (dir_okay = True , exists = True ))
369+ @click .argument (
370+ "repo_path" , type = click .Path (dir_okay = True , exists = True ), default = Path .cwd
371+ )
364372def apply_total_command (repo_path : str ):
365373 """
366374 Applies a feature repo
367375 """
376+ cli_check_repo (Path (repo_path ))
368377 repo_config = load_repo_config (Path (repo_path ))
369378
370379 apply_total (repo_config , Path (repo_path ).resolve ())
371380
372381
373382@cli .command ("teardown" )
374- @click .argument ("repo_path" , type = click .Path (dir_okay = True , exists = True ))
383+ @click .argument (
384+ "repo_path" , type = click .Path (dir_okay = True , exists = True ), default = Path .cwd
385+ )
375386def teardown_command (repo_path : str ):
376387 """
377388 Tear down infra for a feature repo
378389 """
390+ cli_check_repo (Path (repo_path ))
379391 repo_config = load_repo_config (Path (repo_path ))
380392
381393 teardown (repo_config , Path (repo_path ).resolve ())
@@ -393,13 +405,15 @@ def registry_dump_command(repo_path: str):
393405
394406
395407@cli .command ("materialize" )
396- @click .argument ("repo_path" , type = click .Path (dir_okay = True , exists = True ))
397408@click .argument ("start_ts" )
398409@click .argument ("end_ts" )
410+ @click .argument (
411+ "repo_path" , type = click .Path (dir_okay = True , exists = True ,), default = Path .cwd
412+ )
399413@click .option (
400414 "--views" , "-v" , help = "Feature views to materialize" , multiple = True ,
401415)
402- def materialize_command (repo_path : str , start_ts : str , end_ts : str , views : List [str ]):
416+ def materialize_command (start_ts : str , end_ts : str , repo_path : str , views : List [str ]):
403417 """
404418 Run a (non-incremental) materialization job to ingest data into the online store. Feast
405419 will read all data between START_TS and END_TS from the offline store and write it to the
@@ -416,5 +430,12 @@ def materialize_command(repo_path: str, start_ts: str, end_ts: str, views: List[
416430 )
417431
418432
433+ @cli .command ("init" )
434+ @click .option ("--minimal" , "-m" , is_flag = True , help = "Only generate the config" )
435+ def init_command (minimal : bool ):
436+ repo_path = Path .cwd ()
437+ init_repo (repo_path , minimal )
438+
439+
419440if __name__ == "__main__" :
420441 cli ()
0 commit comments