Skip to content

CLI help eagerly builds the analyzer graph and emits missing-key warnings #435

Description

@deepujain

Problem

Running skillspector --help constructs the complete analysis graph before Typer can render help. On a machine without LLM credentials, the help-only command takes roughly 17 seconds and emits analyzer availability warnings after the usage text:

WARNING [skillspector.graph] Skipping analyzer semantic_developer_intent: required API key is missing
WARNING [skillspector.graph] Skipping analyzer semantic_quality_policy: required API key is missing
WARNING [skillspector.graph] Skipping analyzer semantic_security_discovery: required API key is missing

The same eager initialization affects --version and other import-only CLI paths. These commands do not run a scan, so analyzer availability is irrelevant and the warnings look like help-command failures.

Reproduction

With the current main, clear provider credentials and run:

time skillspector --help

The command renders valid help, then prints the missing-key warnings. The delay comes from the module-level graph = create_graph() in skillspector.graph, imported by the CLI before argument dispatch.

Expected behavior

Help and version commands should return promptly without constructing analyzers or emitting scan-time warnings. The graph should still be constructed, and unavailable-analyzer warnings should still be emitted, when a real scan first invokes it.

Proposed scope

Make the exported graph object compile on first graph operation rather than at module import, preserving the existing graph.invoke / graph.ainvoke API. Add subprocess coverage that proves --help stays quiet without credentials and focused coverage that first invocation still delegates to the compiled graph.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions