fix: resolve CI linting and type errors
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
"""Registry commands for sharing prompts."""
|
||||
|
||||
import click
|
||||
|
||||
from promptforge.registry import LocalRegistry, RemoteRegistry, RegistryEntry
|
||||
from promptforge.core.prompt import Prompt
|
||||
|
||||
@@ -51,8 +54,9 @@ def registry_add(ctx, prompt_name: str, author: str):
|
||||
|
||||
@registry.command("search")
|
||||
@click.argument("query")
|
||||
@click.option("--limit", default=20, help="Maximum results")
|
||||
@click.pass_obj
|
||||
def registry_search(ctx, query: str):
|
||||
def registry_search(ctx, query: str, limit: int):
|
||||
"""Search local registry."""
|
||||
registry = LocalRegistry()
|
||||
results = registry.search(query)
|
||||
@@ -61,7 +65,7 @@ def registry_search(ctx, query: str):
|
||||
click.echo("No results found")
|
||||
return
|
||||
|
||||
for result in results:
|
||||
for result in results[:limit]:
|
||||
entry = result.entry
|
||||
click.echo(f"{entry.name} (score: {result.relevance_score})")
|
||||
if entry.description:
|
||||
@@ -79,7 +83,7 @@ def registry_pull(ctx, entry_id: str):
|
||||
if remote.pull(entry_id, local):
|
||||
click.echo(f"Pulled entry {entry_id}")
|
||||
else:
|
||||
click.echo(f"Entry not found", err=True)
|
||||
click.echo("Entry not found", err=True)
|
||||
raise click.Abort()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user