# AUTOGENERATED! DO NOT EDIT! File to edit: 07_cli.ipynb (unless otherwise specified).

__all__ = ['app', 'recall', 'serve', '__main__']

# Cell
import typer
import memery.core
import streamlit.cli

# Cell
app = typer.Typer()

# Cell
@app.command()
def recall(path: str, query: str, n: int = 10):
    """Search recursively over a folder from the command line"""
    ranked = memery.core.query_flow(path, query=query)
    print(ranked[:n])
#     return(ranked)

# Cell
@app.command()
def serve():
    """Runs the streamlit GUI in your browser"""
    path = memery.__file__.replace('__init__.py','streamlit_app.py')
    streamlit.cli.main(['run',path])

# Cell
def __main__():
    app()