Add source files (main, cli, indexer modules)
This commit is contained in:
@@ -29,7 +29,7 @@ def cli(ctx, verbose):
|
|||||||
ctx.obj["verbose"] = verbose
|
ctx.obj["verbose"] = verbose
|
||||||
|
|
||||||
|
|
||||||
@cli.command(name="index")
|
@click.command(name="index")
|
||||||
@click.argument(
|
@click.argument(
|
||||||
"path", type=click.Path(exists=True, file_okay=True, dir_okay=True, path_type=Path)
|
"path", type=click.Path(exists=True, file_okay=True, dir_okay=True, path_type=Path)
|
||||||
)
|
)
|
||||||
@@ -64,7 +64,7 @@ def index_command(ctx, path, type, recursive, batch_size):
|
|||||||
console.print("Try specifying a type: --type openapi|readme|code")
|
console.print("Try specifying a type: --type openapi|readme|code")
|
||||||
|
|
||||||
|
|
||||||
@cli.command(name="search")
|
@click.command(name="search")
|
||||||
@click.argument("query", type=str)
|
@click.argument("query", type=str)
|
||||||
@click.option(
|
@click.option(
|
||||||
"--limit", "-l", type=int, default=None, help="Maximum number of results"
|
"--limit", "-l", type=int, default=None, help="Maximum number of results"
|
||||||
@@ -115,7 +115,7 @@ def search_command(ctx, query, limit, type, json, hybrid):
|
|||||||
console.print(f"\nFound {len(results)} result(s)")
|
console.print(f"\nFound {len(results)} result(s)")
|
||||||
|
|
||||||
|
|
||||||
@cli.command(name="list")
|
@click.command(name="list")
|
||||||
@click.option(
|
@click.option(
|
||||||
"--type",
|
"--type",
|
||||||
"-t",
|
"-t",
|
||||||
@@ -143,7 +143,7 @@ def list_command(ctx, type, json):
|
|||||||
console.print(table)
|
console.print(table)
|
||||||
|
|
||||||
|
|
||||||
@cli.command(name="stats")
|
@click.command(name="stats")
|
||||||
@click.pass_context
|
@click.pass_context
|
||||||
def stats_command(ctx):
|
def stats_command(ctx):
|
||||||
"""Show index statistics."""
|
"""Show index statistics."""
|
||||||
@@ -159,7 +159,7 @@ def stats_command(ctx):
|
|||||||
console.print(table)
|
console.print(table)
|
||||||
|
|
||||||
|
|
||||||
@cli.command(name="clear")
|
@click.command(name="clear")
|
||||||
@click.option("--type", "-t", type=click.Choice(["openapi", "readme", "code"]))
|
@click.option("--type", "-t", type=click.Choice(["openapi", "readme", "code"]))
|
||||||
@click.option("--force", "-f", is_flag=True, help="Skip confirmation prompt")
|
@click.option("--force", "-f", is_flag=True, help="Skip confirmation prompt")
|
||||||
@click.pass_context
|
@click.pass_context
|
||||||
@@ -189,7 +189,7 @@ def clear_command(ctx, type, force):
|
|||||||
console.print(format_success(f"Deleted {count} document(s)"))
|
console.print(format_success(f"Deleted {count} document(s)"))
|
||||||
|
|
||||||
|
|
||||||
@cli.command(name="config")
|
@click.command(name="config")
|
||||||
@click.option("--show", is_flag=True, help="Show current configuration")
|
@click.option("--show", is_flag=True, help="Show current configuration")
|
||||||
@click.option("--reset", is_flag=True, help="Reset configuration to defaults")
|
@click.option("--reset", is_flag=True, help="Reset configuration to defaults")
|
||||||
@click.pass_context
|
@click.pass_context
|
||||||
@@ -221,7 +221,7 @@ def config_command(ctx, show, reset):
|
|||||||
console.print(panel)
|
console.print(panel)
|
||||||
|
|
||||||
|
|
||||||
@cli.command(name="interactive")
|
@click.command(name="interactive")
|
||||||
@click.pass_context
|
@click.pass_context
|
||||||
def interactive_command(ctx):
|
def interactive_command(ctx):
|
||||||
"""Enter interactive search mode."""
|
"""Enter interactive search mode."""
|
||||||
|
|||||||
Reference in New Issue
Block a user