community_2_cli - grisuno/LazyOwn GitHub Wiki
cli
Community 2 | 113 files | cohesion 0.56
Definition
This community groups 113 file(s) rooted at cli with dominant language py (cohesion 0.56). Central symbols: AddonCatalog, AddonEntry, AuditConfig, AuthError, AutoSuggestEngine, BinarySpec, BinaryStatus, BuildReconPlanContractSpec. Core file: tests/test_command_palette.py (238 symbols). Documented purpose: LazyOwn CLI infrastructure. Tier 2 introduces a declarative, modular layer above [lazyown.py](https://github.com/grisuno/LazyOwn/blob/146a52570ef792d1ec01ec4d3709b0c159990e47/lazyown.py): - [cli/aliases.yaml](https://github.com/grisuno/LazyOwn/blob/146a52570ef792d1ec01ec4d3709b0c159990e47/cli/aliases.yaml) and :func:cli.aliases.load_aliases p.
Files
cli (47 files)
tests (45 files)
core (11 files)
poc_tui (4 files)
cli/commands (3 files)
. (1 files)
| File |
Language |
Layer |
Symbols |
Doc |
lazyown.py |
py |
utility |
129 |
yes |
modules (1 files)
scripts/devtools (1 files)
... and 93 more files in this community.
Key Symbols
SuggestionContext (class, cli/autosuggest.py:50) class SuggestionContext - Inputs available to every suggestion provider.
Suggestion (class, cli/autosuggest.py:71) class Suggestion - One next-command suggestion with its rationale.
SuggestionProvider (class, cli/autosuggest.py:92) class SuggestionProvider(Protocol) - Provider contract: examine context, return one suggestion or None.
suggest (method, cli/autosuggest.py:95) def suggest(self, context)
CompositeProvider (class, cli/autosuggest.py:98) class CompositeProvider - Aggregator that returns the highest-scoring suggestion across providers.
__init__ (method, cli/autosuggest.py:105) def __init__(self, providers) - Store the provider chain.
suggest (method, cli/autosuggest.py:115) def suggest(self, context) - Return the best suggestion across the chain, or None.
KillChainProvider (class, cli/autosuggest.py:134) class KillChainProvider - Provider backed by the static kill-chain adjacency map.
__init__ (method, cli/autosuggest.py:143) def __init__(self, chain, phase_priority) - Configure the provider.
suggest (method, cli/autosuggest.py:162) def suggest(self, context) - Return the first unseen adjacency, or phase fallback, or None.
GraphProvider (class, cli/autosuggest.py:189) class GraphProvider - Provider backed by the graphify knowledge-graph advisor.
__init__ (method, cli/autosuggest.py:197) def __init__(self, advisor) - Configure the provider.
suggest (method, cli/autosuggest.py:221) def suggest(self, context) - Query the advisor and adapt the top result to a :class:Suggestion.
AutoSuggestEngine (class, cli/autosuggest.py:245) class AutoSuggestEngine - Stateful holder for the active ghost-text suggestion.
__init__ (method, cli/autosuggest.py:254) def __init__(self, provider) - Store the provider and enabled flag.
enabled (method, cli/autosuggest.py:270) def enabled(self) - Whether the engine refreshes suggestions on each command.
set_enabled (method, cli/autosuggest.py:274) def set_enabled(self, value) - Toggle the engine without losing the provider chain.
current (method, cli/autosuggest.py:284) def current(self) - Return the suggestion last computed, or None when cleared.
clear (method, cli/autosuggest.py:288) def clear(self) - Drop the active suggestion (called after accept or abort).
refresh (method, cli/autosuggest.py:292) def refresh(self, context) - Recompute the suggestion from the provider chain.
accept (method, cli/autosuggest.py:309) def accept(self) - Return the active command string and clear the suggestion.
display_text (method, cli/autosuggest.py:317) def display_text(self) - Return the ANSI-coloured ghost-text fragment for legacy callers.
_truncate (function, cli/autosuggest.py:335) def _truncate(value, max_len) - Return value shortened to max_len characters with an ellipsis.
format_hint_line (function, cli/autosuggest.py:342) def format_hint_line(suggestion) - Build the dim hint string surfaced after each command.
render_hint_line (function, cli/autosuggest.py:375) def render_hint_line(engine) - Print one dim hint line for the engine's active suggestion.
_hint_console (function, cli/autosuggest.py:411) def _hint_console() - Return a lazily-initialised :class:rich.console.Console.
build_default_engine (function, cli/autosuggest.py:427) def build_default_engine(advisor, chain, phase_priority) - Wire the canonical provider chain used by the cmd2 shell.
_ChainEscExit (class, cli/chain_mode.py:73) class _ChainEscExit(Exception) - Internal signal: the operator pressed ESC at the chain prompt.
_read_line_unix (function, cli/chain_mode.py:77) def _read_line_unix(prompt) - Read one line in raw TTY mode, honouring ESC, Ctrl+C and backspace.
_read_line_windows (function, cli/chain_mode.py:136) def _read_line_windows(prompt) - Read one line on Windows, honouring ESC, Ctrl+C and backspace.
Internal vs External Edges
- Internal resolved imports (EXTRACTED): 389
- Cross-boundary resolved imports (EXTRACTED): 236
Connections
- [EXTRACTED] depends_on community 2 <-> 0 (strength 0.9): Extracted import edge crosses communities: cli/init.py imports cli/aliases.py.
- [EXTRACTED] depends_on community 2 <-> 1 (strength 0.9): Extracted import edge crosses communities: cli/chain_mode.py imports core/logging.py.
Risks
Open Questions
- What would break if the most connected file in cli changed?
- Should cli be split, given cohesion 0.56?
Sources