CLI help eagerly builds the analyzer graph and emits missing-key warnings
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 17.9k
- Forks
- 1.5k
- Avg merge
- 5d 10h
- Merged PRs (30d)
- 66
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the module-level graph = create_graph() in skillspector.graph and trace how the CLI imports it before argument dispatch. Add the proposed subprocess coverage for credential-free --help and focused coverage for the existing graph.invoke and graph.ainvoke API; done means help and version avoid scan warnings while first scan invocation still compiles and delegates to the graph.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli, testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 76/100