From 9e6ceec39e4ec489c3f72069db79080c93ef05d1 Mon Sep 17 00:00:00 2001 From: ArchieChelle Date: Thu, 25 Jun 2026 00:35:10 -0400 Subject: [PATCH] Add --url flag to applypilot run to inject a specific job URL --- src/applypilot/cli.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/applypilot/cli.py b/src/applypilot/cli.py index 6c8be9128..2ffa0ba8f 100644 --- a/src/applypilot/cli.py +++ b/src/applypilot/cli.py @@ -97,12 +97,30 @@ def run( "lenient: banned words ignored, LLM judge skipped (fastest, fewest API calls)." ), ), + url: Optional[str] = typer.Option( + None, "--url", + help="Inject a specific job URL and run enrich -> score -> tailor -> cover -> pdf on it (skips discover).", + ), ) -> None: """Run pipeline stages: discover, enrich, score, tailor, cover, pdf.""" _bootstrap() from applypilot.pipeline import run_pipeline + # --url: inject the job into the DB and skip discover + if url: + from applypilot.database import get_connection, store_jobs + conn = get_connection() + new, dup = store_jobs(conn, [{"url": url}], site="manual", strategy="manual") + if new: + console.print(f"[green]Added job URL to pipeline:[/green] {url}") + else: + console.print(f"[yellow]Job URL already in database:[/yellow] {url}") + if not stages: + stages = ["enrich", "score", "tailor", "cover", "pdf"] + else: + stages = [s for s in stages if s != "discover"] + stage_list = stages if stages else ["all"] # Validate stage names