cli-uses-lazy-imports-for-heavy-modules
IN premise
`asyncio`, `derive`, `ask`, and `Storage` are imported inside function bodies rather than at module level, keeping `reasons --help` fast.
Summary
The CLI defers importing expensive modules like asyncio and Storage until they're actually needed by a specific command. This keeps startup time fast for lightweight operations like showing help text, since Python only loads those heavy dependencies when a command that uses them is invoked.
Dependents
These beliefs depend on this one:
- startup-performance-uses-lazy-loading — Both the API and CLI layers defer importing heavy modules (derive, compact, ask, asyncio, Storage) to function bodies rather than module top-level, minimizing import-time overhead for CLI responsiveness.
Details
| Source | entries/2026/04/29/reasons_lib-cli.md |